📄 sip_mime.c
字号:
/**@ingroup sip_content_disposition * @typedef struct msg_content_disposition_s sip_content_disposition_t; * * The structure #sip_content_disposition_t contains representation of an * @ContentDisposition header. * * The #sip_content_disposition_t is defined as follows: * @code * typedef struct msg_content_disposition_s * { * msg_common_t cd_common[1]; // Common fragment info * msg_error_t *cd_next; // Link to next (dummy) * char const *cd_type; // Disposition type * msg_param_t const *cd_params; // List of parameters * char const *cd_handling; // Value of @b handling parameter * unsigned cd_required:1; // True if handling=required * unsigned cd_optional:1; // True if handling=optional * } sip_content_disposition_t; * @endcode */static msg_xtra_f sip_content_disposition_dup_xtra;static msg_dup_f sip_content_disposition_dup_one;#define sip_content_disposition_update msg_content_disposition_updatemsg_hclass_t sip_content_disposition_class[] = SIP_HEADER_CLASS(content_disposition, "Content-Disposition", "", cd_params, single, content_disposition);issize_t sip_content_disposition_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen){ return msg_content_disposition_d(home, h, s, slen);}issize_t sip_content_disposition_e(char b[], isize_t bsiz, sip_header_t const *h, int f){ return msg_content_disposition_e(b, bsiz, h, f);}staticisize_t sip_content_disposition_dup_xtra(sip_header_t const *h, isize_t offset){ return msg_content_disposition_dup_xtra(h, offset);}/** Duplicate one #sip_content_disposition_t object */ staticchar *sip_content_disposition_dup_one(sip_header_t *dst, sip_header_t const *src, char *b, isize_t xtra){ return msg_content_disposition_dup_one(dst, src, b, xtra);}/* ====================================================================== *//**@SIP_HEADER sip_content_encoding Content-Encoding Header * * The Content-Encoding header indicates what additional content codings * have been applied to the entity-body. Its syntax is defined in @RFC3261 * as follows: * * @code * Content-Encoding = ( "Content-Encoding" / "e" ) HCOLON * content-coding *(COMMA content-coding) * content-coding = token * @endcode * * The parsed Content-Encoding header * is stored in #sip_content_encoding_t structure. *//**@ingroup sip_content_encoding * @typedef struct msg_list_s sip_content_encoding_t; * * The structure #sip_content_encoding_t contains representation of an * @ContentEncoding header. * * The #sip_content_encoding_t is defined as follows: * @code * typedef struct msg_list_s * { * msg_common_t k_common[1]; // Common fragment info * msg_list_t *k_next; // Link to next header * msg_param_t *k_items; // List of items * } sip_content_encoding_t; * @endcode */msg_hclass_t sip_content_encoding_class[] = SIP_HEADER_CLASS_LIST(content_encoding, "Content-Encoding", "e", list);issize_t sip_content_encoding_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen){ return msg_list_d(home, h, s, slen);}issize_t sip_content_encoding_e(char b[], isize_t bsiz, sip_header_t const *h, int f){ return msg_list_e(b, bsiz, h, f);}/* ====================================================================== *//**@SIP_HEADER sip_content_language Content-Language Header * * The Content-Language header @RFC2616 section 14.12 describes the natural language(s) of * the intended audience for the enclosed entity. Note that this might not * be equivalent to all the languages used within the entity-body. Its * syntax is defined in @RFC3261 as follows: * * @code * Content-Language = "Content-Language" HCOLON * language-tag *(COMMA language-tag) * language-tag = primary-tag *( "-" subtag ) * primary-tag = 1*8ALPHA * subtag = 1*8ALPHA * @endcode * * The parsed Content-Language header * is stored in #sip_content_language_t structure. *//**@ingroup sip_content_language * @typedef typedef struct msg_content_language_s sip_content_language_t; * * The structure #sip_content_language_t contains representation of * @ContentLanguage header. * * The #sip_content_language_t is defined as follows: * @code * typedef struct { * msg_common_t k_common[1]; // Common fragment info * msg_content_language_t *k_next; // (Content-Encoding header) * msg_param_t *k_items; // List of languages * } sip_content_language_t; * @endcode */msg_hclass_t sip_content_language_class[] = SIP_HEADER_CLASS_LIST(content_language, "Content-Language", "", list);issize_t sip_content_language_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen){ return msg_list_d(home, h, s, slen);}issize_t sip_content_language_e(char b[], isize_t bsiz, sip_header_t const *h, int f){ return msg_list_e(b, bsiz, h, f);}/* ====================================================================== *//**@SIP_HEADER sip_content_type Content-Type Header * * The Content-Type header indicates the media type of the message-body sent * to the recipient. Its syntax is defined in [H3.7, S] as * follows: * * @code * Content-Type = ( "Content-Type" / "c" ) HCOLON media-type * media-type = m-type SLASH m-subtype *(SEMI m-parameter) * m-type = discrete-type / composite-type * discrete-type = "text" / "image" / "audio" / "video" * / "application" / extension-token * composite-type = "message" / "multipart" / extension-token * extension-token = ietf-token / x-token * ietf-token = token * x-token = "x-" token * m-subtype = extension-token / iana-token * iana-token = token * m-parameter = m-attribute EQUAL m-value * m-attribute = token * m-value = token / quoted-string * @endcode * * The parsed Content-Type header is stored in #sip_content_type_t structure. *//**@ingroup sip_content_type * @typedef typedef struct sip_content_type_s sip_content_type_t; * * The structure #sip_content_type_t contains representation of SIP * @ContentType header. * * The #sip_content_type_t is defined as follows: * @code * typedef struct sip_content_type_s { * sip_common_t c_common[1]; // Common fragment info * sip_unknown_t *c_next; // Dummy link to next * char const *c_type; // Pointer to type/subtype * char const *c_subtype; // Points after first slash in type * msg_param_t const *c_params; // List of parameters * } sip_content_type_t; * @endcode * * The whitespace in the @a c_type is always removed when parsing. */static msg_xtra_f sip_content_type_dup_xtra;static msg_dup_f sip_content_type_dup_one;#define sip_content_type_update NULLmsg_hclass_t sip_content_type_class[] = SIP_HEADER_CLASS(content_type, "Content-Type", "c", c_params, single, content_type);issize_t sip_content_type_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen){ return msg_content_type_d(home, (msg_header_t *)h, s, slen);}issize_t sip_content_type_e(char b[], isize_t bsiz, sip_header_t const *h, int flags){ return msg_content_type_e(b, bsiz, (msg_header_t const *)h, flags);}staticisize_t sip_content_type_dup_xtra(sip_header_t const *h, isize_t offset){ return msg_content_type_dup_xtra((msg_header_t *)h, offset);}/** Duplicate one #sip_content_type_t object */ staticchar *sip_content_type_dup_one(sip_header_t *dst, sip_header_t const *src, char *b, isize_t xtra){ return msg_content_type_dup_one((msg_header_t *)dst, (msg_header_t const *)src, b, xtra);}/* ====================================================================== *//**@SIP_HEADER sip_mime_version MIME-Version Header * * MIME-Version header indicates what version of the MIME protocol was used * to construct the message. Its syntax is defined in [H19.4.1, S10.28] * as follows: * * @code * MIME-Version = "MIME-Version" HCOLON 1*DIGIT "." 1*DIGIT * @endcode * * The parsed MIME-Version header is stored in #sip_mime_version_t structure. *//**@ingroup sip_mime_version * @typedef struct msg_generic_s sip_mime_version_t; * * The structure #sip_mime_version_t contains representation of an * @MIMEVersion header. * * The #sip_mime_version_t is defined as follows: * @code * typedef struct msg_generic_s * { * msg_common_t g_common[1]; // Common fragment info * msg_generic_t *g_next; // Link to next header * char const *g_string; // Header value * } sip_mime_version_t; * @endcode */msg_hclass_t sip_mime_version_class[] = SIP_HEADER_CLASS_G(mime_version, "MIME-Version", "", single);issize_t sip_mime_version_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen){ return sip_generic_d(home, h, s, slen);}issize_t sip_mime_version_e(char b[], isize_t bsiz, sip_header_t const *h, int f){ return sip_generic_e(b, bsiz, h, f);}/* ====================================================================== *//**@SIP_HEADER sip_warning Warning Header * * The Warning response-header field is used to carry additional information * about the status of a response. Its syntax is defined in @RFC3261 as * follows: * * @code * Warning = "Warning" HCOLON warning-value *(COMMA warning-value) * warning-value = warn-code SP warn-agent SP warn-text * warn-code = 3DIGIT * warn-agent = hostport / pseudonym * ; the name or pseudonym of the server adding * ; the Warning header, for use in debugging * warn-text = quoted-string * pseudonym = token * @endcode * * The parsed Warning header is stored in #sip_warning_t structure. *//**@ingroup sip_warning * @typedef struct msg_warning_s sip_warning_t; * * The structure #sip_warning_t contains representation of an * @Warning header. * * The #sip_warning_t is defined as follows: * @code * typedef struct msg_warning_s * { * msg_common_t w_common[1]; // Common fragment info * msg_warning_t *w_next; // Link to next @Warning header * unsigned w_code; // Warning code * char const *w_host; // Hostname or pseudonym * char const *w_port; // Port number * char const *w_text; // Warning text * } sip_warning_t; * @endcode */#define sip_warning_dup_xtra msg_warning_dup_xtra#define sip_warning_dup_one msg_warning_dup_one#define sip_warning_update NULLmsg_hclass_t sip_warning_class[] = SIP_HEADER_CLASS(warning, "Warning", "", w_common, append, warning);issize_t sip_warning_d(su_home_t *home, sip_header_t *h, char *s, isize_t slen){ return msg_warning_d(home, h, s, slen);}issize_t sip_warning_e(char b[], isize_t bsiz, sip_header_t const *h, int f){ return msg_warning_e(b, bsiz, h, f);}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -