[SR-Dev] git:master: Replace explicit flag values with bit shifts for better readability

Jan Janak jan at iptel.org
Mon Mar 2 22:54:19 CET 2009


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

Author: Jan Janak <jan at iptel.org>
Committer: Jan Janak <jan at iptel.org>
Date:   Mon Mar  2 21:42:09 2009 +0000

Replace explicit flag values with bit shifts for better readability

---

 parser/msg_parser.h |   26 +++++++++++++-------------
 1 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/parser/msg_parser.h b/parser/msg_parser.h
index ffa3e19..98f98aa 100644
--- a/parser/msg_parser.h
+++ b/parser/msg_parser.h
@@ -82,20 +82,20 @@ enum request_method { METHOD_UNDEF=0, METHOD_INVITE=1, METHOD_CANCEL=2, METHOD_A
 	METHOD_NOTIFY=128, METHOD_MESSAGE=256, METHOD_OPTIONS=512,
 	METHOD_OTHER=1024 };
 
-#define FL_FORCE_RPORT 1   /* force rport */
-#define FL_FORCE_ACTIVE 2  /* force active SDP */
-#define FL_SDP_IP_AFS 4    /* SDP IP rewritten */
-#define FL_SDP_PORT_AFS 8  /* SDP port rewritten */
-#define FL_SHM_CLONE   16  /* msg cloned in SHM as a single chunk */
-#define FL_TIMEOUT     32  /* message belongs to an "expired" branch
-                               (for failure route use) */
-#define FL_REPLIED     64  /* message branch received at least one reply
-                                (for failure route use) */
-#define FL_HASH_INDEX  128 /* msg->hash_index contains a valid value (tm use)*/
-
-#define FL_MTU_TCP_FB   256
-#define FL_MTU_TLS_FB   512
-#define FL_MTU_SCTP_FB 1024
+#define FL_FORCE_RPORT  (1 << 0)  /* force rport */
+#define FL_FORCE_ACTIVE (1 << 1)  /* force active SDP */
+#define FL_SDP_IP_AFS   (1 << 2)  /* SDP IP rewritten */
+#define FL_SDP_PORT_AFS (1 << 3)  /* SDP port rewritten */
+#define FL_SHM_CLONE    (1 << 4)  /* msg cloned in SHM as a single chunk */
+#define FL_TIMEOUT      (1 << 5)  /* message belongs to an "expired" branch
+									 (for failure route use) */
+#define FL_REPLIED      (1 << 6)  /* message branch received at least one reply
+									 (for failure route use) */
+#define FL_HASH_INDEX   (1 << 7)  /* msg->hash_index contains a valid value (tm use)*/
+
+#define FL_MTU_TCP_FB   (1 << 8)
+#define FL_MTU_TLS_FB   (1 << 9)
+#define FL_MTU_SCTP_FB  (1 << 10)
 #define FL_MTU_FB_MASK  (FL_MTU_TCP_FB|FL_MTU_TLS_FB|FL_MTU_SCTP_FB)
 
 




More information about the sr-dev mailing list