Browse code

core, lib, modules: restructured source code tree

- new folder src/ to hold the source code for main project applications
- main.c is in src/
- all core files are subfolder are in src/core/
- modules are in src/modules/
- libs are in src/lib/
- application Makefiles are in src/
- application binary is built in src/ (src/kamailio)

Daniel-Constantin Mierla authored on 07/12/2016 11:03:51
Showing 1 changed files
1 1
deleted file mode 100644
... ...
@@ -1,266 +0,0 @@
1
-/*
2
- * Copyright (C) 2001-2003 FhG Fokus
3
- *
4
- * This file is part of Kamailio, a free SIP server.
5
- *
6
- * Kamailio is free software; you can redistribute it and/or modify
7
- * it under the terms of the GNU General Public License as published by
8
- * the Free Software Foundation; either version 2 of the License, or
9
- * (at your option) any later version
10
- *
11
- * Kamailio is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
19
- *
20
- */
21
-
22
-/** Parser :: parse headers.
23
- * @file 
24
- *
25
- * @ingroup parser
26
- */
27
-
28
-
29
-
30
-#ifndef HF_H
31
-#define HF_H
32
-
33
-#include "../str.h"
34
-#include "../comp_defs.h"
35
-
36
-
37
-
38
-/** header types enum.
39
- * 
40
- * @note
41
- * if you add a new type:
42
- *  - make sure it's not greater than 63
43
- *  - make sure you add the corresponding flag to the hdr_flags_t defs below
44
- *  - update clean_hdr_field (in hf.c)
45
- *  - update sip_msg_cloner (modules/tm/sip_msg.c)
46
- *  - update parse_headers (msg_parser.c)
47
- *  - update get_hdr_field (msg_parser.c)
48
- */
49
-
50
-enum _hdr_types_t {
51
-	HDR_ERROR_T					= -1   /*!< Error while parsing */,
52
-	HDR_OTHER_T					=  0   /*!< Some other header field */,
53
-	HDR_VIA_T					=  1   /*!< Via header field */,
54
-	HDR_VIA1_T					=  1   /*!< First Via header field */,
55
-	HDR_VIA2_T					=  2   /*!< only used as flag */,
56
-	HDR_TO_T					       /*!< To header field */,
57
-	HDR_FROM_T					       /*!< From header field */,
58
-	HDR_CSEQ_T					       /*!< CSeq header field */,
59
-	HDR_CALLID_T				       /*!< Call-Id header field */,
60
-	HDR_CONTACT_T				       /*!< Contact header field */,
61
-	HDR_MAXFORWARDS_T			       /*!< MaxForwards header field */,
62
-	HDR_ROUTE_T					       /*!< Route header field */,
63
-	HDR_RECORDROUTE_T			       /*!< Record-Route header field */,
64
-	HDR_CONTENTTYPE_T			       /*!< Content-Type header field */,
65
-	HDR_CONTENTLENGTH_T			       /*!< Content-Length header field */,
66
-	HDR_AUTHORIZATION_T			       /*!< Authorization header field */,
67
-	HDR_EXPIRES_T				       /*!< Expires header field */,
68
-	HDR_MIN_EXPIRES_T			       /*!< Min-Expires header */,
69
-	HDR_PROXYAUTH_T				       /*!< Proxy-Authorization hdr field */,
70
-	HDR_SUPPORTED_T				       /*!< Supported  header field */,
71
-	HDR_REQUIRE_T				       /*!< Require header */,
72
-	HDR_PROXYREQUIRE_T			       /*!< Proxy-Require header field */,
73
-	HDR_UNSUPPORTED_T			       /*!< Unsupported header field */,
74
-	HDR_ALLOW_T					       /*!< Allow header field */,
75
-	HDR_EVENT_T					       /*!< Event header field */,
76
-	HDR_ACCEPT_T				       /*!< Accept header field */,
77
-	HDR_ACCEPTLANGUAGE_T		       /*!< Accept-Language header field */,
78
-	HDR_ORGANIZATION_T			       /*!< Organization header field */,
79
-	HDR_PRIORITY_T				       /*!< Priority header field */,
80
-	HDR_SUBJECT_T				       /*!< Subject header field */,
81
-	HDR_USERAGENT_T				       /*!< User-Agent header field */,
82
-	HDR_SERVER_T				       /*!< Server header field */,
83
-	HDR_CONTENTDISPOSITION_T	       /*!< Content-Disposition hdr field */,
84
-	HDR_DIVERSION_T				       /*!< Diversion header field */,
85
-	HDR_RPID_T					       /*!< Remote-Party-ID header field */,
86
-	HDR_REFER_TO_T				       /*!< Refer-To header fiels */,
87
-	HDR_SIPIFMATCH_T			       /*!< SIP-If-Match header field */,
88
-	HDR_SESSIONEXPIRES_T		       /*!< Session-Expires header */,
89
-	HDR_MIN_SE_T				       /*!< Min-SE */,
90
-	HDR_SUBSCRIPTION_STATE_T	       /*!< Subscription-State */,
91
-	HDR_ACCEPTCONTACT_T			       /*!< Accept-Contact header */,
92
-	HDR_ALLOWEVENTS_T			       /*!< Allow-Events header */,
93
-	HDR_CONTENTENCODING_T		       /*!< Content-Encoding header */,
94
-	HDR_REFERREDBY_T			       /*!< Referred-By header */,
95
-	HDR_REJECTCONTACT_T			       /*!< Reject-Contact header */,
96
-	HDR_REQUESTDISPOSITION_T	       /*!< Request-Disposition header */,
97
-	HDR_WWW_AUTHENTICATE_T		       /*!< WWW-Authenticate header field */,
98
-	HDR_PROXY_AUTHENTICATE_T	       /*!< Proxy-Authenticate header field */,
99
-	HDR_DATE_T			       /*!< Date header field */,
100
-	HDR_IDENTITY_T			       /*!< Identity header field */,
101
-	HDR_IDENTITY_INFO_T		       /*!< Identity-info header field */,
102
-	HDR_RETRY_AFTER_T		           /*!< Retry-After header field */,
103
-	HDR_PPI_T                          /*!< P-Preferred-Identity header field*/,
104
-	HDR_PAI_T                          /*!< P-Asserted-Identity header field*/,
105
-	HDR_PATH_T                         /*!< Path header field */,
106
-	HDR_PRIVACY_T				       /*!< Privacy header field */,
107
-	HDR_REASON_T				       /**< Reason header field */,
108
-	HDR_EOH_T					       /*!< End of message header */
109
-};
110
-
111
-
112
-typedef unsigned long long hdr_flags_t;
113
-
114
-/** type to flag conversion.
115
- * WARNING: HDR_ERROR_T has no corresponding FLAG ! */
116
-#define HDR_T2F(type)	\
117
-		(((type)!=HDR_EOH_T)?((hdr_flags_t)1<<(type)):(~(hdr_flags_t)0))
118
-
119
-/** helper macro for easy defining and keeping in sync the flags enum. */
120
-#define HDR_F_DEF(name)		HDR_T2F(HDR_##name##_T)
121
-
122
-/** @name flags definitions.
123
- * (enum won't work with all the compiler (e.g. icc) due to the 64bit size) */
124
-/*!{ */
125
-#define HDR_EOH_F					HDR_F_DEF(EOH)
126
-#define HDR_VIA_F					HDR_F_DEF(VIA)
127
-#define HDR_VIA1_F					HDR_F_DEF(VIA1)
128
-#define HDR_VIA2_F					HDR_F_DEF(VIA2)
129
-#define HDR_TO_F					HDR_F_DEF(TO)
130
-#define HDR_FROM_F					HDR_F_DEF(FROM)
131
-#define HDR_CSEQ_F					HDR_F_DEF(CSEQ)
132
-#define HDR_CALLID_F				HDR_F_DEF(CALLID)
133
-#define HDR_CONTACT_F				HDR_F_DEF(CONTACT)
134
-#define HDR_MAXFORWARDS_F			HDR_F_DEF(MAXFORWARDS)
135
-#define HDR_ROUTE_F					HDR_F_DEF(ROUTE)
136
-#define HDR_RECORDROUTE_F			HDR_F_DEF(RECORDROUTE)
137
-#define HDR_CONTENTTYPE_F			HDR_F_DEF(CONTENTTYPE)
138
-#define HDR_CONTENTLENGTH_F			HDR_F_DEF(CONTENTLENGTH)
139
-#define HDR_AUTHORIZATION_F			HDR_F_DEF(AUTHORIZATION)
140
-#define HDR_EXPIRES_F				HDR_F_DEF(EXPIRES)
141
-#define HDR_MIN_EXPIRES_F			HDR_F_DEF(MIN_EXPIRES)
142
-#define HDR_PROXYAUTH_F				HDR_F_DEF(PROXYAUTH)
143
-#define HDR_SUPPORTED_F				HDR_F_DEF(SUPPORTED)
144
-#define HDR_REQUIRE_F				HDR_F_DEF(REQUIRE)
145
-#define HDR_PROXYREQUIRE_F			HDR_F_DEF(PROXYREQUIRE)
146
-#define HDR_UNSUPPORTED_F			HDR_F_DEF(UNSUPPORTED)
147
-#define HDR_ALLOW_F					HDR_F_DEF(ALLOW)
148
-#define HDR_EVENT_F					HDR_F_DEF(EVENT)
149
-#define HDR_ACCEPT_F				HDR_F_DEF(ACCEPT)
150
-#define HDR_ACCEPTLANGUAGE_F		HDR_F_DEF(ACCEPTLANGUAGE)
151
-#define HDR_ORGANIZATION_F			HDR_F_DEF(ORGANIZATION)
152
-#define HDR_PRIORITY_F				HDR_F_DEF(PRIORITY)
153
-#define HDR_SUBJECT_F				HDR_F_DEF(SUBJECT)
154
-#define HDR_USERAGENT_F				HDR_F_DEF(USERAGENT)
155
-#define HDR_SERVER_F				HDR_F_DEF(SERVER)
156
-#define HDR_CONTENTDISPOSITION_F	HDR_F_DEF(CONTENTDISPOSITION)
157
-#define HDR_DIVERSION_F				HDR_F_DEF(DIVERSION)
158
-#define HDR_RPID_F					HDR_F_DEF(RPID)
159
-#define HDR_REFER_TO_F				HDR_F_DEF(REFER_TO)
160
-#define HDR_SIPIFMATCH_F			HDR_F_DEF(SIPIFMATCH)
161
-#define HDR_SESSIONEXPIRES_F		HDR_F_DEF(SESSIONEXPIRES)
162
-#define HDR_MIN_SE_F				HDR_F_DEF(MIN_SE)
163
-#define HDR_SUBSCRIPTION_STATE_F	HDR_F_DEF(SUBSCRIPTION_STATE)
164
-#define HDR_ACCEPTCONTACT_F			HDR_F_DEF(ACCEPTCONTACT)
165
-#define HDR_ALLOWEVENTS_F			HDR_F_DEF(ALLOWEVENTS)
166
-#define HDR_CONTENTENCODING_F		HDR_F_DEF(CONTENTENCODING)
167
-#define HDR_REFERREDBY_F			HDR_F_DEF(REFERREDBY)
168
-#define HDR_REJECTCONTACT_F			HDR_F_DEF(REJECTCONTACT)
169
-#define HDR_REQUESTDISPOSITION_F	HDR_F_DEF(REQUESTDISPOSITION)
170
-#define HDR_WWW_AUTHENTICATE_F		HDR_F_DEF(WWW_AUTHENTICATE)
171
-#define HDR_PROXY_AUTHENTICATE_F	HDR_F_DEF(PROXY_AUTHENTICATE)
172
-#define HDR_DATE_F			HDR_F_DEF(DATE)
173
-#define HDR_IDENTITY_F			HDR_F_DEF(IDENTITY)
174
-#define HDR_IDENTITY_INFO_F		HDR_F_DEF(IDENTITY_INFO)
175
-#define HDR_RETRY_AFTER_F			HDR_F_DEF(RETRY_AFTER)
176
-#define HDR_PPI_F                   HDR_F_DEF(PPI)
177
-#define HDR_PAI_F                   HDR_F_DEF(PAI)
178
-#define HDR_PATH_F                  HDR_F_DEF(PATH)
179
-#define HDR_PRIVACY_F               HDR_F_DEF(PRIVACY)
180
-#define HDR_REASON_F				HDR_F_DEF(REASON)
181
-
182
-#define HDR_OTHER_F					HDR_F_DEF(OTHER)
183
-
184
-/*!} */ /* Doxygen end marker*/
185
-
186
-typedef enum _hdr_types_t hdr_types_t;
187
-
188
-/** Format: name':' body.
189
- */
190
-typedef struct hdr_field {
191
-	hdr_types_t type;       /*!< Header field type */
192
-	str name;               /*!< Header field name */
193
-	str body;               /*!< Header field body (may not include CRLF) */
194
-	int len;		/*!< length from hdr start until EoHF (incl.CRLF) */
195
-	void* parsed;           /*!< Parsed data structures */
196
-	struct hdr_field* next; /*!< Next header field in the list */
197
-} hdr_field_t;
198
-
199
-
200
-/* type of the function to free the structure of parsed header field */
201
-typedef void (*hf_parsed_free_f)(void *parsed);
202
-
203
-/* structure to hold the function to free the parsed header field */
204
-typedef struct hdr_parsed {
205
-	hf_parsed_free_f hfree;
206
-} hf_parsed_t;
207
-
208
-/** returns true if the header links allocated memory on parse field. */
209
-static inline int hdr_allocs_parse(struct hdr_field* hdr)
210
-{
211
-	switch(hdr->type){
212
-		case HDR_ACCEPT_T:
213
-		case HDR_ALLOW_T:
214
-		case HDR_AUTHORIZATION_T:
215
-		case HDR_CONTACT_T:
216
-		case HDR_CONTENTDISPOSITION_T:
217
-		case HDR_CSEQ_T:
218
-		case HDR_DATE_T:
219
-		case HDR_DIVERSION_T:
220
-		case HDR_EVENT_T:
221
-		case HDR_EXPIRES_T:
222
-		case HDR_MIN_EXPIRES_T:
223
-		case HDR_FROM_T:
224
-		case HDR_IDENTITY_INFO_T:
225
-		case HDR_IDENTITY_T:
226
-		case HDR_PAI_T:
227
-		case HDR_PPI_T:
228
-		case HDR_PROXYAUTH_T:
229
-		case HDR_RECORDROUTE_T:
230
-		case HDR_REFER_TO_T:
231
-		case HDR_ROUTE_T:
232
-		case HDR_RPID_T:
233
-		case HDR_SESSIONEXPIRES_T:
234
-		case HDR_SIPIFMATCH_T:
235
-		case HDR_SUBSCRIPTION_STATE_T:
236
-		case HDR_SUPPORTED_T:
237
-		case HDR_TO_T:
238
-		case HDR_VIA_T:
239
-			return 1;
240
-		default:
241
-			return 0;
242
-	}
243
-}
244
-
245
-/** frees a hdr_field structure.
246
- * WARNING: it frees only parsed (and not name.s, body.s)
247
- */
248
-void clean_hdr_field(struct hdr_field* const hf);
249
-
250
-
251
-/** frees a hdr_field list.
252
- * WARNING: frees only ->parsed and ->next
253
- */
254
-void free_hdr_field_lst(struct hdr_field* hf);
255
-
256
-/* print content of hdr_field */
257
-void dump_hdr_field( struct hdr_field const* const hf);
258
-
259
-/**
260
- * free hdr parsed structure using inner free function
261
- * - hdr parsed struct must have as first file a free function,
262
- *   so it can be caseted to hf_parsed_t
263
- */
264
-void hdr_free_parsed(void **h_parsed);
265
-
266
-#endif /* HF_H */
Browse code

