#include "config.h"
#include <sofia-sip/su_tagarg.h>
#include "sofia-sip/sip_parser.h"
#include <sofia-sip/msg_mclass.h>
#include <stddef.h>
#include <stdlib.h>
#include <string.h>
#include <stdio.h>
#include <assert.h>
#include <limits.h>
Include dependency graph for sip_parser.c:

Functions | |
| msg_mclass_t * | sip_default_mclass (void) |
| Return built-in SIP parser object. | |
| issize_t | sip_extract_body (msg_t *msg, sip_t *sip, char b[], isize_t bsiz, int eos) |
| Extract SIP message body, including separator line. | |
| int | sip_version_d (char **ss, char const **ver) |
| Parse SIP version. | |
| isize_t | sip_version_xtra (char const *version) |
| Calculate extra space required by version string. | |
| void | sip_version_dup (char **pp, char const **dd, char const *s) |
| Duplicate a transport string. | |
| char const * | sip_method_name (sip_method_t method, char const *name) |
| Return string corresponding to the method. | |
| sip_method_t | sip_method_d (char **ss, char const **return_name) |
| Parse a SIP method name. | |
| sip_method_t | sip_method_code (char const *name) |
| Return code corresponding to the method code. | |
| issize_t | sip_transport_d (char **ss, char const **ttransport) |
| Decode transport. | |
| isize_t | sip_transport_xtra (char const *transport) |
| Calculate extra space required by sip_transport_dup(). | |
| void | sip_transport_dup (char **pp, char const **dd, char const *s) |
| Duplicate a transport string. | |
| char * | sip_word_at_word_d (char **ss) |
| Parse SIP <word "@" word> construct used in Call-ID. | |
| int | sip_complete_message (msg_t *msg) |
| Complete SIP message. | |
Variables | |
| char const | sip_parser_version [] |
| SIP parser version. | |
| char const | sip_version_2_0 [] |
| SIP version 2.0. | |
| msg_mclass_t | sip_mclass [] |
| Default message class. | |
| char const *const | sip_method_names [] |
| Well-known SIP method names. | |
| int sip_complete_message | ( | msg_t * | msg | ) |
Complete SIP message.
Add sip_content_length and sip_separator if they are missing. The test that all necessary message components ( From, To, CSeq, Call-ID, Content-Length and message separator are present.
| 0 | when successful | |
| -1 | upon an error: headers are missing and they could not be added |
Extract SIP message body, including separator line.
| msg | message object [IN] | |
| sip | public SIP message structure [IN/OUT] | |
| b | buffer containing unparsed data [IN] | |
| bsiz | buffer size [IN] | |
| eos | true if buffer contains whole message [IN] |
| -1 | error | |
| 0 | cannot proceed | |
| m |
| sip_method_t sip_method_d | ( | char ** | ss, | |
| char const ** | return_name | |||
| ) |
Parse a SIP method name.
Parse a SIP method name and return a code corresponding to the method. The address of the first non-LWS character after method name is stored in *ss.
| ss | pointer to pointer to string to be parsed | |
| return_name | value-result parameter for method name |
-1 (sip_method_invalid()) if an error occurred.NULL, a pointer to the method name is stored to it.
| int sip_version_d | ( | char ** | ss, | |
| char const ** | ver | |||
| ) |
Parse SIP version.
Parse a SIP version string. Update the pointer at ss to first non-LWS character after the version string.
| ss | string to be parsed [IN/OUT] | |
| ver | value result for version [OUT] |
| 0 | when successful, | |
| -1 | upon an error. |