parse_supported.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
00030
00031
00032
00033
00034
00035 #ifndef PARSE_SUPPORTED_H
00036 #define PARSE_SUPPORTED_H
00037
00038 #include "msg_parser.h"
00039 #include "../mem/mem.h"
00040
00041
00042 #define F_SUPPORTED_PATH (1 << 0)
00043 #define F_SUPPORTED_100REL (1 << 1)
00044 #define F_SUPPORTED_TIMER (1 << 2)
00045
00046 #define SUPPORTED_PATH_STR "path"
00047 #define SUPPORTED_PATH_LEN (sizeof(SUPPORTED_PATH_STR)-1)
00048
00049
00050 #define SUPPORTED_100REL_STR "100rel"
00051 #define SUPPORTED_100REL_LEN (sizeof(SUPPORTED_100REL_STR)-1)
00052
00053
00054 #define SUPPORTED_TIMER_STR "timer"
00055 #define SUPPORTED_TIMER_LEN (sizeof(SUPPORTED_TIMER_STR)-1)
00056
00057
00058 #define get_supported(p_msg) \
00059 ((p_msg)->supported ? ((struct supported_body*)(p_msg)->supported->parsed)->supported_all : 0)
00060
00061
00062 struct supported_body {
00063 unsigned int supported;
00064 unsigned int supported_all;
00065
00066
00067 };
00068
00069
00070
00071
00072
00073 int parse_supported( struct sip_msg *msg);
00074
00075
00076 static inline void free_supported(struct supported_body **sb)
00077 {
00078 if (sb && *sb) {
00079 pkg_free(*sb);
00080 *sb = 0;
00081 }
00082 }
00083
00084 #endif