#include "msg_parser.h"


Go to the source code of this file.
Data Structures | |
| struct | mime_type |
Defines | |
| #define | get_accept(_msg_) ((int*)((_msg_)->accept->parsed)) |
| #define | get_content_length(_msg_) ((long)((_msg_)->content_length->parsed)) |
| #define | get_content_type(_msg_) ((int)(long)((_msg_)->content_type->parsed)) |
| #define | MAX_MIMES_NR 128 |
| #define | SUBTYPE_ALL 0xfe |
| #define | SUBTYPE_CPIM 2 |
| #define | SUBTYPE_CPLXML 4 |
| #define | SUBTYPE_EXTERNAL_BODY 11 |
| #define | SUBTYPE_LPIDFXML 8 |
| #define | SUBTYPE_MIXED 14 |
| #define | SUBTYPE_PIDFXML 5 |
| #define | SUBTYPE_PLAIN 1 |
| #define | SUBTYPE_RELATED 7 |
| #define | SUBTYPE_RLMIXML 6 |
| #define | SUBTYPE_SDP 3 |
| #define | SUBTYPE_SMS 13 |
| #define | SUBTYPE_UNKNOWN 0xff |
| #define | SUBTYPE_WATCHERINFOXML 10 |
| #define | SUBTYPE_XML_MSRTC_PIDF 12 |
| #define | SUBTYPE_XPIDFXML 9 |
| #define | TYPE_ALL 0xfe |
| #define | TYPE_APPLICATION 3 |
| #define | TYPE_MESSAGE 2 |
| #define | TYPE_MULTIPART 4 |
| #define | TYPE_TEXT 1 |
| #define | TYPE_UNKNOWN 0xff |
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 *len) |
| int | parse_content_type_hdr (struct sip_msg *msg) |
Definition in file parse_content.h.
| #define get_accept | ( | _msg_ | ) | ((int*)((_msg_)->accept->parsed)) |
returns the accept values of a sip_msg as an null-terminated array of integers
Definition at line 91 of file parse_content.h.
Referenced by cpl_process_register().
| #define get_content_length | ( | _msg_ | ) | ((long)((_msg_)->content_length->parsed)) |
returns the content-length value of a sip_msg as an integer
Definition at line 78 of file parse_content.h.
Referenced by ac_cancel(), ac_uac_req(), bla_handle_notify(), cmd_send_message(), do_script_action(), extract_body(), func_handle_publish(), func_send_message(), handle_publish(), has_body_f(), imc_manager(), m_store(), mwi_publ_handl(), Notify2Xmpp(), push_on_network(), rls_handle_notify(), set_body_f(), should_acc_reply(), xjab_manage_sipmsg(), and xml_publ_handl().
| #define get_content_type | ( | _msg_ | ) | ((int)(long)((_msg_)->content_type->parsed)) |
returns the content-type value of a sip_msg as an integer
Definition at line 84 of file parse_content.h.
Referenced by handle_publish(), and parse_content_type_hdr().
| #define MAX_MIMES_NR 128 |
Maximum number of mimes allowed in Accept header
Definition at line 73 of file parse_content.h.
Referenced by parse_accept_hdr().
| #define SUBTYPE_ALL 0xfe |
Definition at line 66 of file parse_content.h.
Referenced by cpl_process_register(), decode_mime_type(), parse_content_type_hdr(), and print_encoded_mime_type().
| #define SUBTYPE_CPIM 2 |
Definition at line 53 of file parse_content.h.
Referenced by cmd_send_message(), m_store(), print_encoded_mime_type(), push_on_network(), and xjab_manage_sipmsg().
| #define SUBTYPE_CPLXML 4 |
Definition at line 55 of file parse_content.h.
Referenced by cpl_process_register(), and print_encoded_mime_type().
| #define SUBTYPE_EXTERNAL_BODY 11 |
| #define SUBTYPE_LPIDFXML 8 |
| #define SUBTYPE_MIXED 14 |
Definition at line 65 of file parse_content.h.
| #define SUBTYPE_PIDFXML 5 |
Definition at line 56 of file parse_content.h.
Referenced by handle_publish(), and print_encoded_mime_type().
| #define SUBTYPE_PLAIN 1 |
Definition at line 52 of file parse_content.h.
Referenced by cmd_send_message(), m_store(), print_encoded_mime_type(), push_on_network(), and xjab_manage_sipmsg().
| #define SUBTYPE_RELATED 7 |
| #define SUBTYPE_RLMIXML 6 |
| #define SUBTYPE_SDP 3 |
Definition at line 54 of file parse_content.h.
Referenced by has_body_f(), and print_encoded_mime_type().
| #define SUBTYPE_SMS 13 |
Definition at line 64 of file parse_content.h.
| #define SUBTYPE_UNKNOWN 0xff |
Definition at line 67 of file parse_content.h.
Referenced by decode_mime_type(), and print_encoded_mime_type().
| #define SUBTYPE_WATCHERINFOXML 10 |
| #define SUBTYPE_XML_MSRTC_PIDF 12 |
| #define SUBTYPE_XPIDFXML 9 |
| #define TYPE_ALL 0xfe |
Definition at line 49 of file parse_content.h.
Referenced by cpl_process_register(), decode_mime_type(), parse_content_type_hdr(), and print_encoded_mime_type().
| #define TYPE_APPLICATION 3 |
Definition at line 47 of file parse_content.h.
Referenced by cpl_process_register(), has_body_f(), and print_encoded_mime_type().
| #define TYPE_MESSAGE 2 |
Definition at line 46 of file parse_content.h.
Referenced by cmd_send_message(), m_store(), print_encoded_mime_type(), push_on_network(), and xjab_manage_sipmsg().
| #define TYPE_MULTIPART 4 |
| #define TYPE_TEXT 1 |
Definition at line 45 of file parse_content.h.
Referenced by cmd_send_message(), func_send_message(), m_store(), print_encoded_mime_type(), push_on_network(), and xjab_manage_sipmsg().
| #define TYPE_UNKNOWN 0xff |
Definition at line 50 of file parse_content.h.
Referenced by decode_mime_type(), and print_encoded_mime_type().
| 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().
1.5.6