parse_content.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029 #ifndef _PARSE_CONTENT_H
00030 #define _PARSE_CONTENT_H
00031
00032 #include "msg_parser.h"
00033
00034
00035 struct mime_type {
00036 unsigned short type;
00037 unsigned short subtype;
00038 };
00039
00040
00041
00042
00043
00044
00045 #define TYPE_TEXT 1
00046 #define TYPE_MESSAGE 2
00047 #define TYPE_APPLICATION 3
00048 #define TYPE_MULTIPART 4
00049 #define TYPE_ALL 0xfe
00050 #define TYPE_UNKNOWN 0xff
00051
00052 #define SUBTYPE_PLAIN 1
00053 #define SUBTYPE_CPIM 2
00054 #define SUBTYPE_SDP 3
00055 #define SUBTYPE_CPLXML 4
00056 #define SUBTYPE_PIDFXML 5
00057 #define SUBTYPE_RLMIXML 6
00058 #define SUBTYPE_RELATED 7
00059 #define SUBTYPE_LPIDFXML 8
00060 #define SUBTYPE_XPIDFXML 9
00061 #define SUBTYPE_WATCHERINFOXML 10
00062 #define SUBTYPE_EXTERNAL_BODY 11
00063 #define SUBTYPE_XML_MSRTC_PIDF 12
00064 #define SUBTYPE_SMS 13
00065 #define SUBTYPE_MIXED 14
00066 #define SUBTYPE_ALL 0xfe
00067 #define SUBTYPE_UNKNOWN 0xff
00068
00069
00070
00071
00072
00073 #define MAX_MIMES_NR 128
00074
00075
00076
00077
00078 #define get_content_length(_msg_) ((long)((_msg_)->content_length->parsed))
00079
00080
00081
00082
00083
00084 #define get_content_type(_msg_) ((int)(long)((_msg_)->content_type->parsed))
00085
00086
00087
00088
00089
00090
00091 #define get_accept(_msg_) ((int*)((_msg_)->accept->parsed))
00092
00093
00094
00095
00096
00097
00098
00099
00100 int parse_content_type_hdr( struct sip_msg *msg);
00101
00102
00103
00104
00105
00106
00107 int parse_accept_hdr( struct sip_msg *msg );
00108
00109
00110
00111
00112
00113
00114
00115 char* parse_content_length( char* buffer, char* end, int* len);
00116
00117
00118
00119
00120
00121 char* decode_mime_type(char *start, char *end, unsigned int *mime_type);
00122
00123 #endif