#include "parse_sst.h"
#include "../error.h"
#include "../dprint.h"
#include "../mem/mem.h"

Go to the source code of this file.
Defines | |
| #define | MAKE_3BYTES(a, b, c) ( ((a)&0xFF) | (((b)&0xFF)<<8) | (((c)&0xFF)<<16) ) |
| #define | MAKE_4BYTES(a, b, c, d) ( ((a)&0xFF) | (((b)&0xFF)<<8) | (((c)&0xFF)<<16) | (((d)&0xFF)<<24) ) |
Functions | |
| void | free_session_expires (struct session_expires *se) |
| int | is_num (char c) |
| int | is_space (char c) |
| unsigned | lower_3bytes (unsigned d) |
| unsigned | lower_4bytes (unsigned d) |
| unsigned | lower_byte (char b) |
| struct session_expires * | malloc_session_expires (void) |
| enum parse_sst_result | parse_min_se (struct sip_msg *msg, unsigned int *min_se) |
| enum parse_sst_result | parse_min_se_body (struct hdr_field *hf) |
| enum parse_sst_result | parse_session_expires (struct sip_msg *msg, struct session_expires *se) |
| Parses the (should be only one instance) single instance of the "Session-Expires" or "x" header in the msg. | |
| enum parse_sst_result | parse_session_expires_body (struct hdr_field *hf) |
| unsigned | read_3bytes (char *val) |
| unsigned | read_4bytes (char *val) |
Definition in file parse_sst.c.
| #define MAKE_3BYTES | ( | a, | |||
| b, | |||||
| c | ) | ( ((a)&0xFF) | (((b)&0xFF)<<8) | (((c)&0xFF)<<16) ) |
| #define MAKE_4BYTES | ( | a, | |||
| b, | |||||
| c, | |||||
| d | ) | ( ((a)&0xFF) | (((b)&0xFF)<<8) | (((c)&0xFF)<<16) | (((d)&0xFF)<<24) ) |
| void free_session_expires | ( | struct session_expires * | ) |
Deallocates memory previously allocated via malloc_session_expires().
Definition at line 73 of file parse_sst.c.
References pkg_free.
Referenced by clean_hdr_field().
| int is_num | ( | char | c | ) | [inline] |
Definition at line 41 of file parse_sst.c.
Referenced by parse_min_se_body(), and parse_session_expires_body().
| int is_space | ( | char | c | ) | [inline] |
Definition at line 40 of file parse_sst.c.
Referenced by parse_min_se_body(), and parse_session_expires_body().
| unsigned lower_3bytes | ( | unsigned | d | ) | [inline] |
| unsigned lower_4bytes | ( | unsigned | d | ) | [inline] |
| unsigned lower_byte | ( | char | b | ) | [inline] |
| struct session_expires* malloc_session_expires | ( | void | ) | [read] |
Allocate a zeroed-out struct session_expires.
Definition at line 62 of file parse_sst.c.
References pkg_malloc.
Referenced by parse_session_expires_body().
| enum parse_sst_result parse_min_se | ( | struct sip_msg * | msg, | |
| unsigned int * | min_se | |||
| ) |
Definition at line 223 of file parse_sst.c.
References sip_msg::min_se, parse_min_se_body(), parse_sst_header_not_found, parse_sst_success, and hdr_field::parsed.
Referenced by parse_msg_for_sst_info(), and sst_check_min().
| enum parse_sst_result parse_min_se_body | ( | struct hdr_field * | hf | ) |
Definition at line 197 of file parse_sst.c.
References hdr_field::body, session_expires::interval, is_num(), is_space(), _str::len, len, parse_sst_no_value, parse_sst_parse_error, parse_sst_success, hdr_field::parsed, and _str::s.
Referenced by parse_min_se().
| enum parse_sst_result parse_session_expires | ( | struct sip_msg * | msg, | |
| struct session_expires * | se | |||
| ) |
Parses the (should be only one instance) single instance of the "Session-Expires" or "x" header in the msg.
Note[1]: it looks like only the frequently-used headers are automatically parsed in parse_headers() (indicated by a parse_<name> function of the form "char* parse_<name>(char *buf, char *end, foo*) and a struct foo with a member called "error").
| msg | the sip message to examine | |
| se | the place to store session-expires information into, if provided; note that result is also available in *((struct session_expires *)msg->session_expires->parsed) |
Definition at line 175 of file parse_sst.c.
References parse_session_expires_body(), parse_sst_header_not_found, parse_sst_success, hdr_field::parsed, and sip_msg::session_expires.
Referenced by parse_msg_for_sst_info(), and sst_check_min().
| enum parse_sst_result parse_session_expires_body | ( | struct hdr_field * | hf | ) |
Definition at line 81 of file parse_sst.c.
References hdr_field::body, session_expires::interval, is_num(), is_space(), _str::len, len, LM_ERR, lower_3bytes(), lower_4bytes(), lower_byte(), MAKE_3BYTES, MAKE_4BYTES, malloc_session_expires(), parse_sst_header_not_found, parse_sst_no_value, parse_sst_out_of_mem, parse_sst_parse_error, parse_sst_success, hdr_field::parsed, read_3bytes(), read_4bytes(), session_expires::refresher, _str::s, sst_refresher_uac, sst_refresher_uas, and sst_refresher_unspecified.
Referenced by parse_session_expires().
| unsigned read_3bytes | ( | char * | val | ) | [inline] |
| unsigned read_4bytes | ( | char * | val | ) | [inline] |
1.5.6