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 #ifndef MSG_TYPES_H
00026
00027 #define MSG_TYPES_H
00028
00038 #ifndef SU_TYPES_H
00039 #include <sofia-sip/su_types.h>
00040 #endif
00041
00042 SOFIA_BEGIN_DECLS
00043
00045 typedef struct msg_mclass_s msg_mclass_t;
00046
00048 typedef struct msg_hclass_s const msg_hclass_t;
00049
00051 typedef struct msg_href_s msg_href_t;
00052
00054 typedef struct msg_s msg_t;
00055
00056 #ifndef MSG_TIME_T_DEFINED
00057 #define MSG_TIME_T_DEFINED
00058
00059 typedef unsigned long msg_time_t;
00060 #endif
00061
00062 #ifndef MSG_TIME_MAX
00063
00064 #define MSG_TIME_MAX ((msg_time_t)ULONG_MAX)
00065 #endif
00066
00067 #ifndef MSG_PUB_T
00068 #ifdef MSG_OBJ_T
00069 #define MSG_PUB_T MSG_OBJ_T
00070 #else
00071 #define MSG_PUB_T struct msg_pub_s
00072 #endif
00073 #endif
00074
00081 typedef MSG_PUB_T msg_pub_t;
00082
00083 #ifndef MSG_HDR_T
00084 #define MSG_HDR_T union msg_header_u
00085 #endif
00086
00087 typedef MSG_HDR_T msg_header_t;
00088
00089 typedef struct msg_common_s msg_common_t;
00090
00091 typedef struct msg_separator_s msg_separator_t;
00092 typedef struct msg_payload_s msg_payload_t;
00093 typedef struct msg_unknown_s msg_unknown_t;
00094 typedef struct msg_error_s msg_error_t;
00095
00096 typedef msg_common_t msg_frg_t;
00097
00098 typedef char const *msg_param_t;
00099 typedef struct msg_numeric_s msg_numeric_t;
00100 typedef struct msg_generic_s msg_generic_t;
00101 typedef struct msg_list_s msg_list_t;
00102 typedef struct msg_auth_s msg_auth_t;
00103 typedef struct msg_auth_info_s msg_auth_info_t;
00104
00105 #define MSG_HEADER_N 16377
00106
00111 struct msg_common_s {
00112 msg_header_t *h_succ;
00113 msg_header_t **h_prev;
00114 msg_hclass_t *h_class;
00115 void const *h_data;
00116 usize_t h_len;
00117 };
00118
00119
00121 struct msg_pub_s {
00122 msg_common_t msg_common[1];
00123 msg_pub_t *msg_next;
00124 void *msg_user;
00125 unsigned msg_size;
00126 unsigned msg_flags;
00127 msg_error_t *msg_error;
00128 msg_header_t *msg_request;
00129 msg_header_t *msg_status;
00130 msg_header_t *msg_headers[MSG_HEADER_N];
00131 };
00132
00133 #define msg_ident msg_common->h_class
00134
00140 struct msg_numeric_s {
00141 msg_common_t x_common[1];
00142 msg_numeric_t *x_next;
00143 unsigned long x_value;
00144 };
00145
00151 struct msg_generic_s {
00152 msg_common_t g_common[1];
00153 msg_generic_t *g_next;
00154 char const *g_string;
00155 };
00156
00161 struct msg_list_s {
00162 msg_common_t k_common[1];
00163 msg_list_t *k_next;
00164 msg_param_t *k_items;
00165 };
00166
00172 struct msg_auth_s {
00173 msg_common_t au_common[1];
00174 msg_auth_t *au_next;
00175 char const *au_scheme;
00176 msg_param_t const *au_params;
00177 };
00178
00183 struct msg_auth_info_s
00184 {
00185 msg_common_t ai_common[1];
00186 msg_error_t *ai_next;
00187 msg_param_t const *ai_params;
00188 };
00189
00191 struct msg_unknown_s {
00192 msg_common_t un_common[1];
00193 msg_unknown_t *un_next;
00194 char const *un_name;
00195 char const *un_value;
00196 };
00197
00199 struct msg_error_s {
00200 msg_common_t er_common[1];
00201 msg_error_t *er_next;
00202 char const *er_name;
00203 };
00204
00205
00207 struct msg_separator_s {
00208 msg_common_t sep_common[1];
00209 msg_error_t *sep_next;
00210 char sep_data[4];
00211 };
00212
00214 struct msg_payload_s {
00215 msg_common_t pl_common[1];
00216 msg_payload_t *pl_next;
00217 char *pl_data;
00218 usize_t pl_len;
00219 };
00220
00222 union msg_header_u {
00223 msg_common_t sh_common[1];
00224 struct {
00225 msg_common_t shn_common;
00226 msg_header_t *shn_next;
00227 } sh_header_next[1];
00228 #define sh_next sh_header_next->shn_next
00229 #define sh_class sh_common->h_class
00230 #define sh_succ sh_common->h_succ
00231 #define sh_prev sh_common->h_prev
00232 #define sh_data sh_common->h_data
00233 #define sh_len sh_common->h_len
00234
00235 msg_generic_t sh_generic[1];
00236 msg_numeric_t sh_numeric[1];
00237 msg_list_t sh_list[1];
00238 msg_auth_t sh_auth[1];
00239 msg_separator_t sh_separator[1];
00240 msg_payload_t sh_payload[1];
00241 msg_unknown_t sh_unknown[1];
00242 msg_error_t sh_error[1];
00243 };
00244
00245
00246
00250 typedef enum {
00251 msg_kind_single,
00252 msg_kind_append,
00253 msg_kind_list,
00255 msg_kind_apndlist,
00256 msg_kind_prepend
00257 } msg_header_kind_t;
00258
00259 struct su_home_s;
00260
00261 typedef issize_t msg_parse_f(struct su_home_s *, msg_header_t *, char *, isize_t);
00262 typedef issize_t msg_print_f(char buf[], isize_t bufsiz,
00263 msg_header_t const *, int flags);
00264 typedef char *msg_dup_f(msg_header_t *dst, msg_header_t const *src,
00265 char *buf, isize_t bufsiz);
00266 typedef isize_t msg_xtra_f(msg_header_t const *h, isize_t offset);
00267
00268 typedef int msg_update_f(msg_common_t *, char const *name, isize_t namelen,
00269 char const *value);
00270
00278 struct msg_hclass_s
00279 {
00280
00281 int hc_hash;
00282 msg_parse_f *hc_parse;
00283 msg_print_f *hc_print;
00284 msg_xtra_f *hc_dxtra;
00285 msg_dup_f *hc_dup_one;
00286 msg_update_f *hc_update;
00287 char const *hc_name;
00288 short hc_len;
00289 char hc_short[2];
00290 unsigned char hc_size;
00291 unsigned char hc_params;
00292 unsigned hc_kind:3;
00294 unsigned hc_critical:1;
00295 unsigned :0;
00296 };
00297
00298 #define HC_LEN_MAX SHRT_MAX
00299
00300 SOFIA_END_DECLS
00301
00302 #endif