Browse code

MFt: Server HF support.

Maxim Sobolev authored on 01/05/2007 21:32:08
Showing 6 changed files
... ...
@@ -155,6 +155,9 @@ void clean_hdr_field(struct hdr_field* hf)
155 155
 		case HDR_USERAGENT_T:
156 156
 			break;
157 157
 
158
+		case HDR_SERVER_T:
159
+			break;
160
+
158 161
 		case HDR_ACCEPTDISPOSITION_T:
159 162
 			break;
160 163
 
... ...
@@ -83,6 +83,7 @@ enum _hdr_types_t {
83 83
 	HDR_PRIORITY_T				       /* Priority header field */,
84 84
 	HDR_SUBJECT_T				       /* Subject header field */,
85 85
 	HDR_USERAGENT_T				       /* User-Agent header field */,
86
+	HDR_SERVER_T				       /* Server header field */,
86 87
 	HDR_ACCEPTDISPOSITION_T		       /* Accept-Disposition hdr field */,
87 88
 	HDR_CONTENTDISPOSITION_T	       /* Content-Disposition hdr field */,
88 89
 	HDR_DIVERSION_T				       /* Diversion header field */,
... ...
@@ -146,6 +147,7 @@ typedef unsigned long long hdr_flags_t;
146 147
 #define HDR_PRIORITY_F				HDR_F_DEF(PRIORITY)
147 148
 #define HDR_SUBJECT_F				HDR_F_DEF(SUBJECT)
148 149
 #define HDR_USERAGENT_F				HDR_F_DEF(USERAGENT)
150
+#define HDR_SERVER_F				HDR_F_DEF(SERVER)
149 151
 #define HDR_ACCEPTDISPOSITION_F		HDR_F_DEF(ACCEPTDISPOSITION)
150 152
 #define HDR_CONTENTDISPOSITION_F	HDR_F_DEF(CONTENTDISPOSITION)
151 153
 #define HDR_DIVERSION_F				HDR_F_DEF(DIVERSION)
... ...
@@ -130,6 +130,8 @@
130 130
 #define _ispo_ 0x6f707369   /* "ispo" */
131 131
 #define _siti_ 0x69746973   /* "siti" */
132 132
 
133
+#define _serv_ 0x76726573   /* "serv" */
134
+
133 135
 #define _dive_ 0x65766964   /* "dive" */
134 136
 #define _rsio_ 0x6f697372   /* "rsio" */
135 137
 
... ...
@@ -203,6 +203,7 @@ char* get_hdr_field(char* buf, char* end, struct hdr_field* hdr)
203 203
 		case HDR_PRIORITY_T:
204 204
 		case HDR_SUBJECT_T:
205 205
 		case HDR_USERAGENT_T:
206
+		case HDR_SERVER_T:
206 207
 		case HDR_CONTENTDISPOSITION_T:
207 208
 		case HDR_ACCEPTDISPOSITION_T:
208 209
 		case HDR_DIVERSION_T:
... ...
@@ -426,6 +427,10 @@ int parse_headers(struct sip_msg* msg, hdr_flags_t flags, int next)
426 427
 				if (msg->user_agent==0) msg->user_agent = hf;
427 428
 				msg->parsed_flag|=HDR_USERAGENT_F;
428 429
 				break;
430
+			case HDR_SERVER_T:
431
+				if (msg->server==0) msg->server = hf;
432
+				msg->parsed_flag|=HDR_SERVER_F;
433
+				break;
429 434
 			case HDR_CONTENTDISPOSITION_T:
430 435
 				if (msg->content_disposition==0) msg->content_disposition = hf;
431 436
 				msg->parsed_flag|=HDR_CONTENTDISPOSITION_F;
... ...
@@ -217,6 +217,7 @@ struct sip_msg {
217 217
 	struct hdr_field* priority;
218 218
 	struct hdr_field* subject;
219 219
 	struct hdr_field* user_agent;
220
+	struct hdr_field* server;
220 221
 	struct hdr_field* content_disposition;
221 222
 	struct hdr_field* accept_disposition;
222 223
 	struct hdr_field* diversion;
... ...
@@ -82,6 +82,7 @@ static inline char* skip_ws(char* p, unsigned int size)
82 82
 #include "case_prio.h"     /* Priority */
83 83
 #include "case_subj.h"     /* Subject */
84 84
 #include "case_user.h"     /* User-Agent */
85
+#include "case_serv.h"     /* Server */
85 86
 #include "case_supp.h"     /* Supported */
86 87
 #include "case_dive.h"     /* Diversion */
87 88
 #include "case_remo.h"     /* Remote-Party-ID */
... ...
@@ -125,6 +126,7 @@ static inline char* skip_ws(char* p, unsigned int size)
125 126
         case _subj_: subj_CASE; \
126 127
         case _subs_: subs_CASE; \
127 128
         case _user_: user_CASE; \
129
+        case _serv_: serv_CASE; \
128 130
         case _dive_: dive_CASE; \
129 131
         case _remo_: remo_CASE; \
130 132
         case _refe_: refe_CASE; \