[sr-dev] git:master: tm, tmx: move small redundant skip_hf macro to ut.h

Henning Westerholt henning.westerholt at 1und1.de
Wed Jul 6 10:06:15 CEST 2011


Module: sip-router
Branch: master
Commit: 71a7a864c6d18f4fc0bde76c2f80e15df48d1476
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=71a7a864c6d18f4fc0bde76c2f80e15df48d1476

Author: Henning Westerholt <henning.westerholt at 1und1.de>
Committer: Henning Westerholt <henning.westerholt at 1und1.de>
Date:   Tue Jul  5 23:44:11 2011 +0200

tm, tmx: move small redundant skip_hf macro to ut.h

- move small redundant skip_hf macro in in tm and tmx to tm/ut.h file
- this header is already included from the callers
- rename macro to a bit more descriptive name, no other changes

---

 modules/tm/rpc_uac.c |   11 +----------
 modules/tm/ut.h      |    9 +++++++++
 modules_k/tmx/t_mi.c |    9 +--------
 3 files changed, 11 insertions(+), 18 deletions(-)

diff --git a/modules/tm/rpc_uac.c b/modules/tm/rpc_uac.c
index f1458a1..a305b63 100644
--- a/modules/tm/rpc_uac.c
+++ b/modules/tm/rpc_uac.c
@@ -42,15 +42,6 @@
 
 
 
-#define skip_hf(_hf) (             \
-    ((_hf)->type == HDR_FROM_T)   || \
-    ((_hf)->type == HDR_TO_T)     || \
-    ((_hf)->type == HDR_CALLID_T) || \
-    ((_hf)->type == HDR_CSEQ_T)      \
-)
-
-
-
 /** make sure the rpc user created the msg properly.
  * Make sure that the FIFO user created the message
  * correctly and fill some extra parameters in function
@@ -174,7 +165,7 @@ static char *get_hfblock(str *uri, struct hdr_field *hf, int proto,
 	}
 
 	for (; hf; hf = hf->next) {
-		if (skip_hf(hf)) continue;
+		if (tm_skip_hf(hf)) continue;
 
 		begin = needle = hf->name.s; 
 		p = hf->len;
diff --git a/modules/tm/ut.h b/modules/tm/ut.h
index fff774b..4ca2751 100644
--- a/modules/tm/ut.h
+++ b/modules/tm/ut.h
@@ -61,6 +61,15 @@
 #include "../../cfg_core.h" /* cfg_get(core, core_cfg, use_dns_failover) */
 #endif
 
+
+/*! Which header fields should be skipped */
+#define tm_skip_hf(_hf) \
+	(((_hf)->type == HDR_FROM_T)  || \
+	((_hf)->type == HDR_TO_T)     || \
+	((_hf)->type == HDR_CALLID_T) || \
+	((_hf)->type == HDR_CSEQ_T))
+
+
 /* a forced_proto takes precedence if != PROTO_NONE */
 inline static enum sip_protos get_proto(enum sip_protos force_proto,
 										enum sip_protos proto)
diff --git a/modules_k/tmx/t_mi.c b/modules_k/tmx/t_mi.c
index e784bf6..4e31220 100644
--- a/modules_k/tmx/t_mi.c
+++ b/modules_k/tmx/t_mi.c
@@ -42,13 +42,6 @@
 #include "tmx_mod.h"
 
 
-/*! Which header fields should be skipped */
-#define skip_hf(_hf) \
-	(((_hf)->type == HDR_FROM_T)  || \
-	((_hf)->type == HDR_TO_T)     || \
-	((_hf)->type == HDR_CALLID_T) || \
-	((_hf)->type == HDR_CSEQ_T))
-
 
 /*!
  * \brief Convert a URI into socket address.
@@ -183,7 +176,7 @@ static inline char *get_hfblock( str *uri, struct hdr_field *hf, int *l, struct
 	portname=sock_name=0;
 
 	for (; hf; hf=hf->next) {
-		if (skip_hf(hf)) continue;
+		if (tm_skip_hf(hf)) continue;
 
 		begin=needle=hf->name.s; 
 		hf_avail=hf->len;




More information about the sr-dev mailing list