瀏覽代碼

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
Henning Westerholt 14 年之前
父節點
當前提交
71a7a864c6
共有 3 個文件被更改,包括 11 次插入18 次删除
  1. 1 10
      modules/tm/rpc_uac.c
  2. 9 0
      modules/tm/ut.h
  3. 1 8
      modules_k/tmx/t_mi.c

+ 1 - 10
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;

+ 9 - 0
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)

+ 1 - 8
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;