Coverage Report

Created: 2025-04-11 06:59

/src/opensips/parser/msg_parser.h
Line
Count
Source (jump to first uncovered line)
1
/*
2
 * Copyright (C) 2001-2003 FhG Fokus
3
 *
4
 * This file is part of opensips, a free SIP server.
5
 *
6
 * opensips 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
 * opensips 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
 * History
21
 * -------
22
 *  2003-01-28  removed scratchpad (jiri)
23
 *  2003-02-28  scratchpad compatibility abandoned (jiri)
24
 *  2003-03-06  enum_request_method changed to begin with 1;
25
 *               0 reserved for invalid values; (jiri)
26
 *  2003-03-31  removed sip_msg->repl_add_rm (andrei)
27
 *  2003-04-01  2 macros added: GET_NEXT_HOP and GET_RURI (janakj)
28
 *  2003-04-04  structure for parsed inbound uri added (jiri)
29
 *  2003-04-11  updated the  sip_uri structure (lots of fields added) (andrei)
30
 *  2003-04-12  added msg_flags to sip_msg (andrei)
31
 *  2003-11-02  added diversion header field to sip_msg (jh)
32
 *  2004-11-08  added force_send_socket (andrei)
33
 *  2005-02-25  uri types added (sip, sips & tel)  (andrei)
34
 *  2006-02-17  Session-Expires, Min-SE (dhsueh@somanetworks.com)
35
 *  2007-09-09  added sdp structure (osas)
36
 *  2011-04-20  added support for URI unknown parameters (osas)
37
 */
38
39
40
#ifndef MSG_PARSER_H
41
#define MSG_PARSER_H
42
43
#include <strings.h>
44
#include <sys/time.h>
45
46
#include "../str.h"
47
#include "../lump_struct.h"
48
#include "../flags.h"
49
#include "../ip_addr.h"
50
#include "../md5utils.h"
51
#include "../qvalue.h"
52
#include "../config.h"
53
#include "parse_def.h"
54
#include "parse_cseq.h"
55
#include "parse_content.h"
56
#include "parse_via.h"
57
#include "parse_fline.h"
58
#include "parse_body.h"
59
#include "hf.h"
60
#include "../trim.h"
61
62
63
/* convenience short-cut macros */
64
0
#define REQ_LINE(_msg) ((_msg)->first_line.u.request)
65
0
#define REQ_METHOD   first_line.u.request.method_value
66
#define REQ_METHOD_S first_line.u.request.method
67
0
#define REPLY_STATUS first_line.u.reply.statuscode
68
#define REPLY_CLASS(_reply) ((_reply)->REPLY_STATUS/100)
69
70
/* number methods as power of two to allow bitmap matching */
71
enum request_method {
72
  METHOD_UNDEF=0,           /* 0 - --- */
73
  METHOD_INVITE=1,          /* 1 - 2^0 */
74
  METHOD_CANCEL=2,          /* 2 - 2^1 */
75
  METHOD_ACK=4,             /* 3 - 2^2 */
76
  METHOD_BYE=8,             /* 4 - 2^3 */
77
  METHOD_INFO=16,           /* 5 - 2^4 */
78
  METHOD_OPTIONS=32,        /* 6 - 2^5 */
79
  METHOD_UPDATE=64,         /* 7 - 2^6 */
80
  METHOD_REGISTER=128,      /* 8 - 2^7 */
81
  METHOD_MESSAGE=256,       /* 9 - 2^8 */
82
  METHOD_SUBSCRIBE=512,     /* 10 - 2^9 */
83
  METHOD_NOTIFY=1024,       /* 11 - 2^10 */
84
  METHOD_PRACK=2048,        /* 12 - 2^11 */
85
  METHOD_REFER=4096,        /* 13 - 2^12 */
86
  METHOD_PUBLISH=8192,      /* 14 - 2^13 */
87
  METHOD_OTHER=16384        /* 15 - 2^14 */
88
};
89
90
0
#define FL_FORCE_RPORT       (1<<0)  /* force rport (top via) */
91
0
#define FL_REPLY_TO_VIA      (1<<1)  /* force replying to VIA ip:port */
92
0
#define FL_FORCE_LOCAL_RPORT (1<<2)  /* force local rport (local via) */
93
#define FL_SDP_IP_AFS        (1<<3)  /* SDP IP rewritten */
94
#define FL_SDP_PORT_AFS      (1<<4)  /* SDP port rewritten */
95
#define FL_SHM_CLONE         (1<<5)  /* msg cloned in SHM as a single chunk */
96
#define FL_USE_UAC_FROM      (1<<6)  /* take FROM hdr from UAC insteas of UAS*/
97
#define FL_USE_UAC_TO        (1<<7)  /* take TO hdr from UAC insteas of UAS */
98
#define FL_USE_UAC_CSEQ      (1<<8)  /* take CSEQ hdr from UAC insteas of UAS*/
99
#define FL_REQ_UPSTREAM      (1<<9)  /* it's an upstream going request */
100
#define FL_DO_KEEPALIVE      (1<<10) /* keepalive request's source after a
101
                                      * positive reply */
102
#define FL_USE_MEDIA_PROXY   (1<<11) /* use mediaproxy on all messages during
103
                                      * a dialog */
104
#define FL_USE_RTPPROXY      (1<<12) /* used by rtpproxy to remember if the msg
105
                                      * callback had already been registered */
106
#define FL_NAT_TRACK_DIALOG  (1<<13) /* trigger dialog tracking from the
107
                                      * nat_traversal module */
108
#define FL_USE_SIPTRACE      (1<<14) /* used by tracer to check if the tm
109
                                      * callbacks were registered */
110
#define FL_SHM_UPDATABLE     (1<<15) /* a SHM cloned message can be updated
111
                                      * (TM used, requires FL_SHM_CLONE) */
112
#define FL_SHM_UPDATED       (1<<16) /* an updatable SHM cloned message that 
113
                                      * had at least one update; if the flag is
114
                                      * missing, it means the cloned msg was
115
                                      * never updated.
116
                                      * (TM used, requires FL_SHM_UPDATABLE) */
117
#define FL_TM_CB_REGISTERED  (1<<17) /* tm callbacks for this message have been
118
                                      * registered (by setting this flag, you
119
                                      * will know if any tm callbacks for this
120
                                      * message have been registered) */
121
#define FL_TM_FAKE_REQ       (1<<18) /* the SIP request is a fake one,
122
                                      * generated based on the transaction,
123
                                      * either in failure route or resume 
124
                                      * route */
125
#define FL_TM_REPLICATED   (1<<19) /* message received due to a tm replication */
126
#define FL_BODY_NO_SDP       (1<<20) /* message does not have an SDP body */
127
#define FL_IS_LOCAL          (1<<21) /* the message is a locally generated
128
                                      * one, not received */
129
0
#define FL_HAS_ROUTE_LUMP    (1<<22) /* the message had Route headers added
130
                                      * as lumps */
131
#define FL_USE_SIPTRACE_B2B  (1<<23) /* used by tracer to check if the b2b
132
                                      * tracing was enabled */
