msg_parser.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548
  1. /*
  2. * Copyright (C) 2001-2003 FhG Fokus
  3. *
  4. * This file is part of ser, a free SIP server.
  5. *
  6. * ser 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. * 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. * [email protected]
  15. *
  16. * ser is distributed in the hope that it will be useful,
  17. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  18. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  19. * GNU General Public License for more details.
  20. *
  21. * You should have received a copy of the GNU General Public License
  22. * along with this program; if not, write to the Free Software
  23. * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  24. *
  25. * History
  26. * -------
  27. * 2003-01-28 removed scratchpad (jiri)
  28. * 2003-02-28 scratchpad compatibility abandoned (jiri)
  29. * 2003-03-06 enum_request_method changed to begin with 1;
  30. * 0 reserved for invalid values; (jiri)
  31. * 2003-03-31 removed sip_msg->repl_add_rm (andrei)
  32. * 2003-04-01 2 macros added: GET_NEXT_HOP and GET_RURI (janakj)
  33. * 2003-04-04 structure for parsed inbound uri added (jiri)
  34. * 2003-04-11 updated the sip_uri structure (lots of fields added) (andrei)
  35. * 2003-04-12 added msg_flags to sip_msg (andrei)
  36. * 2003-11-02 added diversion header field to sip_msg (jh)
  37. * 2004-11-08 added force_send_socket (andrei)
  38. * 2005-02-25 uri types added (sip, sips & tel) (andrei)
  39. * 2006-04-20 uri comp member (only if USE_COMP is defined) (andrei)
  40. * 2006-11-10 check_transaction_quadruple inlined (andrei)
  41. * 2007-01-26 added date, identity, identity_info header fields
  42. * to sip_msg (gergo)
  43. * 2007-03-14 added SIP_MSG_START(msg) macro
  44. */
  45. /*! \file
  46. * \brief Parser :: ???
  47. *
  48. * \ingroup parser
  49. */
  50. #ifndef msg_parser_h
  51. #define msg_parser_h
  52. #include "../comp_defs.h"
  53. #include "../str.h"
  54. #include "../lump_struct.h"
  55. #include "../flags.h"
  56. #include "../ip_addr.h"
  57. #include "../md5utils.h"
  58. #include "../config.h"
  59. #include "parse_def.h"
  60. #include "parse_cseq.h"
  61. #include "parse_via.h"
  62. #include "parse_fline.h"
  63. #include "parse_retry_after.h"
  64. #include "hf.h"
  65. #include "../error.h"
  66. /*! \name convenience short-cut macros */
  67. /*@{ */
  68. #define REQ_LINE(_msg) ((_msg)->first_line.u.request)
  69. #define REQ_METHOD first_line.u.request.method_value
  70. #define REPLY_STATUS first_line.u.reply.statuscode
  71. #define REPLY_CLASS(_reply) ((_reply)->REPLY_STATUS/100)
  72. /*@} */
  73. /*! \brief start of "actual" sip msg (start of first line) */
  74. #define SIP_MSG_START(m) ((m)->first_line.u.request.method.s)
  75. /*! \brief number methods as power of two to allow bitmap matching */
  76. typedef enum request_method {
  77. METHOD_UNDEF=0, /*!< 0 - --- */
  78. METHOD_INVITE=1, /*!< 1 - 2^0 */
  79. METHOD_CANCEL=2, /*!< 2 - 2^1 */
  80. METHOD_ACK=4, /*!< 4 - 2^2 */
  81. METHOD_BYE=8, /*!< 8 - 2^3 */
  82. METHOD_INFO=16, /*!< 16 - 2^4 */
  83. METHOD_REGISTER=32, /*!< 32 - 2^5 */
  84. METHOD_SUBSCRIBE=64, /*!< 64 - 2^6 */
  85. METHOD_NOTIFY=128, /*!< 128 - 2^7 */
  86. METHOD_MESSAGE=256, /*!< 256 - 2^8 */
  87. METHOD_OPTIONS=512, /*!< 512 - 2^9 */
  88. METHOD_PRACK=1024, /*!< 1024 - 2^10 */
  89. METHOD_UPDATE=2048, /*!< 2048 - 2^11 */
  90. METHOD_REFER=4096, /*!< 4096 - 2^12 */
  91. METHOD_PUBLISH=8192, /*!< 8192 - 2^13 */
  92. METHOD_OTHER=16384 /*!< 16384 - 2^14 */
  93. } request_method_t;
  94. #define FL_FORCE_RPORT (1 << 0) /*!< force rport */
  95. #define FL_FORCE_ACTIVE (1 << 1) /*!< force active SDP */
  96. #define FL_SDP_IP_AFS (1 << 2) /*!< SDP IP rewritten */
  97. #define FL_SDP_PORT_AFS (1 << 3) /*!< SDP port rewritten */
  98. #define FL_SHM_CLONE (1 << 4) /*!< msg cloned in SHM as a single chunk */
  99. #define FL_TIMEOUT (1 << 5) /*!< message belongs to an "expired" branch
  100. (for failure route use) */
  101. #define FL_REPLIED (1 << 6) /*!< message branch received at least one reply
  102. (for failure route use) */
  103. #define FL_HASH_INDEX (1 << 7) /*!< msg->hash_index contains a valid value (tm use)*/
  104. #define FL_MTU_TCP_FB (1 << 8)
  105. #define FL_MTU_TLS_FB (1 << 9)
  106. #define FL_MTU_SCTP_FB (1 << 10)
  107. #define FL_ADD_LOCAL_RPORT (1 << 11) /*!< add 'rport' to local via hdr */
  108. #define FL_SDP_BODY (1 << 12) /*!< msg has SDP in body */
  109. #define FL_USE_UAC_FROM (1<<13) /* take FROM hdr from UAC instead of UAS*/
  110. #define FL_USE_UAC_TO (1<<14) /* take TO hdr from UAC instead of UAS */
  111. #define FL_TM_RPL_MATCHED (1<<15) /* tm matched reply already */
  112. #define FL_RPL_SUSPENDED (1<<16) /* for async reply processing */
  113. #define FL_BODY_MULTIPART (1<<17) /* body modified is multipart */
  114. #define FL_RR_ADDED (1<<18) /* Record-Route header was added */
  115. #define FL_UAC_AUTH (1<<19) /* Proxy UAC-like authentication */
  116. /* WARNING: Value (1 << 28) is temporarily reserved for use in kamailio call_control
  117. * module (flag FL_USE_CALL_CONTROL )! */
  118. /* WARNING: Value (1 << 29) is temporarily reserved for use in kamailio acc
  119. * module (flag FL_REQ_UPSTREAM)! */
  120. /* WARNING: Value (1 << 30) is temporarily reserved for use in kamailio
  121. * media proxy module (flag FL_USE_MEDIA_PROXY)! */
  122. /* WARNING: Value (1 << 31) is temporarily reserved for use in kamailio
  123. * nat_traversal module (flag FL_DO_KEEPALIVE)! */
  124. #define FL_MTU_FB_MASK (FL_MTU_TCP_FB|FL_MTU_TLS_FB|FL_MTU_SCTP_FB)
  125. #define IFISMETHOD(methodname,firstchar) \
  126. if ( (*tmp==(firstchar) || *tmp==((firstchar) | 32)) && \
  127. strncasecmp( tmp+1, #methodname +1, methodname##_LEN-1)==0 && \
  128. *(tmp+methodname##_LEN)==' ') { \
  129. fl->type=SIP_REQUEST; \
  130. fl->u.request.method.len=methodname##_LEN; \
  131. fl->u.request.method_value=METHOD_##methodname; \
  132. tmp=buffer+methodname##_LEN; \
  133. }
  134. #define IS_HTTP(req) \
  135. ((req)->first_line.u.request.version.len >= HTTP_VERSION_LEN && \
  136. !strncasecmp((req)->first_line.u.request.version.s, \
  137. HTTP_VERSION, HTTP_VERSION_LEN))
  138. #define IS_SIP(req) \
  139. ((req)->first_line.u.request.version.len >= SIP_VERSION_LEN && \
  140. !strncasecmp((req)->first_line.u.request.version.s, \
  141. SIP_VERSION, SIP_VERSION_LEN))
  142. #define IS_HTTP_REPLY(rpl) \
  143. ((rpl)->first_line.u.reply.version.len >= HTTP_VERSION_LEN && \
  144. !strncasecmp((rpl)->first_line.u.reply.version.s, \
  145. HTTP_VERSION, HTTP_VERSION_LEN))
  146. #define IS_SIP_REPLY(rpl) \
  147. ((rpl)->first_line.u.reply.version.len >= SIP_VERSION_LEN && \
  148. !strncasecmp((rpl)->first_line.u.reply.version.s, \
  149. SIP_VERSION, SIP_VERSION_LEN))
  150. /*! \brief
  151. * Return a URI to which the message should be really sent (not what should
  152. * be in the Request URI. The following fields are tried in this order:
  153. * 1) dst_uri
  154. * 2) new_uri
  155. * 3) first_line.u.request.uri
  156. */
  157. #define GET_NEXT_HOP(m) \
  158. (((m)->dst_uri.s && (m)->dst_uri.len) ? (&(m)->dst_uri) : \
  159. (((m)->new_uri.s && (m)->new_uri.len) ? (&(m)->new_uri) : (&(m)->first_line.u.request.uri)))
  160. /*! \brief
  161. * Return the Reqeust URI of a message.
  162. * The following fields are tried in this order:
  163. * 1) new_uri
  164. * 2) first_line.u.request.uri
  165. */
  166. #define GET_RURI(m) \
  167. (((m)->new_uri.s && (m)->new_uri.len) ? (&(m)->new_uri) : (&(m)->first_line.u.request.uri))
  168. enum _uri_type{ERROR_URI_T=0, SIP_URI_T, SIPS_URI_T, TEL_URI_T, TELS_URI_T, URN_URI_T};
  169. typedef enum _uri_type uri_type;
  170. enum _uri_flags{
  171. URI_USER_NORMALIZE=1,
  172. URI_SIP_USER_PHONE=2
  173. }; /* bit fields */
  174. typedef enum _uri_flags uri_flags;
  175. /*! \brief The SIP uri object */
  176. struct sip_uri {
  177. str user; /*!< Username */
  178. str passwd; /*!< Password */
  179. str host; /*!< Host name */
  180. str port; /*!< Port number */
  181. str params; /*!< Parameters */
  182. str sip_params; /*!< Parameters of the sip: URI.
  183. * (If a tel: URI is embedded in a sip: URI, then
  184. * params points to the parameters of the tel: URI,
  185. * and sip_params to the parameters of the sip: URI.
  186. */
  187. str headers;
  188. unsigned short port_no;
  189. unsigned short proto; /*!< from transport */
  190. uri_type type; /*!< uri scheme */
  191. uri_flags flags;
  192. /*!< parameters */
  193. str transport;
  194. str ttl;
  195. str user_param;
  196. str maddr;
  197. str method;
  198. str lr;
  199. str r2; /*!< ser specific rr parameter */
  200. str gr;
  201. str transport_val; /*!< transport value */
  202. str ttl_val; /*!< TTL value */
  203. str user_param_val; /*!< User= param value */
  204. str maddr_val; /*!< Maddr= param value */
  205. str method_val; /*!< Method value */
  206. str lr_val; /*!< lr value placeholder for lr=on a.s.o*/
  207. str r2_val;
  208. str gr_val;
  209. #ifdef USE_COMP
  210. unsigned short comp;
  211. #endif
  212. };
  213. typedef struct sip_uri sip_uri_t;
  214. struct msg_body;
  215. typedef void (*free_msg_body_f)(struct msg_body** ptr);
  216. typedef enum msg_body_type {
  217. MSG_BODY_UNKNOWN = 0,
  218. MSG_BODY_SDP
  219. } msg_body_type_t;
  220. /*! \brief This structure represents a generic SIP message body, regardless of the
  221. * body type.
  222. *
  223. * Body parsers are supposed to cast this structure to some other
  224. * body-type specific structure, but the body type specific structure must
  225. * retain msg_body_type variable and a pointer to the free function as the
  226. * first two variables within the structure.
  227. */
  228. typedef struct msg_body {
  229. msg_body_type_t type;
  230. free_msg_body_f free;
  231. } msg_body_t;
  232. /* pre-declaration, to include sys/time.h in .c */
  233. struct timeval;
  234. /* structure for cached decoded flow for outbound */
  235. typedef struct ocd_flow {
  236. int decoded;
  237. struct receive_info rcv;
  238. } ocd_flow_t;
  239. /* structure holding fields that don't have to be cloned in shm
  240. * - its content is memset'ed to in shm clone
  241. * - add to msg_ldata_reset() if a field uses dynamic memory */
  242. typedef struct msg_ldata {
  243. ocd_flow_t flow;
  244. } msg_ldata_t;
  245. /*! \brief The SIP message */
  246. typedef struct sip_msg {
  247. unsigned int id; /*!< message id, unique/process*/
  248. int pid; /*!< process id */
  249. struct timeval tval; /*!< time value associated to message */
  250. snd_flags_t fwd_send_flags; /*!< send flags for forwarding */
  251. snd_flags_t rpl_send_flags; /*!< send flags for replies */
  252. struct msg_start first_line; /*!< Message first line */
  253. struct via_body* via1; /*!< The first via */
  254. struct via_body* via2; /*!< The second via */
  255. struct hdr_field* headers; /*!< All the parsed headers*/
  256. struct hdr_field* last_header; /*!< Pointer to the last parsed header*/
  257. hdr_flags_t parsed_flag; /*!< Already parsed header field types */
  258. /* Via, To, CSeq, Call-Id, From, end of header*/
  259. /* pointers to the first occurrences of these headers;
  260. * everything is also saved in 'headers'
  261. * (WARNING: do not deallocate them twice!)*/
  262. struct hdr_field* h_via1;
  263. struct hdr_field* h_via2;
  264. struct hdr_field* callid;
  265. struct hdr_field* to;
  266. struct hdr_field* cseq;
  267. struct hdr_field* from;
  268. struct hdr_field* contact;
  269. struct hdr_field* maxforwards;
  270. struct hdr_field* route;
  271. struct hdr_field* record_route;
  272. struct hdr_field* content_type;
  273. struct hdr_field* content_length;
  274. struct hdr_field* authorization;
  275. struct hdr_field* expires;
  276. struct hdr_field* proxy_auth;
  277. struct hdr_field* supported;
  278. struct hdr_field* require;
  279. struct hdr_field* proxy_require;
  280. struct hdr_field* unsupported;
  281. struct hdr_field* allow;
  282. struct hdr_field* event;
  283. struct hdr_field* accept;
  284. struct hdr_field* accept_language;
  285. struct hdr_field* organization;
  286. struct hdr_field* priority;
  287. struct hdr_field* subject;
  288. struct hdr_field* user_agent;
  289. struct hdr_field* server;
  290. struct hdr_field* content_disposition;
  291. struct hdr_field* diversion;
  292. struct hdr_field* rpid;
  293. struct hdr_field* refer_to;
  294. struct hdr_field* session_expires;
  295. struct hdr_field* min_se;
  296. struct hdr_field* sipifmatch;
  297. struct hdr_field* subscription_state;
  298. struct hdr_field* date;
  299. struct hdr_field* identity;
  300. struct hdr_field* identity_info;
  301. struct hdr_field* pai;
  302. struct hdr_field* ppi;
  303. struct hdr_field* path;
  304. struct hdr_field* privacy;
  305. struct msg_body* body;
  306. char* eoh; /*!< pointer to the end of header (if found) or null */
  307. char* unparsed; /*!< here we stopped parsing*/
  308. struct receive_info rcv; /*!< source & dest ip, ports, proto a.s.o*/
  309. char* buf; /*!< scratch pad, holds a modified message,
  310. * via, etc. point into it */
  311. unsigned int len; /*!< message len (orig) */
  312. /* modifications */
  313. str new_uri; /*!< changed first line uri, when you change this
  314. don't forget to set parsed_uri_ok to 0*/
  315. str dst_uri; /*!< Destination URI, must be forwarded to this URI if len != 0 */
  316. /* current uri */
  317. int parsed_uri_ok; /*!< 1 if parsed_uri is valid, 0 if not, set if to 0
  318. if you modify the uri (e.g change new_uri)*/
  319. struct sip_uri parsed_uri; /*!< speed-up > keep here the parsed uri*/
  320. int parsed_orig_ruri_ok; /*!< 1 if parsed_orig_uri is valid, 0 if not, set if to 0
  321. if you modify the uri (e.g change new_uri)*/
  322. struct sip_uri parsed_orig_ruri; /*!< speed-up > keep here the parsed orig uri*/
  323. struct lump* add_rm; /*!< used for all the forwarded requests/replies */
  324. struct lump* body_lumps; /*!< Lumps that update Content-Length */
  325. struct lump_rpl *reply_lump; /*!< only for localy generated replies !!!*/
  326. /*! \brief str add_to_branch;
  327. whatever whoever want to append to Via branch comes here */
  328. char add_to_branch_s[MAX_BRANCH_PARAM_LEN];
  329. int add_to_branch_len;
  330. unsigned int hash_index; /*!< index to TM hash table; stored in core to avoid unnecessary calculations */
  331. unsigned int msg_flags; /*!< internal flags used by core */
  332. flag_t flags; /*!< config flags */
  333. str set_global_address;
  334. str set_global_port;
  335. struct socket_info* force_send_socket; /*!< force sending on this socket */
  336. str path_vec;
  337. str instance;
  338. unsigned int reg_id;
  339. str ruid;
  340. str location_ua;
  341. /* structure with fields that are needed for local processing
  342. * - not cloned to shm, reset to 0 in the clone */
  343. msg_ldata_t ldv;
  344. /* IMPORTANT: when adding new fields in this structure (sip_msg_t),
  345. * be sure it is freed in free_sip_msg() and it is cloned or reset
  346. * to shm structure for transaction - see sip_msg_clone.c. In tm
  347. * module, take care of these fields for faked environemt used for
  348. * runing failure handlers - see modules/tm/t_reply.c */
  349. } sip_msg_t;
  350. /*! \brief pointer to a fakes message which was never received ;
  351. (when this message is "relayed", it is generated out
  352. of the original request)
  353. */
  354. #define FAKED_REPLY ((struct sip_msg *) -1)
  355. extern int via_cnt;
  356. /** global request flags.
  357. * msg->msg_flags should be OR'ed with it before
  358. * a flag value is checked, e.g.:
  359. * if ((msg->msg_flags|global_req_flags) & FL_XXX) ...
  360. */
  361. extern unsigned int global_req_flags;
  362. int parse_msg(char* const buf, const unsigned int len, struct sip_msg* const msg);
  363. int parse_headers(struct sip_msg* const msg, const hdr_flags_t flags, const int next);
  364. char* get_hdr_field(char* const buf, char* const end, struct hdr_field* const hdr);
  365. void free_sip_msg(struct sip_msg* const msg);
  366. /*! \brief make sure all HFs needed for transaction identification have been
  367. parsed; return 0 if those HFs can't be found
  368. */
  369. inline static int check_transaction_quadruple(struct sip_msg* const msg)
  370. {
  371. if ( parse_headers(msg, HDR_FROM_F|HDR_TO_F|HDR_CALLID_F|HDR_CSEQ_F,0)!=-1
  372. && msg->from && msg->to && msg->callid && msg->cseq ) {
  373. return 1;
  374. } else {
  375. ser_error=E_BAD_TUPEL;
  376. return 0;
  377. }
  378. }
  379. /*! \brief returns a pointer to the begining of the msg's body
  380. */
  381. inline static char* get_body(struct sip_msg* const msg)
  382. {
  383. int offset;
  384. unsigned int len;
  385. if ( parse_headers(msg, HDR_EOH_F, 0)==-1 )
  386. return 0;
  387. if (msg->unparsed){
  388. len=(unsigned int)(msg->unparsed-msg->buf);
  389. }else return 0;
  390. if ((len+2<=msg->len) && (strncmp(CRLF,msg->unparsed,CRLF_LEN)==0) )
  391. offset = CRLF_LEN;
  392. else if ( (len+1<=msg->len) &&
  393. (*(msg->unparsed)=='\n' || *(msg->unparsed)=='\r' ) )
  394. offset = 1;
  395. else
  396. return 0;
  397. return msg->unparsed + offset;
  398. }
  399. /*! \brief If the new_uri is set, then reset it */
  400. void reset_new_uri(struct sip_msg* const msg);
  401. /*! \brief
  402. * Make a private copy of the string and assign it to dst_uri
  403. */
  404. int set_dst_uri(struct sip_msg* const msg, const str* const uri);
  405. /*! \brief If the dst_uri is set to an URI then reset it */
  406. void reset_dst_uri(struct sip_msg* const msg);
  407. hdr_field_t* get_hdr(const sip_msg_t* const msg, const enum _hdr_types_t ht);
  408. hdr_field_t* next_sibling_hdr(const hdr_field_t* const hf);
  409. /** not used yet */
  410. hdr_field_t* get_hdr_by_name(const sip_msg_t* const msg, const char* const name, const int name_len);
  411. hdr_field_t* next_sibling_hdr_by_name(const hdr_field_t* const hf);
  412. int set_path_vector(struct sip_msg* msg, str* path);
  413. void reset_path_vector(struct sip_msg* const msg);
  414. int set_instance(struct sip_msg* msg, str* instance);
  415. void reset_instance(struct sip_msg* const msg);
  416. int set_ruid(struct sip_msg* msg, str* ruid);
  417. void reset_ruid(struct sip_msg* const msg);
  418. int set_ua(struct sip_msg* msg, str *location_ua);
  419. void reset_ua(struct sip_msg* const msg);
  420. /** force a specific send socket for forwarding a request.
  421. * @param msg - sip msg.
  422. * @param fsocket - forced socket, pointer to struct socket_info, can be 0 (in
  423. * which case it's equivalent to reset_force_socket()).
  424. */
  425. #define set_force_socket(msg, fsocket) \
  426. do { \
  427. (msg)->force_send_socket=(fsocket); \
  428. if ((msg)->force_send_socket) \
  429. (msg)->fwd_send_flags.f |= SND_F_FORCE_SOCKET; \
  430. else \
  431. (msg)->fwd_send_flags.f &= ~SND_F_FORCE_SOCKET; \
  432. } while (0)
  433. /** reset a previously forced send socket. */
  434. #define reset_force_socket(msg) set_force_socket(msg, 0)
  435. /**
  436. * struct to identify a msg context
  437. * - the pair of pid and message-id
  438. */
  439. typedef struct msg_ctx_id {
  440. int pid;
  441. int msgid;
  442. } msg_ctx_id_t;
  443. /**
  444. * set msg context id
  445. * - return: -1 on error; 0 - on set
  446. */
  447. int msg_ctx_id_set(const sip_msg_t* const msg, msg_ctx_id_t* const mid);
  448. /**
  449. * check msg context id
  450. * - return: -1 on error; 0 - on no match; 1 - on match
  451. */
  452. int msg_ctx_id_match(const sip_msg_t* const msg, const msg_ctx_id_t* const mid);
  453. /**
  454. * set msg time value
  455. */
  456. int msg_set_time(sip_msg_t* const msg);
  457. /**
  458. * reset content of msg->ldv (msg_ldata_t structure)
  459. */
  460. void msg_ldata_reset(sip_msg_t*);
  461. #endif