#include <stdio.h>
#include <stdlib.h>
#include <sys/types.h>
#include <unistd.h>
#include "../mem/mem.h"
#include "../dprint.h"
#include "../str.h"
#include "../ut.h"
#include "parse_content.h"

Go to the source code of this file.
Data Structures | |
| struct | type_node_s |
Defines | |
| #define | is_char_equal(_c_, _cs_) ( (isalpha((int)_c_)?(((_c_)|0x20)==(_cs_)):((_c_)==(_cs_)))==1 ) |
| #define | is_mime_char(_c_) (isalpha((int)_c_) || (_c_)=='-' || (_c_)=='+' || (_c_)=='.') |
Typedefs | |
| typedef struct type_node_s | type_node_t |
Functions | |
| char * | decode_mime_type (char *start, char *end, unsigned int *mime_type) |
| int | parse_accept_hdr (struct sip_msg *msg) |
| char * | parse_content_length (char *buffer, char *end, int *length) |
| int | parse_content_type_hdr (struct sip_msg *msg) |
Variables | |
| static type_node_t | subtype_tree [] |
| static type_node_t | type_tree [] |
Definition in file parse_content.c.
| #define is_char_equal | ( | _c_, | |||
| _cs_ | ) | ( (isalpha((int)_c_)?(((_c_)|0x20)==(_cs_)):((_c_)==(_cs_)))==1 ) |
| #define is_mime_char | ( | _c_ | ) | (isalpha((int)_c_) || (_c_)=='-' || (_c_)=='+' || (_c_)=='.') |
| typedef struct type_node_s type_node_t |
Node of the type's tree; this tree contains all the known types;
| char* decode_mime_type | ( | char * | start, | |
| char * | end, | |||
| unsigned int * | mime_type | |||
| ) |
parse a string containing a mime description
Definition at line 269 of file parse_content.c.
References type_node_s::final, is_char_equal, is_mime_char, LM_ERR, type_node_s::next, SUBTYPE_ALL, SUBTYPE_UNKNOWN, TYPE_ALL, and TYPE_UNKNOWN.
Referenced by fixup_body_type(), parse_accept_hdr(), and parse_content_type_hdr().
| int parse_accept_hdr | ( | struct sip_msg * | msg | ) |
parse the body of the Accept header. It's values are also converted as an null-terminated array of ints.
Definition at line 424 of file parse_content.c.
References sip_msg::accept, hdr_field::body, decode_mime_type(), HDR_ACCEPT_F, _str::len, LM_DBG, LM_ERR, MAX_MIMES_NR, parse_headers(), hdr_field::parsed, pkg_malloc, and _str::s.
Referenced by cpl_process_register(), and encode_header().
| char* parse_content_length | ( | char * | buffer, | |
| char * | end, | |||
| int * | len | |||
| ) |
parse the body of a Content_-Length header. Also tries to recognize the type specified by this header (see th above defines).
Definition at line 227 of file parse_content.c.
References LM_ERR.
Referenced by encode_header(), and get_hdr_field().
| int parse_content_type_hdr | ( | struct sip_msg * | msg | ) |
parse the body of the Content-Type header. It's value is also converted as int. Returns: n (n>0) : the found type 0 : hdr not found -1 : error (parse error )
Definition at line 376 of file parse_content.c.
References hdr_field::body, sip_msg::content_type, decode_mime_type(), get_content_type, HDR_CONTENTTYPE_F, _str::len, LM_DBG, LM_ERR, parse_headers(), hdr_field::parsed, _str::s, SUBTYPE_ALL, and TYPE_ALL.
Referenced by cmd_send_message(), cpl_process_register(), encode_header(), func_handle_publish(), func_send_message(), has_body_f(), m_store(), push_on_network(), and xjab_manage_sipmsg().
type_node_t subtype_tree[] [static] |
Definition at line 98 of file parse_content.c.
type_node_t type_tree[] [static] |
Definition at line 64 of file parse_content.c.
1.5.6