Browse code

Hook up Server header field support.

Maxim Sobolev authored on 01/05/2007 21:25:53
Showing 6 changed files
... ...
@@ -157,6 +157,9 @@ void clean_hdr_field(struct hdr_field* hf)
157 157
 		case HDR_USERAGENT_T:
158 158
 			break;
159 159
 
160
+		case HDR_SERVER_T:
161
+			break;
162
+
160 163
 		case HDR_ACCEPTDISPOSITION_T:
161 164
 			break;
162 165
 
... ...
@@ -84,6 +84,7 @@ enum _hdr_types_t {
84 84
 	HDR_PRIORITY_T				       /* Priority header field */,
85 85
 	HDR_SUBJECT_T				       /* Subject header field */,
86 86
 	HDR_USERAGENT_T				       /* User-Agent header field */,
87
+	HDR_SERVER_T				       /* Server header field */,
87 88
 	HDR_ACCEPTDISPOSITION_T		       /* Accept-Disposition hdr field */,
88 89
 	HDR_CONTENTDISPOSITION_T	       /* Content-Disposition hdr field */,
89 90
 	HDR_DIVERSION_T				       /* Diversion header field */,
... ...
@@ -150,6 +151,7 @@ typedef unsigned long long hdr_flags_t;
150 151
 #define HDR_PRIORITY_F				HDR_F_DEF(PRIORITY)
151 152
 #define HDR_SUBJECT_F				HDR_F_DEF(SUBJECT)
152 153
 #define HDR_USERAGENT_F				HDR_F_DEF(USERAGENT)
154
+#define HDR_SERVER_F				HDR_F_DEF(SERVER)
153 155
 #define HDR_ACCEPTDISPOSITION_F		HDR_F_DEF(ACCEPTDISPOSITION)
154 156
 #define HDR_CONTENTDISPOSITION_F	HDR_F_DEF(CONTENTDISPOSITION)
155 157
 #define HDR_DIVERSION_F				HDR_F_DEF(DIVERSION)
... ...
@@ -135,6 +135,8 @@
135 135
 #define _ispo_ 0x6f707369   /* "ispo" */
136 136
 #define _siti_ 0x69746973   /* "siti" */
137 137
 
138
+#define _serv_ 0x76726573   /* "serv" */
139
+
138 140
 #define _dive_ 0x65766964   /* "dive" */
139 141
 #define _rsio_ 0x6f697372   /* "rsio" */
140 142
 
... ...
@@ -259,6 +259,7 @@ char* get_hdr_field(char* buf, char* end, struct hdr_field* hdr)
259 259
 		case HDR_PRIORITY_T:
260 260
 		case HDR_SUBJECT_T:
261 261
 		case HDR_USERAGENT_T:
262
+		case HDR_SERVER_T:
262 263
 		case HDR_CONTENTDISPOSITION_T:
263 264
 		case HDR_ACCEPTDISPOSITION_T:
264 265
 		case HDR_DIVERSION_T:
... ...
@@ -482,6 +483,10 @@ int parse_headers(struct sip_msg* msg, hdr_flags_t flags, int next)
482 483
 				if (msg->user_agent==0) msg->user_agent = hf;
483 484
 				msg->parsed_flag|=HDR_USERAGENT_F;
484 485
 				break;
486
+			case HDR_SERVER_T:
487
+				if (msg->server==0) msg->server = hf;
488
+				msg->parsed_flag|=HDR_SERVER_F;
489
+				break;
485 490
 			case HDR_CONTENTDISPOSITION_T:
486 491
 				if (msg->content_disposition==0) msg->content_disposition = hf;
487 492
 				msg->parsed_flag|=HDR_CONTENTDISPOSITION_F;
... ...
@@ -232,6 +232,7 @@ struct sip_msg {
232 232
 	struct hdr_field* priority;
233 233
 	struct hdr_field* subject;
234 234
 	struct hdr_field* user_agent;
235
+	struct hdr_field* server;
235 236
 	struct hdr_field* content_disposition;
236 237
 	struct hdr_field* accept_disposition;
237 238
 	struct hdr_field* diversion;
... ...
@@ -83,6 +83,7 @@ static inline char* skip_ws(char* p, unsigned int size)
83 83
 #include "case_prio.h"     /* Priority */
84 84
 #include "case_subj.h"     /* Subject */
85 85
 #include "case_user.h"     /* User-Agent */
86
+#include "case_serv.h"     /* Server */
86 87
 #include "case_supp.h"     /* Supported */
87 88
 #include "case_dive.h"     /* Diversion */
88 89
 #include "case_remo.h"     /* Remote-Party-ID */
... ...
@@ -128,6 +129,7 @@ static inline char* skip_ws(char* p, unsigned int size)
128 129
         case _subj_: subj_CASE; \
129 130
         case _subs_: subs_CASE; \
130 131
         case _user_: user_CASE; \
132
+        case _serv_: serv_CASE; \
131 133
         case _dive_: dive_CASE; \
132 134
         case _remo_: remo_CASE; \
133 135
         case _refe_: refe_CASE; \