Browse code

- Introduced macro GET_NEXT_HOP which returns URI of the next hop (not necessary Request URI) - Introduced macro GET_RURI which returns Request-URI of a message (either new_uri or the original one)

Jan Janak authored on 01/04/2003 09:16:00
Showing 1 changed files
... ...
@@ -31,6 +31,7 @@
31 31
  *  2003-02-28  scratchpad compatibility abandoned (jiri)
32 32
  *  2003-01-28  removed scratchpad (jiri)
33 33
  *  2003-03-31  removed sip_msg->repl_add_rm (andrei)
34
+ *  2003-04-01  2 macros added: GET_NEXT_HOP and GET_RURI (janakj)
34 35
  */
35 36
 
36 37
 
... ...
@@ -74,6 +75,27 @@ if (  (*tmp==(firstchar) || *tmp==((firstchar) | 32)) &&                  \
74 75
 }
75 76
 
76 77
 
78
+/*
79
+ * Return a URI to which the message should be really sent (not what should
80
+ * be in the Request URI. The following fields are tried in this order:
81
+ * 1) dst_uri
82
+ * 2) new_uri
83
+ * 3) first_line.u.request.uri
84
+ */
85
+#define GET_NEXT_HOP(m) \
86
+(((m)->dst_uri.s && (m)->dst_uri.len) ? ((m)->dst_uri) : \
87
+(((m)->new_uri.s && (m)->new_uri.len) ? ((m)->new_uri) : ((m)->first_line.u.request.uri)))
88
+
89
+
90
+/*
91
+ * Return the Reqeust URI of a message.
92
+ * The following fields are tried in this order:
93
+ * 1) new_uri
94
+ * 2) first_line.u.request.uri
95
+ */
96
+#define GET_RURI(m) \
97
+(((m)->new_uri.s && (m)->new_uri.len) ? ((m)->new_uri) : ((m)->first_line.u.request.uri))
98
+
77 99
 
78 100
 struct sip_uri {
79 101
 	str user;     /* Username */