133
#define FL_ACK_WITH_BODY     (1<<24) /* ACK message has SDP body */
134
135
/* define the # of unknown URI parameters to parse */
136
247k
#define URI_MAX_U_PARAMS 10
137
138
0
#define IFISMETHOD(methodname,firstchar)                                  \
139
0
if (  (*tmp==(firstchar) || *tmp==((firstchar) | 32)) &&                  \
140
0
        strncasecmp( tmp+1, (char *)#methodname+1, methodname##_LEN-1)==0 &&     \
141
0
        *(tmp+methodname##_LEN)==' ') {                                   \
142
0
                fl->type=SIP_REQUEST;                                     \
143
0
                fl->u.request.method.len=methodname##_LEN;                \
144
0
                fl->u.request.method_value=METHOD_##methodname;           \
145
0
                tmp=buffer+methodname##_LEN;                              \
146
0
}
147
148
149
/*
150
 * Return a URI to which the message should be really sent (not what should
151
 * be in the Request URI. The following fields are tried in this order:
152
 * 1) dst_uri
153
 * 2) new_uri
154
 * 3) first_line.u.request.uri
155
 */
156
#define GET_NEXT_HOP(m) \
157
(((m)->dst_uri.s && (m)->dst_uri.len) ? (&(m)->dst_uri) : \
158
(((m)->new_uri.s && (m)->new_uri.len) ? (&(m)->new_uri) : (&(m)->first_line.u.request.uri)))
159
160
161
/*
162
 * Return the Reqeust URI of a message.
163
 * The following fields are tried in this order:
164
 * 1) new_uri
165
 * 2) first_line.u.request.uri
166
 */
167
0
#define GET_RURI(m) \
168
0
(((m)->new_uri.s && (m)->new_uri.len) ? (&(m)->new_uri) : (&(m)->first_line.u.request.uri))
169
170
171
enum _uri_type{ERROR_URI_T=0, SIP_URI_T, SIPS_URI_T, TEL_URI_T, TELS_URI_T, URN_SERVICE_URI_T, URN_NENA_SERVICE_URI_T};
172
typedef enum _uri_type uri_type;
173
174
struct sip_uri {
175
  str user;     /* Username */
176
  str passwd;   /* Password */
177
  str host;     /* Host name */
178
  str port;     /* Port number */
179
  str params;   /* Parameters */
180
  str headers;
181
  unsigned short port_no;
182
  unsigned short proto; /* from transport */
183
  uri_type type; /* uri scheme */
184
185
  /* parameters [+ "=value" parts, if any] */
186
  str transport;
187
  str ttl;
188
  str user_param;
189
  str maddr;
190
  str method;
191
  str lr;
192
  str r2; /* ser specific rr parameter */
193
  str gr; /* GRUU */
194
  str pn_provider; /* RFC 8599 (SIP PN) */
195
  str pn_prid;
196
  str pn_param;
197
  str pn_purr;
198
199
  /* just values */
200
  str transport_val;
201
  str ttl_val;
202
  str user_param_val;
203
  str maddr_val;
204
  str method_val;
205
  str lr_val; /* lr value placeholder for lr=on a.s.o*/
206
  str r2_val;
207
  str gr_val;
208
  str pn_provider_val;
209
  str pn_prid_val;
210
  str pn_param_val;
211
  str pn_purr_val;
212
  /* XXX - in the future when adding params as special links
213
   * in the list above, make sure to also update compare_uris() function
214
   * to explicitly compare these here */
215
216
  /* unknown params */
217
  str u_name[URI_MAX_U_PARAMS]; /* Unknown param names */
218
  str u_val[URI_MAX_U_PARAMS];  /* Unknown param valss */
219
  unsigned short u_params_no;   /* No of unknown params */
220
};
221
222
223
#include "parse_to.h"
224
225
/* Forward declaration */
226
struct msg_callback;
227
228
struct sip_msg {
229
  unsigned int id;               /* message id, unique/process*/
230
  struct msg_start first_line;   /* Message first line */
231
  struct via_body* via1;         /* The first via */
232
  struct via_body* via2;         /* The second via */
233
  struct hdr_field* headers;     /* All the parsed headers*/
234
  struct hdr_field* last_header; /* Pointer to the last parsed header*/
235
  hdr_flags_t parsed_flag;       /* Already parsed header field types */
236
237
  /* Via, To, CSeq, Call-Id, From, end of header*/
238
  /* pointers to the first occurrences of these headers;
239
   * everything is also saved in 'headers'
240
   * (WARNING: do not deallocate them twice!)*/
241
242
  struct hdr_field* h_via1;
243
  struct hdr_field* callid;
244
  struct hdr_field* to;
245
  struct hdr_field* cseq;
246
  struct hdr_field* from;
247
  struct hdr_field* contact;
248
  struct hdr_field* maxforwards;
249
  struct hdr_field* route;
250
  struct hdr_field* record_route;
251
  struct hdr_field* path;
252
  struct hdr_field* content_type;
253
  struct hdr_field* content_length;
254
  struct hdr_field* authorization;
255
  struct hdr_field* expires;
256
  struct hdr_field* proxy_auth;
257
  struct hdr_field* supported;
258
  struct hdr_field* proxy_require;
259
  struct hdr_field* unsupported;
260
  struct hdr_field* allow;
261
  struct hdr_field* event;
262
  struct hdr_field* accept;
263
  struct hdr_field* accept_language;
264
  struct hdr_field* organization;
265
  struct hdr_field* priority;
266
  struct hdr_field* subject;
267
  struct hdr_field* user_agent;
268
  struct hdr_field* content_disposition;
269
  struct hdr_field* accept_disposition;
270
  struct hdr_field* diversion;
271
  struct hdr_field* rpid;
272
  struct hdr_field* refer_to;
273
  struct hdr_field* session_expires;
274
  struct hdr_field* min_se;
275
  struct hdr_field* ppi;
276
  struct hdr_field* pai;
277
  struct hdr_field* privacy;
278
  struct hdr_field* call_info;
279
  struct hdr_field* www_authenticate;
280
  struct hdr_field* proxy_authenticate;
281
  struct hdr_field* min_expires;
282
  struct hdr_field* feature_caps;
283
  struct hdr_field* replaces;
284
  struct hdr_field* security_client;
285
  struct hdr_field* security_server;
286
  struct hdr_field* security_verify;
287
288
  struct sip_msg_body *body;
289
290
  char* eoh;        /* pointer to the end of header (if found) or null */
291
  char* unparsed;   /* here we stopped parsing*/
292
293
  struct receive_info rcv; /* source & dest ip, ports, proto a.s.o*/
294
295
  char* buf;        /* scratch pad, holds a unmodified message,
296
                           *  via, etc. point into it */
297
  unsigned int len; /* message len (orig) */
298
299
  /* attributes of the msg as first/default branch */
300
  str new_uri; /* changed first line uri, when you change this
301
                  * don't forget to set parsed_uri_ok to 0 */
302
  str dst_uri; /* Destination URI, must be forwarded to this URI if len!=0 */
303
304
  qvalue_t ruri_q; /* Q value of RURI */
305
306
  unsigned int ruri_bflags; /* per-branch flags for RURI*/
307
308
  /* force sending on this socket */
309
  const struct socket_info* force_send_socket;
310
311
  /* path vector to generate Route hdrs */
312
  str path_vec;
313
  /* end-of-attributes for RURI as first branch*/
314
315
  /* current uri */
316
  int parsed_uri_ok; /* 1 if parsed_uri is valid, 0 if not, set it to 0
317
                        if you modify the uri (e.g change new_uri)*/
318
  struct sip_uri parsed_uri; /* speed-up > keep here the parsed uri*/
319
320
  /* the same for original uri */
321
  int parsed_orig_ruri_ok;
322
  struct sip_uri parsed_orig_ruri;
323
324
  /* modifications */
325
  struct lump* add_rm;       /* used for all the forwarded requests/replies */
326
  struct lump* body_lumps;     /* Lumps that update Content-Length */
327
  struct lump_rpl *reply_lump; /* only for localy generated replies !!!*/
328
329
  /* whatever whoever want to append to branch comes here */
330
  char add_to_branch_s[MAX_BRANCH_PARAM_LEN];
331
  int add_to_branch_len;
332
333
  /* index to TM hash table; stored in core to avoid
334
   * unnecessary calculations */
335
  unsigned int  hash_index;
336
337
  /* flags used from script */
338
  flag_t flags;
339
340
  /* flags used by core - allows to set various flags on the message; may
341
   * be used for simple inter-module communication or remembering
342
   * processing state reached */
343
  unsigned int msg_flags;
344
345
  str set_global_address;
346
  str set_global_port;
347
348
  /* used to store a particular time of the message - note that the time is
349
   * not stored when the message was received, but only the first time
350
   * someone gets interested in it - this way we have a consistent timestamp
351
   * of the message, without being affected by lazy callbacks */
352
  struct timeval time;
353
354
  struct msg_callback *msg_cb;
355
};
356
357
358
/* pointer to a fakes message which was never received ;
359
   (when this message is "relayed", it is generated out
360
    of the original request)
361
*/
362
0
#define FAKED_REPLY     ((struct sip_msg *) -1)
363
364
extern int via_cnt;
365
366
#define parse_msg( _buf, _len, _msg) \
367
0
  parse_msg_opt( _buf, _len, _msg, 1)
368
369
int parse_msg_opt(char* buf, unsigned int len, struct sip_msg* msg,
370
    int free_on_err);
371
372
0
#define parse_headers(msg, flags,next)  parse_headers_aux(msg,flags,next, 1)
373
374
int parse_headers_aux(struct sip_msg* msg, hdr_flags_t flags, int next, int sip_well_known_parse);
375
376
0
#define get_hdr_field(buf,end,hdr)  get_hdr_field_aux(buf,end,hdr,1)
377
378
char* get_hdr_field_aux(char* buf, char* end, struct hdr_field* hdr, int sip_well_known_parse);
379
380
/* add DEL lumps for all headers matching the given @hdr */
381
int delete_headers(struct sip_msg *msg, struct hdr_field *hdr);
382
383
void free_sip_msg(struct sip_msg* msg);
384
385
int clone_headers(struct sip_msg *from_msg, struct sip_msg *to_msg);
386
387
/* make sure all HFs needed for transaction identification have been
388
   parsed; return 0 if those HFs can't be found
389
 */
390
391
int check_transaction_quadruple( struct sip_msg* msg );
392
393
/* calculate characteristic value of a message -- this value
394
   is used to identify a transaction during the process of
395
   reply matching
396
 */
397
inline static int char_msg_val( struct sip_msg *msg, char *cv )
398
0
{
399
0
  str src[8];
400
0
401
0
  if (!check_transaction_quadruple(msg)) {
402
0
    LM_ERR("can't calculate char_value due to a parsing error\n");
403
0
    memset( cv, '0', MD5_LEN );
404
0
    return 0;
405
0
  }
406
0
407
0
  src[0]= msg->from->body;
408
0
  src[1]= msg->to->body;
409
0
  src[2]= msg->callid->body;
410
0
  src[3]= msg->first_line.u.request.uri;
411
0
  src[4]= get_cseq( msg )->number;
412
0
413
0
  /* topmost Via is part of transaction key as well ! */
414
0
  src[5]= msg->via1->host;
415
0
  src[6]= msg->via1->port_str;
416
0
  if (msg->via1->branch) {
417
0
    src[7]= msg->via1->branch->value;
418
0
    MD5StringArray ( cv, src, 8 );
419
0
  } else {
420
0
    MD5StringArray( cv, src, 7 );
421
0
  }
422
0
  return 1;
423
0
}
Unexecuted instantiation: fuzz_uri_parser.c:char_msg_val
Unexecuted instantiation: parse_uri.c:char_msg_val
Unexecuted instantiation: error.c:char_msg_val
Unexecuted instantiation: dprint.c:char_msg_val
Unexecuted instantiation: pt.c:char_msg_val
Unexecuted instantiation: strcommon.c:char_msg_val
Unexecuted instantiation: ut.c:char_msg_val
Unexecuted instantiation: statistics.c:char_msg_val
Unexecuted instantiation: route.c:char_msg_val
Unexecuted instantiation: ipc.c:char_msg_val
Unexecuted instantiation: core_stats.c:char_msg_val
Unexecuted instantiation: route_struct.c:char_msg_val
Unexecuted instantiation: dset.c:char_msg_val
Unexecuted instantiation: pt_load.c:char_msg_val
Unexecuted instantiation: sr_module.c:char_msg_val
Unexecuted instantiation: action.c:char_msg_val
Unexecuted instantiation: db_insertq.c:char_msg_val
Unexecuted instantiation: db.c:char_msg_val
Unexecuted instantiation: proto_tcp.c:char_msg_val
Unexecuted instantiation: proto_udp.c:char_msg_val
Unexecuted instantiation: net_tcp_proc.c:char_msg_val
Unexecuted instantiation: net_tcp.c:char_msg_val
Unexecuted instantiation: tcp_common.c:char_msg_val
Unexecuted instantiation: net_udp.c:char_msg_val
Unexecuted instantiation: tcp_conn_profile.c:char_msg_val
Unexecuted instantiation: trans_trace.c:char_msg_val
Unexecuted instantiation: net_tcp_report.c:char_msg_val
Unexecuted instantiation: shm_mem.c:char_msg_val
Unexecuted instantiation: mi.c:char_msg_val
Unexecuted instantiation: item.c:char_msg_val
Unexecuted instantiation: msg_parser.c:char_msg_val
Unexecuted instantiation: parse_fline.c:char_msg_val
Unexecuted instantiation: parse_methods.c:char_msg_val
Unexecuted instantiation: parse_hname2.c:char_msg_val
Unexecuted instantiation: parse_content.c:char_msg_val
Unexecuted instantiation: hf.c:char_msg_val
Unexecuted instantiation: parse_to.c:char_msg_val
Unexecuted instantiation: parse_via.c:char_msg_val
Unexecuted instantiation: event_interface.c:char_msg_val
Unexecuted instantiation: receive.c:char_msg_val
Unexecuted instantiation: script_cb.c:char_msg_val
Unexecuted instantiation: ip_addr.c:char_msg_val
Unexecuted instantiation: data_lump_rpl.c:char_msg_val
Unexecuted instantiation: async.c:char_msg_val
Unexecuted instantiation: daemonize.c:char_msg_val
Unexecuted instantiation: timer.c:char_msg_val
Unexecuted instantiation: trace_api.c:char_msg_val
Unexecuted instantiation: mod_fix.c:char_msg_val
Unexecuted instantiation: reactor.c:char_msg_val
Unexecuted instantiation: forward.c:char_msg_val
Unexecuted instantiation: xlog.c:char_msg_val
Unexecuted instantiation: blacklists.c:char_msg_val
Unexecuted instantiation: msg_callbacks.c:char_msg_val
Unexecuted instantiation: usr_avp.c:char_msg_val
Unexecuted instantiation: sl_cb.c:char_msg_val
Unexecuted instantiation: resolve.c:char_msg_val
Unexecuted instantiation: io_wait.c:char_msg_val
Unexecuted instantiation: transformations.c:char_msg_val
Unexecuted instantiation: pvar.c:char_msg_val
Unexecuted instantiation: sr_module_deps.c:char_msg_val
Unexecuted instantiation: cfg_reload.c:char_msg_val
Unexecuted instantiation: socket_info.c:char_msg_val
Unexecuted instantiation: time_rec.c:char_msg_val
Unexecuted instantiation: data_lump.c:char_msg_val
Unexecuted instantiation: status_report.c:char_msg_val
Unexecuted instantiation: pt_scaling.c:char_msg_val
Unexecuted instantiation: signals.c:char_msg_val
Unexecuted instantiation: flags.c:char_msg_val
Unexecuted instantiation: db_id.c:char_msg_val
Unexecuted instantiation: trans.c:char_msg_val
Unexecuted instantiation: csv.c:char_msg_val
Unexecuted instantiation: sdp.c:char_msg_val
Unexecuted instantiation: sdp_helpr_funcs.c:char_msg_val
Unexecuted instantiation: digest_parser.c:char_msg_val
Unexecuted instantiation: param_parser.c:char_msg_val
Unexecuted instantiation: digest.c:char_msg_val
Unexecuted instantiation: parse_contact.c:char_msg_val
Unexecuted instantiation: parse_body.c:char_msg_val
Unexecuted instantiation: parse_security.c:char_msg_val
Unexecuted instantiation: parse_call_info.c:char_msg_val
Unexecuted instantiation: parse_event.c:char_msg_val
Unexecuted instantiation: parse_disposition.c:char_msg_val
Unexecuted instantiation: parse_authenticate.c:char_msg_val
Unexecuted instantiation: parser_f.c:char_msg_val
Unexecuted instantiation: parse_rpid.c:char_msg_val
Unexecuted instantiation: parse_ppi.c:char_msg_val
Unexecuted instantiation: parse_fcaps.c:char_msg_val
Unexecuted instantiation: parse_sst.c:char_msg_val
Unexecuted instantiation: parse_rr.c:char_msg_val
Unexecuted instantiation: parse_param.c:char_msg_val
Unexecuted instantiation: parse_diversion.c:char_msg_val
Unexecuted instantiation: parse_nameaddr.c:char_msg_val
Unexecuted instantiation: parse_expires.c:char_msg_val
Unexecuted instantiation: parse_refer_to.c:char_msg_val
Unexecuted instantiation: parse_from.c:char_msg_val
Unexecuted instantiation: parse_pai.c:char_msg_val
Unexecuted instantiation: evi_transport.c:char_msg_val
Unexecuted instantiation: msg_translator.c:char_msg_val
Unexecuted instantiation: md5utils.c:char_msg_val
Unexecuted instantiation: cfg.tab.c:char_msg_val
Unexecuted instantiation: modparam.c:char_msg_val
Unexecuted instantiation: crc.c:char_msg_val
Unexecuted instantiation: re.c:char_msg_val
Unexecuted instantiation: lex.yy.c:char_msg_val
Unexecuted instantiation: cfg_pp.c:char_msg_val
Unexecuted instantiation: shutdown.c:char_msg_val
Unexecuted instantiation: cmds.c:char_msg_val
Unexecuted instantiation: core_cmds.c:char_msg_val
Unexecuted instantiation: serialize.c:char_msg_val
Unexecuted instantiation: cachedb.c:char_msg_val
Unexecuted instantiation: cachedb_id.c:char_msg_val
424
425
426
/* returns the body of the SIP message (if none, an empty body will be returned)
427
 */
428
inline static int get_body(struct sip_msg *msg, str *body)
429
0
{
430
0
  unsigned int hdrs_len;
431
0
  int ct_len;
432
433
0
  if ( parse_headers(msg,HDR_EOH_F, 0)==-1 )
434
0
    return -1;
435
436
0
  if (msg->unparsed){
437
0
    hdrs_len=(unsigned int)(msg->unparsed-msg->buf);
438
0
  } else {
439
0
    return -1;
440
0
  }
441
442
0
  if ((hdrs_len+2<=msg->len) && (strncmp(CRLF,msg->unparsed,CRLF_LEN)==0) )
443
0
    body->s = msg->unparsed + CRLF_LEN;
444
0
  else if ( (hdrs_len+1<=msg->len) &&
445
0
  (*(msg->unparsed)=='\n' || *(msg->unparsed)=='\r' ) )
446
0
    body->s = msg->unparsed + 1;
447
0
  else {
448
    /* no body */
449
0
    body->s = NULL;
450
0
    body->len = 0;
451
0
    return 0;
452
0
  }
453
454
  /* determin the length of the body */
455
0
  body->len = msg->buf + msg->len - body->s;
456
457
  /* double check the len against content-length hdr
458
     (if present, it must be already parsed);
459
     NOTE that the CT hdr may be missing if using UDP, so 
460
     we do not consider its missing an err case */
461
0
  if (msg->content_length) {
462
0
    ct_len = get_content_length( msg );
463
0
    if (ct_len<body->len)
464
0
      body->len = ct_len;
465
0
  } else if (msg->rcv.proto!=PROTO_UDP) {
466
    /* no ct -> no body */
467
0
    body->s = NULL;
468
0
    body->len = 0;
469
0
  }
470
471
0
  return 0;
472
0
}
Unexecuted instantiation: fuzz_uri_parser.c:get_body
Unexecuted instantiation: parse_uri.c:get_body
Unexecuted instantiation: error.c:get_body
Unexecuted instantiation: dprint.c:get_body
Unexecuted instantiation: pt.c:get_body
Unexecuted instantiation: strcommon.c:get_body
Unexecuted instantiation: ut.c:get_body
Unexecuted instantiation: statistics.c:get_body
Unexecuted instantiation: route.c:get_body
Unexecuted instantiation: ipc.c:get_body
Unexecuted instantiation: core_stats.c:get_body
Unexecuted instantiation: route_struct.c:get_body
Unexecuted instantiation: dset.c:get_body
Unexecuted instantiation: pt_load.c:get_body
Unexecuted instantiation: sr_module.c:get_body
Unexecuted instantiation: action.c:get_body
Unexecuted instantiation: db_insertq.c:get_body
Unexecuted instantiation: db.c:get_body
Unexecuted instantiation: proto_tcp.c:get_body
Unexecuted instantiation: proto_udp.c:get_body
Unexecuted instantiation: net_tcp_proc.c:get_body
Unexecuted instantiation: net_tcp.c:get_body
Unexecuted instantiation: tcp_common.c:get_body
Unexecuted instantiation: net_udp.c:get_body
Unexecuted instantiation: tcp_conn_profile.c:get_body
Unexecuted instantiation: trans_trace.c:get_body
Unexecuted instantiation: net_tcp_report.c:get_body
Unexecuted instantiation: shm_mem.c:get_body
Unexecuted instantiation: mi.c:get_body
Unexecuted instantiation: item.c:get_body
Unexecuted instantiation: msg_parser.c:get_body
Unexecuted instantiation: parse_fline.c:get_body
Unexecuted instantiation: parse_methods.c:get_body
Unexecuted instantiation: parse_hname2.c:get_body
Unexecuted instantiation: parse_content.c:get_body
Unexecuted instantiation: hf.c:get_body
Unexecuted instantiation: parse_to.c:get_body
Unexecuted instantiation: parse_via.c:get_body
Unexecuted instantiation: event_interface.c:get_body
Unexecuted instantiation: receive.c:get_body
Unexecuted instantiation: script_cb.c:get_body
Unexecuted instantiation: ip_addr.c:get_body
Unexecuted instantiation: data_lump_rpl.c:get_body
Unexecuted instantiation: async.c:get_body
Unexecuted instantiation: daemonize.c:get_body
Unexecuted instantiation: timer.c:get_body
Unexecuted instantiation: trace_api.c:get_body
Unexecuted instantiation: mod_fix.c:get_body
Unexecuted instantiation: reactor.c:get_body
Unexecuted instantiation: forward.c:get_body
Unexecuted instantiation: xlog.c:get_body
Unexecuted instantiation: blacklists.c:get_body
Unexecuted instantiation: msg_callbacks.c:get_body
Unexecuted instantiation: usr_avp.c:get_body
Unexecuted instantiation: sl_cb.c:get_body
Unexecuted instantiation: resolve.c:get_body
Unexecuted instantiation: io_wait.c:get_body
Unexecuted instantiation: transformations.c:get_body
Unexecuted instantiation: pvar.c:get_body
Unexecuted instantiation: sr_module_deps.c:get_body
Unexecuted instantiation: cfg_reload.c:get_body
Unexecuted instantiation: socket_info.c:get_body
Unexecuted instantiation: time_rec.c:get_body
Unexecuted instantiation: data_lump.c:get_body
Unexecuted instantiation: status_report.c:get_body
Unexecuted instantiation: pt_scaling.c:get_body
Unexecuted instantiation: signals.c:get_body
Unexecuted instantiation: flags.c:get_body
Unexecuted instantiation: db_id.c:get_body
Unexecuted instantiation: trans.c:get_body
Unexecuted instantiation: csv.c:get_body
Unexecuted instantiation: sdp.c:get_body
Unexecuted instantiation: sdp_helpr_funcs.c:get_body
Unexecuted instantiation: digest_parser.c:get_body
Unexecuted instantiation: param_parser.c:get_body
Unexecuted instantiation: digest.c:get_body
Unexecuted instantiation: parse_contact.c:get_body
Unexecuted instantiation: parse_body.c:get_body
Unexecuted instantiation: parse_security.c:get_body
Unexecuted instantiation: parse_call_info.c:get_body
Unexecuted instantiation: parse_event.c:get_body
Unexecuted instantiation: parse_disposition.c:get_body
Unexecuted instantiation: parse_authenticate.c:get_body
Unexecuted instantiation: parser_f.c:get_body
Unexecuted instantiation: parse_rpid.c:get_body
Unexecuted instantiation: parse_ppi.c:get_body
Unexecuted instantiation: parse_fcaps.c:get_body
Unexecuted instantiation: parse_sst.c:get_body
Unexecuted instantiation: parse_rr.c:get_body
Unexecuted instantiation: parse_param.c:get_body
Unexecuted instantiation: parse_diversion.c:get_body
Unexecuted instantiation: parse_nameaddr.c:get_body
Unexecuted instantiation: parse_expires.c:get_body
Unexecuted instantiation: parse_refer_to.c:get_body
Unexecuted instantiation: parse_from.c:get_body
Unexecuted instantiation: parse_pai.c:get_body
Unexecuted instantiation: evi_transport.c:get_body
Unexecuted instantiation: msg_translator.c:get_body
Unexecuted instantiation: md5utils.c:get_body
Unexecuted instantiation: cfg.tab.c:get_body
Unexecuted instantiation: modparam.c:get_body
Unexecuted instantiation: crc.c:get_body
Unexecuted instantiation: re.c:get_body
Unexecuted instantiation: lex.yy.c:get_body
Unexecuted instantiation: cfg_pp.c:get_body
Unexecuted instantiation: shutdown.c:get_body
Unexecuted instantiation: cmds.c:get_body
Unexecuted instantiation: core_cmds.c:get_body
Unexecuted instantiation: serialize.c:get_body
Unexecuted instantiation: cachedb.c:get_body
Unexecuted instantiation: cachedb_id.c:get_body
473
474
/*
475
 * Get the callid of a message. If returned value is 0, the callid is stored
476
 * in the _cid field, otherwise -1 is returned on error
477
 */
478
inline static int get_callid(struct sip_msg* _m, str* _cid)
479
0
{
480
0
  if ((parse_headers(_m, HDR_CALLID_F, 0) == -1)) {
481
0
    LM_ERR("failed to parse call-id header\n");
482
0
    return -1;
483
0
  }
484
0
485
0
  if (_m->callid == NULL) {
486
0
    LM_ERR("call-id not found\n");
487
0
    return -1;
488
0
  }
489
0
490
0
  _cid->s = _m->callid->body.s;
491
0
  _cid->len = _m->callid->body.len;
492
0
  trim(_cid);
493
0
  return 0;
494
0
}
Unexecuted instantiation: fuzz_uri_parser.c:get_callid
Unexecuted instantiation: parse_uri.c:get_callid
Unexecuted instantiation: error.c:get_callid
Unexecuted instantiation: dprint.c:get_callid
Unexecuted instantiation: pt.c:get_callid
Unexecuted instantiation: strcommon.c:get_callid
Unexecuted instantiation: ut.c:get_callid
Unexecuted instantiation: statistics.c:get_callid
Unexecuted instantiation: route.c:get_callid
Unexecuted instantiation: ipc.c:get_callid
Unexecuted instantiation: core_stats.c:get_callid
Unexecuted instantiation: route_struct.c:get_callid
Unexecuted instantiation: dset.c:get_callid
Unexecuted instantiation: pt_load.c:get_callid
Unexecuted instantiation: sr_module.c:get_callid
Unexecuted instantiation: action.c:get_callid
Unexecuted instantiation: db_insertq.c:get_callid
Unexecuted instantiation: db.c:get_callid
Unexecuted instantiation: proto_tcp.c:get_callid
Unexecuted instantiation: proto_udp.c:get_callid
Unexecuted instantiation: net_tcp_proc.c:get_callid
Unexecuted instantiation: net_tcp.c:get_callid
Unexecuted instantiation: tcp_common.c:get_callid
Unexecuted instantiation: net_udp.c:get_callid
Unexecuted instantiation: tcp_conn_profile.c:get_callid
Unexecuted instantiation: trans_trace.c:get_callid
Unexecuted instantiation: net_tcp_report.c:get_callid
Unexecuted instantiation: shm_mem.c:get_callid
Unexecuted instantiation: mi.c:get_callid
Unexecuted instantiation: item.c:get_callid
Unexecuted instantiation: msg_parser.c:get_callid
Unexecuted instantiation: parse_fline.c:get_callid
Unexecuted instantiation: parse_methods.c:get_callid
Unexecuted instantiation: parse_hname2.c:get_callid
Unexecuted instantiation: parse_content.c:get_callid
Unexecuted instantiation: hf.c:get_callid
Unexecuted instantiation: parse_to.c:get_callid
Unexecuted instantiation: parse_via.c:get_callid
Unexecuted instantiation: event_interface.c:get_callid
Unexecuted instantiation: receive.c:get_callid
Unexecuted instantiation: script_cb.c:get_callid
Unexecuted instantiation: ip_addr.c:get_callid
Unexecuted instantiation: data_lump_rpl.c:get_callid
Unexecuted instantiation: async.c:get_callid
Unexecuted instantiation: daemonize.c:get_callid
Unexecuted instantiation: timer.c:get_callid
Unexecuted instantiation: trace_api.c:get_callid
Unexecuted instantiation: mod_fix.c:get_callid
Unexecuted instantiation: reactor.c:get_callid
Unexecuted instantiation: forward.c:get_callid
Unexecuted instantiation: xlog.c:get_callid
Unexecuted instantiation: blacklists.c:get_callid
Unexecuted instantiation: msg_callbacks.c:get_callid
Unexecuted instantiation: usr_avp.c:get_callid
Unexecuted instantiation: sl_cb.c:get_callid
Unexecuted instantiation: resolve.c:get_callid
Unexecuted instantiation: io_wait.c:get_callid
Unexecuted instantiation: transformations.c:get_callid
Unexecuted instantiation: pvar.c:get_callid
Unexecuted instantiation: sr_module_deps.c:get_callid
Unexecuted instantiation: cfg_reload.c:get_callid
Unexecuted instantiation: socket_info.c:get_callid
Unexecuted instantiation: time_rec.c:get_callid
Unexecuted instantiation: data_lump.c:get_callid
Unexecuted instantiation: status_report.c:get_callid
Unexecuted instantiation: pt_scaling.c:get_callid
Unexecuted instantiation: signals.c:get_callid
Unexecuted instantiation: flags.c:get_callid
Unexecuted instantiation: db_id.c:get_callid
Unexecuted instantiation: trans.c:get_callid
Unexecuted instantiation: csv.c:get_callid
Unexecuted instantiation: sdp.c:get_callid
Unexecuted instantiation: sdp_helpr_funcs.c:get_callid
Unexecuted instantiation: digest_parser.c:get_callid
Unexecuted instantiation: param_parser.c:get_callid
Unexecuted instantiation: digest.c:get_callid
Unexecuted instantiation: parse_contact.c:get_callid
Unexecuted instantiation: parse_body.c:get_callid
Unexecuted instantiation: parse_security.c:get_callid
Unexecuted instantiation: parse_call_info.c:get_callid
Unexecuted instantiation: parse_event.c:get_callid
Unexecuted instantiation: parse_disposition.c:get_callid
Unexecuted instantiation: parse_authenticate.c:get_callid
Unexecuted instantiation: parser_f.c:get_callid
Unexecuted instantiation: parse_rpid.c:get_callid
Unexecuted instantiation: parse_ppi.c:get_callid
Unexecuted instantiation: parse_fcaps.c:get_callid
Unexecuted instantiation: parse_sst.c:get_callid
Unexecuted instantiation: parse_rr.c:get_callid
Unexecuted instantiation: parse_param.c:get_callid
Unexecuted instantiation: parse_diversion.c:get_callid
Unexecuted instantiation: parse_nameaddr.c:get_callid
Unexecuted instantiation: parse_expires.c:get_callid
Unexecuted instantiation: parse_refer_to.c:get_callid
Unexecuted instantiation: parse_from.c:get_callid
Unexecuted instantiation: parse_pai.c:get_callid
Unexecuted instantiation: evi_transport.c:get_callid
Unexecuted instantiation: msg_translator.c:get_callid
Unexecuted instantiation: md5utils.c:get_callid
Unexecuted instantiation: cfg.tab.c:get_callid
Unexecuted instantiation: modparam.c:get_callid
Unexecuted instantiation: crc.c:get_callid
Unexecuted instantiation: re.c:get_callid
Unexecuted instantiation: lex.yy.c:get_callid
Unexecuted instantiation: cfg_pp.c:get_callid
Unexecuted instantiation: shutdown.c:get_callid
Unexecuted instantiation: cmds.c:get_callid
Unexecuted instantiation: core_cmds.c:get_callid
Unexecuted instantiation: serialize.c:get_callid
Unexecuted instantiation: cachedb.c:get_callid
Unexecuted instantiation: cachedb_id.c:get_callid
495
496
497
/*
498
 * Search through already parsed headers (no parsing done) a non-standard
499
 * header - all known headers are skipped!
500
 */
501
#define get_header_by_static_name(_msg, _name) \
502
    get_header_by_name(_msg, _name, sizeof(_name)-1)
503
inline static struct hdr_field *get_header_by_name( struct sip_msg *msg,
504
                          char *s, unsigned int len)
505
0
{
506
0
  struct hdr_field *hdr;
507
0
508
0
  for( hdr=msg->headers ; hdr ; hdr=hdr->next ) {
509
0
    if(len==hdr->name.len && strncasecmp(hdr->name.s,s,len)==0)
510
0
      return hdr;
511
0
  }
512
0
  return NULL;
513
0
}
Unexecuted instantiation: fuzz_uri_parser.c:get_header_by_name
Unexecuted instantiation: parse_uri.c:get_header_by_name
Unexecuted instantiation: error.c:get_header_by_name
Unexecuted instantiation: dprint.c:get_header_by_name
Unexecuted instantiation: pt.c:get_header_by_name
Unexecuted instantiation: strcommon.c:get_header_by_name
Unexecuted instantiation: ut.c:get_header_by_name
Unexecuted instantiation: statistics.c:get_header_by_name
Unexecuted instantiation: route.c:get_header_by_name
Unexecuted instantiation: ipc.c:get_header_by_name
Unexecuted instantiation: core_stats.c:get_header_by_name
Unexecuted instantiation: route_struct.c:get_header_by_name
Unexecuted instantiation: dset.c:get_header_by_name
Unexecuted instantiation: pt_load.c:get_header_by_name
Unexecuted instantiation: sr_module.c:get_header_by_name
Unexecuted instantiation: action.c:get_header_by_name
Unexecuted instantiation: db_insertq.c:get_header_by_name
Unexecuted instantiation: db.c:get_header_by_name
Unexecuted instantiation: proto_tcp.c:get_header_by_name
Unexecuted instantiation: proto_udp.c:get_header_by_name
Unexecuted instantiation: net_tcp_proc.c:get_header_by_name
Unexecuted instantiation: net_tcp.c:get_header_by_name
Unexecuted instantiation: tcp_common.c:get_header_by_name
Unexecuted instantiation: net_udp.c:get_header_by_name
Unexecuted instantiation: tcp_conn_profile.c:get_header_by_name
Unexecuted instantiation: trans_trace.c:get_header_by_name
Unexecuted instantiation: net_tcp_report.c:get_header_by_name
Unexecuted instantiation: shm_mem.c:get_header_by_name
Unexecuted instantiation: mi.c:get_header_by_name
Unexecuted instantiation: item.c:get_header_by_name
Unexecuted instantiation: msg_parser.c:get_header_by_name
Unexecuted instantiation: parse_fline.c:get_header_by_name
Unexecuted instantiation: parse_methods.c:get_header_by_name
Unexecuted instantiation: parse_hname2.c:get_header_by_name
Unexecuted instantiation: parse_content.c:get_header_by_name
Unexecuted instantiation: hf.c:get_header_by_name
Unexecuted instantiation: parse_to.c:get_header_by_name
Unexecuted instantiation: parse_via.c:get_header_by_name
Unexecuted instantiation: event_interface.c:get_header_by_name
Unexecuted instantiation: receive.c:get_header_by_name
Unexecuted instantiation: script_cb.c:get_header_by_name
Unexecuted instantiation: ip_addr.c:get_header_by_name
Unexecuted instantiation: data_lump_rpl.c:get_header_by_name
Unexecuted instantiation: async.c:get_header_by_name
Unexecuted instantiation: daemonize.c:get_header_by_name
Unexecuted instantiation: timer.c:get_header_by_name
Unexecuted instantiation: trace_api.c:get_header_by_name
Unexecuted instantiation: mod_fix.c:get_header_by_name
Unexecuted instantiation: reactor.c:get_header_by_name
Unexecuted instantiation: forward.c:get_header_by_name
Unexecuted instantiation: xlog.c:get_header_by_name
Unexecuted instantiation: blacklists.c:get_header_by_name
Unexecuted instantiation: msg_callbacks.c:get_header_by_name
Unexecuted instantiation: usr_avp.c:get_header_by_name
Unexecuted instantiation: sl_cb.c:get_header_by_name
Unexecuted instantiation: resolve.c:get_header_by_name
Unexecuted instantiation: io_wait.c:get_header_by_name
Unexecuted instantiation: transformations.c:get_header_by_name
Unexecuted instantiation: pvar.c:get_header_by_name
Unexecuted instantiation: sr_module_deps.c:get_header_by_name
Unexecuted instantiation: cfg_reload.c:get_header_by_name
Unexecuted instantiation: socket_info.c:get_header_by_name
Unexecuted instantiation: time_rec.c:get_header_by_name
Unexecuted instantiation: data_lump.c:get_header_by_name
Unexecuted instantiation: status_report.c:get_header_by_name
Unexecuted instantiation: pt_scaling.c:get_header_by_name
Unexecuted instantiation: signals.c:get_header_by_name
Unexecuted instantiation: flags.c:get_header_by_name
Unexecuted instantiation: db_id.c:get_header_by_name
Unexecuted instantiation: trans.c:get_header_by_name
Unexecuted instantiation: csv.c:get_header_by_name
Unexecuted instantiation: sdp.c:get_header_by_name
Unexecuted instantiation: sdp_helpr_funcs.c:get_header_by_name
Unexecuted instantiation: digest_parser.c:get_header_by_name
Unexecuted instantiation: param_parser.c:get_header_by_name
Unexecuted instantiation: digest.c:get_header_by_name
Unexecuted instantiation: parse_contact.c:get_header_by_name
Unexecuted instantiation: parse_body.c:get_header_by_name
Unexecuted instantiation: parse_security.c:get_header_by_name
Unexecuted instantiation: parse_call_info.c:get_header_by_name
Unexecuted instantiation: parse_event.c:get_header_by_name
Unexecuted instantiation: parse_disposition.c:get_header_by_name
Unexecuted instantiation: parse_authenticate.c:get_header_by_name
Unexecuted instantiation: parser_f.c:get_header_by_name
Unexecuted instantiation: parse_rpid.c:get_header_by_name
Unexecuted instantiation: parse_ppi.c:get_header_by_name
Unexecuted instantiation: parse_fcaps.c:get_header_by_name
Unexecuted instantiation: parse_sst.c:get_header_by_name
Unexecuted instantiation: parse_rr.c:get_header_by_name
Unexecuted instantiation: parse_param.c:get_header_by_name
Unexecuted instantiation: parse_diversion.c:get_header_by_name
Unexecuted instantiation: parse_nameaddr.c:get_header_by_name
Unexecuted instantiation: parse_expires.c:get_header_by_name
Unexecuted instantiation: parse_refer_to.c:get_header_by_name
Unexecuted instantiation: parse_from.c:get_header_by_name
Unexecuted instantiation: parse_pai.c:get_header_by_name
Unexecuted instantiation: evi_transport.c:get_header_by_name
Unexecuted instantiation: msg_translator.c:get_header_by_name
Unexecuted instantiation: md5utils.c:get_header_by_name
Unexecuted instantiation: cfg.tab.c:get_header_by_name
Unexecuted instantiation: modparam.c:get_header_by_name
Unexecuted instantiation: crc.c:get_header_by_name
Unexecuted instantiation: re.c:get_header_by_name
Unexecuted instantiation: lex.yy.c:get_header_by_name
Unexecuted instantiation: cfg_pp.c:get_header_by_name
Unexecuted instantiation: shutdown.c:get_header_by_name
Unexecuted instantiation: cmds.c:get_header_by_name
Unexecuted instantiation: core_cmds.c:get_header_by_name
Unexecuted instantiation: serialize.c:get_header_by_name
Unexecuted instantiation: cachedb.c:get_header_by_name
Unexecuted instantiation: cachedb_id.c:get_header_by_name
514
515
516
#define get_next_header_by_static_name(_hdr, _name) \
517
    get_next_header_by_name(_hdr, _name, sizeof(_name)-1)
518
inline static struct hdr_field *get_next_header_by_name(
519
            struct hdr_field *first, char *s, unsigned int len)
520
0
{
521
0
  struct hdr_field *hdr;
522
0
523
0
  for( hdr=first->next ; hdr ; hdr=hdr->next ) {
524
0
    if(len==hdr->name.len && strncasecmp(hdr->name.s,s,len)==0)
525
0
      return hdr;
526
0
  }
527
0
  return NULL;
528
0
}
Unexecuted instantiation: fuzz_uri_parser.c:get_next_header_by_name
Unexecuted instantiation: parse_uri.c:get_next_header_by_name
Unexecuted instantiation: error.c:get_next_header_by_name
Unexecuted instantiation: dprint.c:get_next_header_by_name
Unexecuted instantiation: pt.c:get_next_header_by_name
Unexecuted instantiation: strcommon.c:get_next_header_by_name
Unexecuted instantiation: ut.c:get_next_header_by_name
Unexecuted instantiation: statistics.c:get_next_header_by_name
Unexecuted instantiation: route.c:get_next_header_by_name
Unexecuted instantiation: ipc.c:get_next_header_by_name
Unexecuted instantiation: core_stats.c:get_next_header_by_name
Unexecuted instantiation: route_struct.c:get_next_header_by_name
Unexecuted instantiation: dset.c:get_next_header_by_name
Unexecuted instantiation: pt_load.c:get_next_header_by_name
Unexecuted instantiation: sr_module.c:get_next_header_by_name
Unexecuted instantiation: action.c:get_next_header_by_name
Unexecuted instantiation: db_insertq.c:get_next_header_by_name
Unexecuted instantiation: db.c:get_next_header_by_name
Unexecuted instantiation: proto_tcp.c:get_next_header_by_name
Unexecuted instantiation: proto_udp.c:get_next_header_by_name
Unexecuted instantiation: net_tcp_proc.c:get_next_header_by_name
Unexecuted instantiation: net_tcp.c:get_next_header_by_name
Unexecuted instantiation: tcp_common.c:get_next_header_by_name
Unexecuted instantiation: net_udp.c:get_next_header_by_name
Unexecuted instantiation: tcp_conn_profile.c:get_next_header_by_name
Unexecuted instantiation: trans_trace.c:get_next_header_by_name
Unexecuted instantiation: net_tcp_report.c:get_next_header_by_name
Unexecuted instantiation: shm_mem.c:get_next_header_by_name
Unexecuted instantiation: mi.c:get_next_header_by_name
Unexecuted instantiation: item.c:get_next_header_by_name
Unexecuted instantiation: msg_parser.c:get_next_header_by_name
Unexecuted instantiation: parse_fline.c:get_next_header_by_name
Unexecuted instantiation: parse_methods.c:get_next_header_by_name
Unexecuted instantiation: parse_hname2.c:get_next_header_by_name
Unexecuted instantiation: parse_content.c:get_next_header_by_name
Unexecuted instantiation: hf.c:get_next_header_by_name
Unexecuted instantiation: parse_to.c:get_next_header_by_name
Unexecuted instantiation: parse_via.c:get_next_header_by_name
Unexecuted instantiation: event_interface.c:get_next_header_by_name
Unexecuted instantiation: receive.c:get_next_header_by_name
Unexecuted instantiation: script_cb.c:get_next_header_by_name
Unexecuted instantiation: ip_addr.c:get_next_header_by_name
Unexecuted instantiation: data_lump_rpl.c:get_next_header_by_name
Unexecuted instantiation: async.c:get_next_header_by_name
Unexecuted instantiation: daemonize.c:get_next_header_by_name
Unexecuted instantiation: timer.c:get_next_header_by_name
Unexecuted instantiation: trace_api.c:get_next_header_by_name
Unexecuted instantiation: mod_fix.c:get_next_header_by_name
Unexecuted instantiation: reactor.c:get_next_header_by_name
Unexecuted instantiation: forward.c:get_next_header_by_name
Unexecuted instantiation: xlog.c:get_next_header_by_name
Unexecuted instantiation: blacklists.c:get_next_header_by_name
Unexecuted instantiation: msg_callbacks.c:get_next_header_by_name
Unexecuted instantiation: usr_avp.c:get_next_header_by_name
Unexecuted instantiation: sl_cb.c:get_next_header_by_name
Unexecuted instantiation: resolve.c:get_next_header_by_name
Unexecuted instantiation: io_wait.c:get_next_header_by_name
Unexecuted instantiation: transformations.c:get_next_header_by_name
Unexecuted instantiation: pvar.c:get_next_header_by_name
Unexecuted instantiation: sr_module_deps.c:get_next_header_by_name
Unexecuted instantiation: cfg_reload.c:get_next_header_by_name
Unexecuted instantiation: socket_info.c:get_next_header_by_name
Unexecuted instantiation: time_rec.c:get_next_header_by_name
Unexecuted instantiation: data_lump.c:get_next_header_by_name
Unexecuted instantiation: status_report.c:get_next_header_by_name
Unexecuted instantiation: pt_scaling.c:get_next_header_by_name
Unexecuted instantiation: signals.c:get_next_header_by_name
Unexecuted instantiation: flags.c:get_next_header_by_name
Unexecuted instantiation: db_id.c:get_next_header_by_name
Unexecuted instantiation: trans.c:get_next_header_by_name
Unexecuted instantiation: csv.c:get_next_header_by_name
Unexecuted instantiation: sdp.c:get_next_header_by_name
Unexecuted instantiation: sdp_helpr_funcs.c:get_next_header_by_name
Unexecuted instantiation: digest_parser.c:get_next_header_by_name
Unexecuted instantiation: param_parser.c:get_next_header_by_name
Unexecuted instantiation: digest.c:get_next_header_by_name
Unexecuted instantiation: parse_contact.c:get_next_header_by_name
Unexecuted instantiation: parse_body.c:get_next_header_by_name
Unexecuted instantiation: parse_security.c:get_next_header_by_name
Unexecuted instantiation: parse_call_info.c:get_next_header_by_name
Unexecuted instantiation: parse_event.c:get_next_header_by_name
Unexecuted instantiation: parse_disposition.c:get_next_header_by_name
Unexecuted instantiation: parse_authenticate.c:get_next_header_by_name
Unexecuted instantiation: parser_f.c:get_next_header_by_name
Unexecuted instantiation: parse_rpid.c:get_next_header_by_name
Unexecuted instantiation: parse_ppi.c:get_next_header_by_name
Unexecuted instantiation: parse_fcaps.c:get_next_header_by_name
Unexecuted instantiation: parse_sst.c:get_next_header_by_name
Unexecuted instantiation: parse_rr.c:get_next_header_by_name
Unexecuted instantiation: parse_param.c:get_next_header_by_name
Unexecuted instantiation: parse_diversion.c:get_next_header_by_name
Unexecuted instantiation: parse_nameaddr.c:get_next_header_by_name
Unexecuted instantiation: parse_expires.c:get_next_header_by_name
Unexecuted instantiation: parse_refer_to.c:get_next_header_by_name
Unexecuted instantiation: parse_from.c:get_next_header_by_name
Unexecuted instantiation: parse_pai.c:get_next_header_by_name
Unexecuted instantiation: evi_transport.c:get_next_header_by_name
Unexecuted instantiation: msg_translator.c:get_next_header_by_name
Unexecuted instantiation: md5utils.c:get_next_header_by_name
Unexecuted instantiation: cfg.tab.c:get_next_header_by_name
Unexecuted instantiation: modparam.c:get_next_header_by_name
Unexecuted instantiation: crc.c:get_next_header_by_name
Unexecuted instantiation: re.c:get_next_header_by_name
Unexecuted instantiation: lex.yy.c:get_next_header_by_name
Unexecuted instantiation: cfg_pp.c:get_next_header_by_name
Unexecuted instantiation: shutdown.c:get_next_header_by_name
Unexecuted instantiation: cmds.c:get_next_header_by_name
Unexecuted instantiation: core_cmds.c:get_next_header_by_name
Unexecuted instantiation: serialize.c:get_next_header_by_name
Unexecuted instantiation: cachedb.c:get_next_header_by_name
Unexecuted instantiation: cachedb_id.c:get_next_header_by_name
529
530
531
532
533
/*
534
 * Make a private copy of the string and assign it to new_uri (new RURI)
535
 */
536
int set_ruri(struct sip_msg* msg, str* uri);
537
538
539
/*
540
 * Make a private copy of the string and assign it to dst_uri
541
 */
542
int set_dst_uri(struct sip_msg* msg, str* uri);
543
544
545
void reset_dst_uri(struct sip_msg *msg);
546
547
548
int set_dst_host_port(struct sip_msg *msg, str *host, str *port);
549
550
551
enum rw_ruri_part {
552
  RW_RURI_HOST = 1,
553
  RW_RURI_HOSTPORT,
554
  RW_RURI_USER,
555
  RW_RURI_USERPASS,
556
  RW_RURI_PORT,
557
  RW_RURI_PREFIX,
558
  RW_RURI_STRIP,
559
  RW_RURI_STRIP_TAIL
560
};
561
562
int rewrite_ruri(struct sip_msg *msg, str *sval, int ival,
563
        enum rw_ruri_part part);
564
565
566
/*
567
 * Set the q value of the Request-URI
568
 */
569
#define set_ruri_q(_msg,_q) \
570
0
  (_msg)->ruri_q = _q
571
572
573
/*
574
 * Get the q value of the Request-URI
575
 */
576
#define get_ruri_q(_msg) \
577
0
  (_msg)->ruri_q
578
579
580
/*
581
 * Get the per branch flags for RURI
582
 */
583
#define getb0flags(_msg) \
584
0
  (_msg)->ruri_bflags
585
586
587
/*
588
 * Set the per branch flags for RURI
589
 */
590
#define setb0flags( _msg, _flags) \
591
0
  (_msg)->ruri_bflags = _flags
592
593
594
/*
595
 * Make a private copy of the string and assign it to path_vec
596
 */
597
int set_path_vector(struct sip_msg* msg, str* path);
598
void clear_path_vector(struct sip_msg* msg);
599
600
601
/*
602
 * Parses a buffer containing a well formed SIP message and extracts the bodies
603
 * for FROM , TO , CSEQ and CALL-ID headers.
604
 */
605
int extract_ftc_hdrs( char *buf, int len, str *from, str *to, str *cseq,str *callid);
606
607
inline static struct timeval *get_msg_time(struct sip_msg *msg)
608
0
{
609
0
  static struct timeval static_time;
610
0
  if (!msg || msg == (struct sip_msg *)-1) {
611
0
    gettimeofday(&static_time, NULL);
612
0
    return &static_time;
613
0
  }
614
0
  if (msg->time.tv_sec == 0 && msg->time.tv_usec == 0)
615
0
    gettimeofday(&msg->time, NULL);
616
0
  return &msg->time;
617
0
}
Unexecuted instantiation: fuzz_uri_parser.c:get_msg_time
Unexecuted instantiation: parse_uri.c:get_msg_time
Unexecuted instantiation: error.c:get_msg_time
Unexecuted instantiation: dprint.c:get_msg_time
Unexecuted instantiation: pt.c:get_msg_time
Unexecuted instantiation: strcommon.c:get_msg_time
Unexecuted instantiation: ut.c:get_msg_time
Unexecuted instantiation: statistics.c:get_msg_time
Unexecuted instantiation: route.c:get_msg_time
Unexecuted instantiation: ipc.c:get_msg_time
Unexecuted instantiation: core_stats.c:get_msg_time
Unexecuted instantiation: route_struct.c:get_msg_time
Unexecuted instantiation: dset.c:get_msg_time
Unexecuted instantiation: pt_load.c:get_msg_time
Unexecuted instantiation: sr_module.c:get_msg_time
Unexecuted instantiation: action.c:get_msg_time
Unexecuted instantiation: db_insertq.c:get_msg_time
Unexecuted instantiation: db.c:get_msg_time
Unexecuted instantiation: proto_tcp.c:get_msg_time
Unexecuted instantiation: proto_udp.c:get_msg_time
Unexecuted instantiation: net_tcp_proc.c:get_msg_time
Unexecuted instantiation: net_tcp.c:get_msg_time
Unexecuted instantiation: tcp_common.c:get_msg_time
Unexecuted instantiation: net_udp.c:get_msg_time
Unexecuted instantiation: tcp_conn_profile.c:get_msg_time
Unexecuted instantiation: trans_trace.c:get_msg_time
Unexecuted instantiation: net_tcp_report.c:get_msg_time
Unexecuted instantiation: shm_mem.c:get_msg_time
Unexecuted instantiation: mi.c:get_msg_time
Unexecuted instantiation: item.c:get_msg_time
Unexecuted instantiation: msg_parser.c:get_msg_time
Unexecuted instantiation: parse_fline.c:get_msg_time
Unexecuted instantiation: parse_methods.c:get_msg_time
Unexecuted instantiation: parse_hname2.c:get_msg_time
Unexecuted instantiation: parse_content.c:get_msg_time
Unexecuted instantiation: hf.c:get_msg_time
Unexecuted instantiation: parse_to.c:get_msg_time
Unexecuted instantiation: parse_via.c:get_msg_time
Unexecuted instantiation: event_interface.c:get_msg_time
Unexecuted instantiation: receive.c:get_msg_time
Unexecuted instantiation: script_cb.c:get_msg_time
Unexecuted instantiation: ip_addr.c:get_msg_time
Unexecuted instantiation: data_lump_rpl.c:get_msg_time
Unexecuted instantiation: async.c:get_msg_time
Unexecuted instantiation: daemonize.c:get_msg_time
Unexecuted instantiation: timer.c:get_msg_time
Unexecuted instantiation: trace_api.c:get_msg_time
Unexecuted instantiation: mod_fix.c:get_msg_time
Unexecuted instantiation: reactor.c:get_msg_time
Unexecuted instantiation: forward.c:get_msg_time
Unexecuted instantiation: xlog.c:get_msg_time
Unexecuted instantiation: blacklists.c:get_msg_time
Unexecuted instantiation: msg_callbacks.c:get_msg_time
Unexecuted instantiation: usr_avp.c:get_msg_time
Unexecuted instantiation: sl_cb.c:get_msg_time
Unexecuted instantiation: resolve.c:get_msg_time
Unexecuted instantiation: io_wait.c:get_msg_time
Unexecuted instantiation: transformations.c:get_msg_time
Unexecuted instantiation: pvar.c:get_msg_time
Unexecuted instantiation: sr_module_deps.c:get_msg_time
Unexecuted instantiation: cfg_reload.c:get_msg_time
Unexecuted instantiation: socket_info.c:get_msg_time
Unexecuted instantiation: time_rec.c:get_msg_time
Unexecuted instantiation: data_lump.c:get_msg_time
Unexecuted instantiation: status_report.c:get_msg_time
Unexecuted instantiation: pt_scaling.c:get_msg_time
Unexecuted instantiation: signals.c:get_msg_time
Unexecuted instantiation: flags.c:get_msg_time
Unexecuted instantiation: db_id.c:get_msg_time
Unexecuted instantiation: trans.c:get_msg_time
Unexecuted instantiation: csv.c:get_msg_time
Unexecuted instantiation: sdp.c:get_msg_time
Unexecuted instantiation: sdp_helpr_funcs.c:get_msg_time
Unexecuted instantiation: digest_parser.c:get_msg_time
Unexecuted instantiation: param_parser.c:get_msg_time
Unexecuted instantiation: digest.c:get_msg_time
Unexecuted instantiation: parse_contact.c:get_msg_time
Unexecuted instantiation: parse_body.c:get_msg_time
Unexecuted instantiation: parse_security.c:get_msg_time
Unexecuted instantiation: parse_call_info.c:get_msg_time
Unexecuted instantiation: parse_event.c:get_msg_time
Unexecuted instantiation: parse_disposition.c:get_msg_time
Unexecuted instantiation: parse_authenticate.c:get_msg_time
Unexecuted instantiation: parser_f.c:get_msg_time
Unexecuted instantiation: parse_rpid.c:get_msg_time
Unexecuted instantiation: parse_ppi.c:get_msg_time
Unexecuted instantiation: parse_fcaps.c:get_msg_time
Unexecuted instantiation: parse_sst.c:get_msg_time
Unexecuted instantiation: parse_rr.c:get_msg_time
Unexecuted instantiation: parse_param.c:get_msg_time
Unexecuted instantiation: parse_diversion.c:get_msg_time
Unexecuted instantiation: parse_nameaddr.c:get_msg_time
Unexecuted instantiation: parse_expires.c:get_msg_time
Unexecuted instantiation: parse_refer_to.c:get_msg_time
Unexecuted instantiation: parse_from.c:get_msg_time
Unexecuted instantiation: parse_pai.c:get_msg_time
Unexecuted instantiation: evi_transport.c:get_msg_time
Unexecuted instantiation: msg_translator.c:get_msg_time
Unexecuted instantiation: md5utils.c:get_msg_time
Unexecuted instantiation: cfg.tab.c:get_msg_time
Unexecuted instantiation: modparam.c:get_msg_time
Unexecuted instantiation: crc.c:get_msg_time
Unexecuted instantiation: re.c:get_msg_time
Unexecuted instantiation: lex.yy.c:get_msg_time
Unexecuted instantiation: cfg_pp.c:get_msg_time
Unexecuted instantiation: shutdown.c:get_msg_time
Unexecuted instantiation: cmds.c:get_msg_time
Unexecuted instantiation: core_cmds.c:get_msg_time
Unexecuted instantiation: serialize.c:get_msg_time
Unexecuted instantiation: cachedb.c:get_msg_time
Unexecuted instantiation: cachedb_id.c:get_msg_time
618
619
#endif