parser: Add parser for Min-Expires

Alex Hermann authored on 05/07/2016 09:45:41
Showing 1 changed files
... ...
@@ -65,6 +65,7 @@ enum _hdr_types_t {
65 65
 	HDR_CONTENTLENGTH_T			       /*!< Content-Length header field */,
66 66
 	HDR_AUTHORIZATION_T			       /*!< Authorization header field */,
67 67
 	HDR_EXPIRES_T				       /*!< Expires header field */,
68
+	HDR_MIN_EXPIRES_T			       /*!< Min-Expires header */,
68 69
 	HDR_PROXYAUTH_T				       /*!< Proxy-Authorization hdr field */,
69 70
 	HDR_SUPPORTED_T				       /*!< Supported  header field */,
70 71
 	HDR_REQUIRE_T				       /*!< Require header */,
... ...
@@ -137,6 +138,7 @@ typedef unsigned long long hdr_flags_t;
137 138
 #define HDR_CONTENTLENGTH_F			HDR_F_DEF(CONTENTLENGTH)
138 139
 #define HDR_AUTHORIZATION_F			HDR_F_DEF(AUTHORIZATION)
139 140
 #define HDR_EXPIRES_F				HDR_F_DEF(EXPIRES)
141
+#define HDR_MIN_EXPIRES_F			HDR_F_DEF(MIN_EXPIRES)
140 142
 #define HDR_PROXYAUTH_F				HDR_F_DEF(PROXYAUTH)
141 143
 #define HDR_SUPPORTED_F				HDR_F_DEF(SUPPORTED)
142 144
 #define HDR_REQUIRE_F				HDR_F_DEF(REQUIRE)
... ...
@@ -217,6 +219,7 @@ static inline int hdr_allocs_parse(struct hdr_field* hdr)
217 219
 		case HDR_DIVERSION_T:
218 220
 		case HDR_EVENT_T:
219 221
 		case HDR_EXPIRES_T:
222
+		case HDR_MIN_EXPIRES_T:
220 223
 		case HDR_FROM_T:
221 224
 		case HDR_IDENTITY_INFO_T:
222 225
 		case HDR_IDENTITY_T:
Browse code

core parser - remove svn ID, remove history, change "ser" => "Kamailio"

Olle E. Johansson authored on 18/01/2015 19:36:18
Showing 1 changed files
... ...
@@ -1,19 +1,14 @@
1 1
 /*
2 2
  * Copyright (C) 2001-2003 FhG Fokus
3 3
  *
4
- * This file is part of ser, a free SIP server.
4
+ * This file is part of Kamailio, a free SIP server.
5 5
  *
6
- * ser is free software; you can redistribute it and/or modify
6
+ * Kamailio is free software; you can redistribute it and/or modify
7 7
  * it under the terms of the GNU General Public License as published by
8 8
  * the Free Software Foundation; either version 2 of the License, or
9 9
  * (at your option) any later version
10 10
  *
11
- * For a license to use the ser software under conditions
12
- * other than those described here, or to purchase support for this
13
- * software, please contact iptel.org by e-mail at the following addresses:
14
- *    info@iptel.org
15
- *
16
- * ser is distributed in the hope that it will be useful,
11
+ * Kamailio is distributed in the hope that it will be useful,
17 12
  * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 13
  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
19 14
  * GNU General Public License for more details.
... ...
@@ -22,15 +17,6 @@
22 17
  * along with this program; if not, write to the Free Software
23 18
  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 19
  *
25
- * History:
26
- * ---------
27
- * 2003-02-28 scratchpad compatibility abandoned (jiri)
28
- * 2003-01-27 next baby-step to removing ZT - PRESERVE_ZT (jiri)
29
- * 2003-05-01 HDR_ACCEPT added (janakj)
30
- * 2005-02-14 hdr_flags_t && hdr_flags_f defined, split HDR_xxx into
31
- *             HDR_xxx_F & HDR_xxx_T [WARNING: don't mix them!] (andrei)
32
- * 2007-01-26 HDR_DATE_T, HDR_IDENTITY_T, HDR_IDENTITY_INFO_T added (gergo)
33
- * 2007-07-27 HDR_RETRY_AFTER_[TF] added (andrei)
34 20
  */
35 21
 
36 22
 /** Parser :: parse headers.
Browse code

all: updated FSF address in GPL text

Anthony Messina authored on 04/07/2014 09:36:37 • Daniel-Constantin Mierla committed on 04/07/2014 09:37:36
Showing 1 changed files
... ...
@@ -20,7 +20,7 @@
20 20
  *
21 21
  * You should have received a copy of the GNU General Public License
22 22
  * along with this program; if not, write to the Free Software
23
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
23
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
24 24
  *
25 25
  * History:
26 26
  * ---------
Browse code

parser: remove old $Id$ docs header from subversion times, not usable anymore

Henning Westerholt authored on 05/07/2012 21:39:51
Showing 1 changed files
... ...
@@ -1,6 +1,4 @@
1 1
 /*
2
- * $Id$
3
- *
4 2
  * Copyright (C) 2001-2003 FhG Fokus
5 3
  *
6 4
  * This file is part of ser, a free SIP server.
Browse code

parser: make get_hdr_field(..) and necessary called functions const-correct

Henning Westerholt authored on 05/07/2012 20:35:22
Showing 1 changed files
... ...
@@ -258,7 +258,7 @@ static inline int hdr_allocs_parse(struct hdr_field* hdr)
258 258
 /** frees a hdr_field structure.
259 259
  * WARNING: it frees only parsed (and not name.s, body.s)
260 260
  */
261
-void clean_hdr_field(struct hdr_field* hf);
261
+void clean_hdr_field(struct hdr_field* const hf);
262 262
 
263 263
 
264 264
 /** frees a hdr_field list.
... ...
@@ -267,7 +267,7 @@ void clean_hdr_field(struct hdr_field* hf);
267 267
 void free_hdr_field_lst(struct hdr_field* hf);
268 268
 
269 269
 /* print content of hdr_field */
270
-void dump_hdr_field( struct hdr_field* hf );
270
+void dump_hdr_field( struct hdr_field const* const hf);
271 271
 
272 272
 /**
273 273
  * free hdr parsed structure using inner free function
Browse code

parser: removed accept_disposition hdr hook from sip_msg_t

- it was not used at all, just hooked and cloned for no good reason

Daniel-Constantin Mierla authored on 18/04/2012 12:03:10
Showing 1 changed files
... ...
@@ -95,7 +95,6 @@ enum _hdr_types_t {
95 95
 	HDR_SUBJECT_T				       /*!< Subject header field */,
96 96
 	HDR_USERAGENT_T				       /*!< User-Agent header field */,
97 97
 	HDR_SERVER_T				       /*!< Server header field */,
98
-	HDR_ACCEPTDISPOSITION_T		       /*!< Accept-Disposition hdr field */,
99 98
 	HDR_CONTENTDISPOSITION_T	       /*!< Content-Disposition hdr field */,
100 99
 	HDR_DIVERSION_T				       /*!< Diversion header field */,
101 100
 	HDR_RPID_T					       /*!< Remote-Party-ID header field */,
... ...
@@ -168,7 +167,6 @@ typedef unsigned long long hdr_flags_t;
168 167
 #define HDR_SUBJECT_F				HDR_F_DEF(SUBJECT)
169 168
 #define HDR_USERAGENT_F				HDR_F_DEF(USERAGENT)
170 169
 #define HDR_SERVER_F				HDR_F_DEF(SERVER)
171
-#define HDR_ACCEPTDISPOSITION_F		HDR_F_DEF(ACCEPTDISPOSITION)
172 170
 #define HDR_CONTENTDISPOSITION_F	HDR_F_DEF(CONTENTDISPOSITION)
173 171
 #define HDR_DIVERSION_F				HDR_F_DEF(DIVERSION)
174 172
 #define HDR_RPID_F					HDR_F_DEF(RPID)
Browse code

core: helper function to free parsed header struct with inner free function

Daniel-Constantin Mierla authored on 28/02/2011 16:17:09
Showing 1 changed files
... ...
@@ -268,6 +268,14 @@ void clean_hdr_field(struct hdr_field* hf);
268 268
  */
269 269
 void free_hdr_field_lst(struct hdr_field* hf);
270 270
 
271
+/* print content of hdr_field */
271 272
 void dump_hdr_field( struct hdr_field* hf );
272 273
 
274
+/**
275
+ * free hdr parsed structure using inner free function
276
+ * - hdr parsed struct must have as first file a free function,
277
+ *   so it can be caseted to hf_parsed_t
278
+ */
279
+void hdr_free_parsed(void **h_parsed);
280
+
273 281
 #endif /* HF_H */
Browse code

core: order the list of headers that allocate pkg

- easier to spot the missing ones

Daniel-Constantin Mierla authored on 28/02/2011 15:18:24
Showing 1 changed files
... ...
@@ -225,32 +225,32 @@ typedef struct hdr_parsed {
225 225
 static inline int hdr_allocs_parse(struct hdr_field* hdr)
226 226
 {
227 227
 	switch(hdr->type){
228
-		case HDR_VIA_T:
229
-		case HDR_TO_T:
230
-		case HDR_FROM_T:
231
-		case HDR_CSEQ_T:
232
-		case HDR_CONTACT_T:
233
-		case HDR_ROUTE_T:
234
-		case HDR_RECORDROUTE_T:
235
-		case HDR_AUTHORIZATION_T:
236
-		case HDR_EXPIRES_T:
237
-		case HDR_PROXYAUTH_T:
238
-		case HDR_ALLOW_T:
239
-		case HDR_EVENT_T:
240 228
 		case HDR_ACCEPT_T:
229
+		case HDR_ALLOW_T:
230
+		case HDR_AUTHORIZATION_T:
231
+		case HDR_CONTACT_T:
241 232
 		case HDR_CONTENTDISPOSITION_T:
242
-		case HDR_DIVERSION_T:
233
+		case HDR_CSEQ_T:
243 234
 		case HDR_DATE_T:
244
-		case HDR_RPID_T:
235
+		case HDR_DIVERSION_T:
236
+		case HDR_EVENT_T:
237
+		case HDR_EXPIRES_T:
238
+		case HDR_FROM_T:
239
+		case HDR_IDENTITY_INFO_T:
240
+		case HDR_IDENTITY_T:
241
+		case HDR_PAI_T:
242
+		case HDR_PPI_T:
243
+		case HDR_PROXYAUTH_T:
244
+		case HDR_RECORDROUTE_T:
245 245
 		case HDR_REFER_TO_T:
246
+		case HDR_ROUTE_T:
247
+		case HDR_RPID_T:
248
+		case HDR_SESSIONEXPIRES_T:
246 249
 		case HDR_SIPIFMATCH_T:
247 250
 		case HDR_SUBSCRIPTION_STATE_T:
248
-		case HDR_IDENTITY_INFO_T:
249
-		case HDR_IDENTITY_T:
250 251
 		case HDR_SUPPORTED_T:
251
-		case HDR_SESSIONEXPIRES_T:
252
-		case HDR_PPI_T:
253
-		case HDR_PAI_T:
252
+		case HDR_TO_T:
253
+		case HDR_VIA_T:
254 254
 			return 1;
255 255
 		default:
256 256
 			return 0;
Browse code

core: update the list of header that alloc pkg for parsed structure

Daniel-Constantin Mierla authored on 28/02/2011 13:27:25
Showing 1 changed files
... ...
@@ -228,19 +228,29 @@ static inline int hdr_allocs_parse(struct hdr_field* hdr)
228 228
 		case HDR_VIA_T:
229 229
 		case HDR_TO_T:
230 230
 		case HDR_FROM_T:
231
+		case HDR_CSEQ_T:
231 232
 		case HDR_CONTACT_T:
232 233
 		case HDR_ROUTE_T:
233 234
 		case HDR_RECORDROUTE_T:
234 235
 		case HDR_AUTHORIZATION_T:
235 236
 		case HDR_EXPIRES_T:
236 237
 		case HDR_PROXYAUTH_T:
238
+		case HDR_ALLOW_T:
237 239
 		case HDR_EVENT_T:
238 240
 		case HDR_ACCEPT_T:
239 241
 		case HDR_CONTENTDISPOSITION_T:
240 242
 		case HDR_DIVERSION_T:
243
+		case HDR_DATE_T:
241 244
 		case HDR_RPID_T:
242 245
 		case HDR_REFER_TO_T:
246
+		case HDR_SIPIFMATCH_T:
243 247
 		case HDR_SUBSCRIPTION_STATE_T:
248
+		case HDR_IDENTITY_INFO_T:
249
+		case HDR_IDENTITY_T:
250
+		case HDR_SUPPORTED_T:
251
+		case HDR_SESSIONEXPIRES_T:
252
+		case HDR_PPI_T:
253
+		case HDR_PAI_T:
244 254
 			return 1;
245 255
 		default:
246 256
 			return 0;
Browse code

core: framework for generic free of parsed headers

- the structure of parsed headers can define as first field a function
to free the content
- this allow to implement the parser for headers our of the core

Daniel-Constantin Mierla authored on 27/02/2011 15:40:37
Showing 1 changed files
... ...
@@ -213,6 +213,13 @@ typedef struct hdr_field {
213 213
 } hdr_field_t;
214 214
 
215 215
 
216
+/* type of the function to free the structure of parsed header field */
217
+typedef void (*hf_parsed_free_f)(void *parsed);
218
+
219
+/* structure to hold the function to free the parsed header field */
220
+typedef struct hdr_parsed {
221
+	hf_parsed_free_f hfree;
222
+} hf_parsed_t;
216 223
 
217 224
 /** returns true if the header links allocated memory on parse field. */
218 225
 static inline int hdr_allocs_parse(struct hdr_field* hdr)
Browse code

core: support for parsing the Reason header

Andrei Pelinescu-Onciul authored on 18/02/2010 20:20:07
Showing 1 changed files
... ...
@@ -35,10 +35,10 @@
35 35
  * 2007-07-27 HDR_RETRY_AFTER_[TF] added (andrei)
36 36
  */
37 37
 
38
-/*! \file 
39
- * \brief Parser :: ???
38
+/** Parser :: parse headers.
39
+ * @file 
40 40
  *
41
- * \ingroup parser
41
+ * @ingroup parser
42 42
  */
43 43
 
44 44
 
... ...
@@ -51,9 +51,9 @@
51 51
 
52 52
 
53 53
 
54
-/*! \brief header type enum
54
+/** header types enum.
55 55
  * 
56
- * \note
56
+ * @note
57 57
  * if you add a new type:
58 58
  *  - make sure it's not greater than 63
59 59
  *  - make sure you add the corresponding flag to the hdr_flags_t defs below
... ...
@@ -116,25 +116,26 @@ enum _hdr_types_t {
116 116
 	HDR_IDENTITY_T			       /*!< Identity header field */,
117 117
 	HDR_IDENTITY_INFO_T		       /*!< Identity-info header field */,
118 118
 	HDR_RETRY_AFTER_T		           /*!< Retry-After header field */,
119
-	HDR_PPI_T                          /*!< P-Preferred-Identity header field */,
120
-	HDR_PAI_T                          /*!< P-Asserted-Identity header field */,
119
+	HDR_PPI_T                          /*!< P-Preferred-Identity header field*/,
120
+	HDR_PAI_T                          /*!< P-Asserted-Identity header field*/,
121 121
 	HDR_PATH_T                         /*!< Path header field */,
122 122
 	HDR_PRIVACY_T				       /*!< Privacy header field */,
123
+	HDR_REASON_T				       /**< Reason header field */,
123 124
 	HDR_EOH_T					       /*!< End of message header */
124 125
 };
125 126
 
126 127
 
127 128
 typedef unsigned long long hdr_flags_t;
128 129
 
129
-/*! \brief type to flag conversion
130
+/** type to flag conversion.
130 131
  * WARNING: HDR_ERROR_T has no corresponding FLAG ! */
131 132
 #define HDR_T2F(type)	\
132 133
 		(((type)!=HDR_EOH_T)?((hdr_flags_t)1<<(type)):(~(hdr_flags_t)0))
133 134
 
134
-/*! \brief helper macro for easy defining and keeping in sync. the flags enum */
135
+/** helper macro for easy defining and keeping in sync the flags enum. */
135 136
 #define HDR_F_DEF(name)		HDR_T2F(HDR_##name##_T)
136 137
 
137
-/*! \name flags definitions
138
+/** @name flags definitions.
138 139
  * (enum won't work with all the compiler (e.g. icc) due to the 64bit size) */
139 140
 /*!{ */
140 141
 #define HDR_EOH_F					HDR_F_DEF(EOH)
... ...
@@ -192,6 +193,7 @@ typedef unsigned long long hdr_flags_t;
192 193
 #define HDR_PAI_F                   HDR_F_DEF(PAI)
193 194
 #define HDR_PATH_F                  HDR_F_DEF(PATH)
194 195
 #define HDR_PRIVACY_F               HDR_F_DEF(PRIVACY)
196
+#define HDR_REASON_F				HDR_F_DEF(REASON)
195 197
 
196 198
 #define HDR_OTHER_F					HDR_F_DEF(OTHER)
197 199
 
... ...
@@ -199,8 +201,7 @@ typedef unsigned long long hdr_flags_t;
199 201
 
200 202
 typedef enum _hdr_types_t hdr_types_t;
201 203
 
202
-/*! \brief
203
- * Format: name':' body
204
+/** Format: name':' body.
204 205
  */
205 206
 typedef struct hdr_field {
206 207
 	hdr_types_t type;       /*!< Header field type */
... ...
@@ -213,7 +214,7 @@ typedef struct hdr_field {
213 214
 
214 215
 
215 216
 
216
-/*! \brief returns true if the header links allocated memory on parse field */
217
+/** returns true if the header links allocated memory on parse field. */
217 218
 static inline int hdr_allocs_parse(struct hdr_field* hdr)
218 219
 {
219 220
 	switch(hdr->type){
... ...
@@ -239,13 +240,13 @@ static inline int hdr_allocs_parse(struct hdr_field* hdr)
239 240
 	}
240 241
 }
241 242
 
242
-/*! \brief frees a hdr_field structure,
243
+/** frees a hdr_field structure.
243 244
  * WARNING: it frees only parsed (and not name.s, body.s)
244 245
  */
245 246
 void clean_hdr_field(struct hdr_field* hf);
246 247
 
247 248
 
248
-/*! \brief frees a hdr_field list,
249
+/** frees a hdr_field list.
249 250
  * WARNING: frees only ->parsed and ->next
250 251
  */
251 252
 void free_hdr_field_lst(struct hdr_field* hf);
Browse code

Doxygen for the parser directory

There's still a lot of files untouched. Feel free to jump in and help!

oej authored on 25/10/2009 15:58:41
Showing 1 changed files
... ...
@@ -35,6 +35,13 @@
35 35
  * 2007-07-27 HDR_RETRY_AFTER_[TF] added (andrei)
36 36
  */
37 37
 
38
+/*! \file 
39
+ * \brief Parser :: ???
40
+ *
41
+ * \ingroup parser
42
+ */
43
+
44
+
38 45
 
39 46
 #ifndef HF_H
40 47
 #define HF_H
... ...
@@ -44,7 +51,9 @@
44 51
 
45 52
 
46 53
 
47
-/* header type enum
54
+/*! \brief header type enum
55
+ * 
56
+ * \note
48 57
  * if you add a new type:
49 58
  *  - make sure it's not greater than 63
50 59
  *  - make sure you add the corresponding flag to the hdr_flags_t defs below
... ...
@@ -55,78 +64,79 @@
55 64
  */
56 65
 
57 66
 enum _hdr_types_t {
58
-	HDR_ERROR_T					= -1   /* Error while parsing */,
59
-	HDR_OTHER_T					=  0   /* Some other header field */,
60
-	HDR_VIA_T					=  1   /* Via header field */,
61
-	HDR_VIA1_T					=  1   /* First Via header field */,
62
-	HDR_VIA2_T					=  2   /* only used as flag */,
63
-	HDR_TO_T					       /* To header field */,
64
-	HDR_FROM_T					       /* From header field */,
65
-	HDR_CSEQ_T					       /* CSeq header field */,
66
-	HDR_CALLID_T				       /* Call-Id header field */,
67
-	HDR_CONTACT_T				       /* Contact header field */,
68
-	HDR_MAXFORWARDS_T			       /* MaxForwards header field */,
69
-	HDR_ROUTE_T					       /* Route header field */,
70
-	HDR_RECORDROUTE_T			       /* Record-Route header field */,
71
-	HDR_CONTENTTYPE_T			       /* Content-Type header field */,
72
-	HDR_CONTENTLENGTH_T			       /* Content-Length header field */,
73
-	HDR_AUTHORIZATION_T			       /* Authorization header field */,
74
-	HDR_EXPIRES_T				       /* Expires header field */,
75
-	HDR_PROXYAUTH_T				       /* Proxy-Authorization hdr field */,
76
-	HDR_SUPPORTED_T				       /* Supported  header field */,
77
-	HDR_REQUIRE_T				       /* Require header */,
78
-	HDR_PROXYREQUIRE_T			       /* Proxy-Require header field */,
79
-	HDR_UNSUPPORTED_T			       /* Unsupported header field */,
80
-	HDR_ALLOW_T					       /* Allow header field */,
81
-	HDR_EVENT_T					       /* Event header field */,
82
-	HDR_ACCEPT_T				       /* Accept header field */,
83
-	HDR_ACCEPTLANGUAGE_T		       /* Accept-Language header field */,
84
-	HDR_ORGANIZATION_T			       /* Organization header field */,
85
-	HDR_PRIORITY_T				       /* Priority header field */,
86
-	HDR_SUBJECT_T				       /* Subject header field */,
87
-	HDR_USERAGENT_T				       /* User-Agent header field */,
88
-	HDR_SERVER_T				       /* Server header field */,
89
-	HDR_ACCEPTDISPOSITION_T		       /* Accept-Disposition hdr field */,
90
-	HDR_CONTENTDISPOSITION_T	       /* Content-Disposition hdr field */,
91
-	HDR_DIVERSION_T				       /* Diversion header field */,
92
-	HDR_RPID_T					       /* Remote-Party-ID header field */,
93
-	HDR_REFER_TO_T				       /* Refer-To header fiels */,
94
-	HDR_SIPIFMATCH_T			       /* SIP-If-Match header field */,
95
-	HDR_SESSIONEXPIRES_T		       /* Session-Expires header */,
96
-	HDR_MIN_SE_T				       /* Min-SE */,
97
-	HDR_SUBSCRIPTION_STATE_T	       /* Subscription-State */,
98
-	HDR_ACCEPTCONTACT_T			       /* Accept-Contact header */,
99
-	HDR_ALLOWEVENTS_T			       /* Allow-Events header */,
100
-	HDR_CONTENTENCODING_T		       /* Content-Encoding header */,
101
-	HDR_REFERREDBY_T			       /* Referred-By header */,
102
-	HDR_REJECTCONTACT_T			       /* Reject-Contact header */,
103
-	HDR_REQUESTDISPOSITION_T	       /* Request-Disposition header */,
104
-	HDR_WWW_AUTHENTICATE_T		       /* WWW-Authenticate header field */,
105
-	HDR_PROXY_AUTHENTICATE_T	       /* Proxy-Authenticate header field */,
106
-	HDR_DATE_T			       /* Date header field */,
107
-	HDR_IDENTITY_T			       /* Identity header field */,
108
-	HDR_IDENTITY_INFO_T		       /* Identity-info header field */,
109
-	HDR_RETRY_AFTER_T		           /* Retry-After header field */,
110
-	HDR_PPI_T                          /**< P-Preferred-Identity header field */,
111
-	HDR_PAI_T                          /**< P-Asserted-Identity header field */,
112
-	HDR_PATH_T                         /**< Path header field */,
113
-	HDR_PRIVACY_T				       /**< Privacy header field */,
114
-	HDR_EOH_T					       /* End of message header */
67
+	HDR_ERROR_T					= -1   /*!< Error while parsing */,
68
+	HDR_OTHER_T					=  0   /*!< Some other header field */,
69
+	HDR_VIA_T					=  1   /*!< Via header field */,
70
+	HDR_VIA1_T					=  1   /*!< First Via header field */,
71
+	HDR_VIA2_T					=  2   /*!< only used as flag */,
72
+	HDR_TO_T					       /*!< To header field */,
73
+	HDR_FROM_T					       /*!< From header field */,
74
+	HDR_CSEQ_T					       /*!< CSeq header field */,
75
+	HDR_CALLID_T				       /*!< Call-Id header field */,
76
+	HDR_CONTACT_T				       /*!< Contact header field */,
77
+	HDR_MAXFORWARDS_T			       /*!< MaxForwards header field */,
78
+	HDR_ROUTE_T					       /*!< Route header field */,
79
+	HDR_RECORDROUTE_T			       /*!< Record-Route header field */,
80
+	HDR_CONTENTTYPE_T			       /*!< Content-Type header field */,
81
+	HDR_CONTENTLENGTH_T			       /*!< Content-Length header field */,
82
+	HDR_AUTHORIZATION_T			       /*!< Authorization header field */,
83
+	HDR_EXPIRES_T				       /*!< Expires header field */,
84
+	HDR_PROXYAUTH_T				       /*!< Proxy-Authorization hdr field */,
85
+	HDR_SUPPORTED_T				       /*!< Supported  header field */,
86
+	HDR_REQUIRE_T				       /*!< Require header */,
87
+	HDR_PROXYREQUIRE_T			       /*!< Proxy-Require header field */,
88
+	HDR_UNSUPPORTED_T			       /*!< Unsupported header field */,
89
+	HDR_ALLOW_T					       /*!< Allow header field */,
90
+	HDR_EVENT_T					       /*!< Event header field */,
91
+	HDR_ACCEPT_T				       /*!< Accept header field */,
92
+	HDR_ACCEPTLANGUAGE_T		       /*!< Accept-Language header field */,
93
+	HDR_ORGANIZATION_T			       /*!< Organization header field */,
94
+	HDR_PRIORITY_T				       /*!< Priority header field */,
95
+	HDR_SUBJECT_T				       /*!< Subject header field */,
96
+	HDR_USERAGENT_T				       /*!< User-Agent header field */,
97
+	HDR_SERVER_T				       /*!< Server header field */,
98
+	HDR_ACCEPTDISPOSITION_T		       /*!< Accept-Disposition hdr field */,
99
+	HDR_CONTENTDISPOSITION_T	       /*!< Content-Disposition hdr field */,
100
+	HDR_DIVERSION_T				       /*!< Diversion header field */,
101
+	HDR_RPID_T					       /*!< Remote-Party-ID header field */,
102
+	HDR_REFER_TO_T				       /*!< Refer-To header fiels */,
103
+	HDR_SIPIFMATCH_T			       /*!< SIP-If-Match header field */,
104
+	HDR_SESSIONEXPIRES_T		       /*!< Session-Expires header */,
105
+	HDR_MIN_SE_T				       /*!< Min-SE */,
106
+	HDR_SUBSCRIPTION_STATE_T	       /*!< Subscription-State */,
107
+	HDR_ACCEPTCONTACT_T			       /*!< Accept-Contact header */,
108
+	HDR_ALLOWEVENTS_T			       /*!< Allow-Events header */,
109
+	HDR_CONTENTENCODING_T		       /*!< Content-Encoding header */,
110
+	HDR_REFERREDBY_T			       /*!< Referred-By header */,
111
+	HDR_REJECTCONTACT_T			       /*!< Reject-Contact header */,
112
+	HDR_REQUESTDISPOSITION_T	       /*!< Request-Disposition header */,
113
+	HDR_WWW_AUTHENTICATE_T		       /*!< WWW-Authenticate header field */,
114
+	HDR_PROXY_AUTHENTICATE_T	       /*!< Proxy-Authenticate header field */,
115
+	HDR_DATE_T			       /*!< Date header field */,
116
+	HDR_IDENTITY_T			       /*!< Identity header field */,
117
+	HDR_IDENTITY_INFO_T		       /*!< Identity-info header field */,
118
+	HDR_RETRY_AFTER_T		           /*!< Retry-After header field */,
119
+	HDR_PPI_T                          /*!< P-Preferred-Identity header field */,
120
+	HDR_PAI_T                          /*!< P-Asserted-Identity header field */,
121
+	HDR_PATH_T                         /*!< Path header field */,
122
+	HDR_PRIVACY_T				       /*!< Privacy header field */,
123
+	HDR_EOH_T					       /*!< End of message header */
115 124
 };
116 125
 
117 126
 
118 127
 typedef unsigned long long hdr_flags_t;
119 128
 
120
-/* type to flag conversion
129
+/*! \brief type to flag conversion
121 130
  * WARNING: HDR_ERROR_T has no corresponding FLAG ! */
122 131
 #define HDR_T2F(type)	\
123 132
 		(((type)!=HDR_EOH_T)?((hdr_flags_t)1<<(type)):(~(hdr_flags_t)0))
124 133
 
125
-/* helper macro for easy defining and keeping in sync. the flags enum */
134
+/*! \brief helper macro for easy defining and keeping in sync. the flags enum */
126 135
 #define HDR_F_DEF(name)		HDR_T2F(HDR_##name##_T)
127 136
 
128
-/* flags definitions
137
+/*! \name flags definitions
129 138
  * (enum won't work with all the compiler (e.g. icc) due to the 64bit size) */
139
+/*!{ */
130 140
 #define HDR_EOH_F					HDR_F_DEF(EOH)
131 141
 #define HDR_VIA_F					HDR_F_DEF(VIA)
132 142
 #define HDR_VIA1_F					HDR_F_DEF(VIA1)
... ...
@@ -185,23 +195,25 @@ typedef unsigned long long hdr_flags_t;
185 195
 
186 196
 #define HDR_OTHER_F					HDR_F_DEF(OTHER)
187 197
 
198
+/*!} */ /* Doxygen end marker*/
199
+
188 200
 typedef enum _hdr_types_t hdr_types_t;
189 201
 
190
-/*
202
+/*! \brief
191 203
  * Format: name':' body
192 204
  */
193 205
 typedef struct hdr_field {
194
-	hdr_types_t type;       /* Header field type */
195
-	str name;               /* Header field name */
196
-	str body;               /* Header field body (may not include CRLF) */
197
-	int len;		/* length from hdr start until EoHF (incl.CRLF) */
198
-	void* parsed;           /* Parsed data structures */
199
-	struct hdr_field* next; /* Next header field in the list */
206
+	hdr_types_t type;       /*!< Header field type */
207
+	str name;               /*!< Header field name */
208
+	str body;               /*!< Header field body (may not include CRLF) */
209
+	int len;		/*!< length from hdr start until EoHF (incl.CRLF) */
210
+	void* parsed;           /*!< Parsed data structures */
211
+	struct hdr_field* next; /*!< Next header field in the list */
200 212
 } hdr_field_t;
201 213
 
202 214
 
203 215
 
204
-/* returns true if the header links allocated memory on parse field */
216
+/*! \brief returns true if the header links allocated memory on parse field */
205 217
 static inline int hdr_allocs_parse(struct hdr_field* hdr)
206 218
 {
207 219
 	switch(hdr->type){
... ...
@@ -227,13 +239,13 @@ static inline int hdr_allocs_parse(struct hdr_field* hdr)
227 239
 	}
228 240
 }
229 241
 
230
-/* frees a hdr_field structure,
242
+/*! \brief frees a hdr_field structure,
231 243
  * WARNING: it frees only parsed (and not name.s, body.s)
232 244
  */
233 245
 void clean_hdr_field(struct hdr_field* hf);
234 246
 
235 247
 
236
-/* frees a hdr_field list,
248
+/*! \brief frees a hdr_field list,
237 249
  * WARNING: frees only ->parsed and ->next
238 250
  */
239 251
 void free_hdr_field_lst(struct hdr_field* hf);
Browse code

Kamailio compatibility: Privacy header field name parser

This patch adds support for the Privacy header field name parser.

Jan Janak authored on 27/03/2009 07:59:37
Showing 1 changed files
... ...
@@ -110,6 +110,7 @@ enum _hdr_types_t {
110 110
 	HDR_PPI_T                          /**< P-Preferred-Identity header field */,
111 111
 	HDR_PAI_T                          /**< P-Asserted-Identity header field */,
112 112
 	HDR_PATH_T                         /**< Path header field */,
113
+	HDR_PRIVACY_T				       /**< Privacy header field */,
113 114
 	HDR_EOH_T					       /* End of message header */
114 115
 };
115 116
 
... ...
@@ -180,6 +181,7 @@ typedef unsigned long long hdr_flags_t;
180 181
 #define HDR_PPI_F                   HDR_F_DEF(PPI)
181 182
 #define HDR_PAI_F                   HDR_F_DEF(PAI)
182 183
 #define HDR_PATH_F                  HDR_F_DEF(PATH)
184
+#define HDR_PRIVACY_F               HDR_F_DEF(PRIVACY)
183 185
 
184 186
 #define HDR_OTHER_F					HDR_F_DEF(OTHER)
185 187
 
Browse code

Teach sip-router how to recognized Path header field name.

Jan Janak authored on 16/03/2009 17:49:27
Showing 1 changed files
... ...
@@ -109,6 +109,7 @@ enum _hdr_types_t {
109 109
 	HDR_RETRY_AFTER_T		           /* Retry-After header field */,
110 110
 	HDR_PPI_T                          /**< P-Preferred-Identity header field */,
111 111
 	HDR_PAI_T                          /**< P-Asserted-Identity header field */,
112
+	HDR_PATH_T                         /**< Path header field */,
112 113
 	HDR_EOH_T					       /* End of message header */
113 114
 };
114 115
 
... ...
@@ -178,6 +179,7 @@ typedef unsigned long long hdr_flags_t;
178 179
 #define HDR_RETRY_AFTER_F			HDR_F_DEF(RETRY_AFTER)
179 180
 #define HDR_PPI_F                   HDR_F_DEF(PPI)
180 181
 #define HDR_PAI_F                   HDR_F_DEF(PAI)
182
+#define HDR_PATH_F                  HDR_F_DEF(PATH)
181 183
 
182 184
 #define HDR_OTHER_F					HDR_F_DEF(OTHER)
183 185
 
Browse code

Support for P-Preferred-Identity and P-Asserted-Identity in the core.

This patch adds variables that are needed by the P-Preferred-Identity
and P-Asserted-Identity parsers in the libkcore library.

Jan Janak authored on 15/03/2009 16:17:24
Showing 1 changed files
... ...
@@ -107,7 +107,8 @@ enum _hdr_types_t {
107 107
 	HDR_IDENTITY_T			       /* Identity header field */,
108 108
 	HDR_IDENTITY_INFO_T		       /* Identity-info header field */,
109 109
 	HDR_RETRY_AFTER_T		           /* Retry-After header field */,
110
-
110
+	HDR_PPI_T                          /**< P-Preferred-Identity header field */,
111
+	HDR_PAI_T                          /**< P-Asserted-Identity header field */,
111 112
 	HDR_EOH_T					       /* End of message header */
112 113
 };
113 114
 
... ...
@@ -175,6 +176,8 @@ typedef unsigned long long hdr_flags_t;
175 176
 #define HDR_IDENTITY_F			HDR_F_DEF(IDENTITY)
176 177
 #define HDR_IDENTITY_INFO_F		HDR_F_DEF(IDENTITY_INFO)
177 178
 #define HDR_RETRY_AFTER_F			HDR_F_DEF(RETRY_AFTER)
179
+#define HDR_PPI_F                   HDR_F_DEF(PPI)
180
+#define HDR_PAI_F                   HDR_F_DEF(PAI)
178 181
 
179 182
 #define HDR_OTHER_F					HDR_F_DEF(OTHER)
180 183
 
Browse code

- sip_msg_t and hdr_field_t types defined

Jan Janak authored on 13/08/2007 12:57:40
Showing 1 changed files
... ...
@@ -183,14 +183,14 @@ typedef enum _hdr_types_t hdr_types_t;
183 183
 /*
184 184
  * Format: name':' body
185 185
  */
186
-struct hdr_field {
186
+typedef struct hdr_field {
187 187
 	hdr_types_t type;       /* Header field type */
188 188
 	str name;               /* Header field name */
189 189
 	str body;               /* Header field body (may not include CRLF) */
190 190
 	int len;		/* length from hdr start until EoHF (incl.CRLF) */
191 191
 	void* parsed;           /* Parsed data structures */
192 192
 	struct hdr_field* next; /* Next header field in the list */
193
-};
193
+} hdr_field_t;
194 194
 
195 195
 
196 196
 
Browse code

- added support for parsing the Retry-After header

Andrei Pelinescu-Onciul authored on 30/07/2007 19:49:09
Showing 1 changed files
... ...
@@ -32,6 +32,7 @@
32 32
  * 2005-02-14 hdr_flags_t && hdr_flags_f defined, split HDR_xxx into
33 33
  *             HDR_xxx_F & HDR_xxx_T [WARNING: don't mix them!] (andrei)
34 34
  * 2007-01-26 HDR_DATE_T, HDR_IDENTITY_T, HDR_IDENTITY_INFO_T added (gergo)
35
+ * 2007-07-27 HDR_RETRY_AFTER_[TF] added (andrei)
35 36
  */
36 37
 
37 38
 
... ...
@@ -105,6 +106,7 @@ enum _hdr_types_t {
105 106
 	HDR_DATE_T			       /* Date header field */,
106 107
 	HDR_IDENTITY_T			       /* Identity header field */,
107 108
 	HDR_IDENTITY_INFO_T		       /* Identity-info header field */,
109
+	HDR_RETRY_AFTER_T		           /* Retry-After header field */,
108 110
 
109 111