msg
1.12.11devel
Main Page
Related Pages
Modules
Data Structures
Files
File List
Globals
All
Data Structures
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Macros
Groups
Pages
libsofia-sip-ua
msg
sofia-sip
msg_types.h
Go to the documentation of this file.
1
/*
2
* This file is part of the Sofia-SIP package
3
*
4
* Copyright (C) 2005 Nokia Corporation.
5
*
6
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
7
*
8
* This library is free software; you can redistribute it and/or
9
* modify it under the terms of the GNU Lesser General Public License
10
* as published by the Free Software Foundation; either version 2.1 of
11
* the License, or (at your option) any later version.
12
*
13
* This library is distributed in the hope that it will be useful, but
14
* WITHOUT ANY WARRANTY; without even the implied warranty of
15
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16
* Lesser General Public License for more details.
17
*
18
* You should have received a copy of the GNU Lesser General Public
19
* License along with this library; if not, write to the Free Software
20
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
21
* 02110-1301 USA
22
*
23
*/
24
25
#ifndef MSG_TYPES_H
26
27
#define MSG_TYPES_H
28
38
#ifndef SU_TYPES_H
39
#include <
sofia-sip/su_types.h
>
40
#endif
41
42
SOFIA_BEGIN_DECLS
43
45
typedef
struct
msg_mclass_s
msg_mclass_t
;
46
48
typedef
struct
msg_hclass_s
const
msg_hclass_t
;
49
51
typedef
struct
msg_href_s
msg_href_t
;
52
54
typedef
struct
msg_s
msg_t
;
55
56
#ifndef MSG_TIME_T_DEFINED
57
#define MSG_TIME_T_DEFINED
58
59
typedef
unsigned
long
msg_time_t
;
60
#endif
61
62
#ifndef MSG_TIME_MAX
63
64
#define MSG_TIME_MAX ((msg_time_t)ULONG_MAX)
65
#endif
66
67
#ifndef MSG_PUB_T
68
#ifdef MSG_OBJ_T
69
#define MSG_PUB_T MSG_OBJ_T
70
#else
71
#define MSG_PUB_T struct msg_pub_s
72
#endif
73
#endif
74
81
typedef
MSG_PUB_T
msg_pub_t
;
82
83
#ifndef MSG_HDR_T
84
#define MSG_HDR_T union msg_header_u
85
#endif
86
87
typedef
MSG_HDR_T
msg_header_t
;
88
89
typedef
struct
msg_common_s
msg_common_t
;
90
91
typedef
struct
msg_separator_s
msg_separator_t
;
92
typedef
struct
msg_payload_s
msg_payload_t
;
93
typedef
struct
msg_unknown_s
msg_unknown_t
;
94
typedef
struct
msg_error_s
msg_error_t
;
95
96
typedef
msg_common_t
msg_frg_t
;
97
98
typedef
char
const
*msg_param_t;
99
typedef
struct
msg_numeric_s
msg_numeric_t
;
100
typedef
struct
msg_generic_s
msg_generic_t
;
101
typedef
struct
msg_list_s
msg_list_t
;
102
typedef
struct
msg_auth_s
msg_auth_t
;
103
typedef
struct
msg_auth_info_s
msg_auth_info_t
;
104
105
#define MSG_HEADER_N 16377
106
111
struct
msg_common_s
{
112
msg_header_t
*
h_succ
;
113
msg_header_t
**
h_prev
;
114
msg_hclass_t
*
h_class
;
115
void
const
*
h_data
;
116
usize_t
h_len
;
117
};
118
119
121
struct
msg_pub_s
{
122
msg_common_t
msg_common
[1];
123
msg_pub_t
*msg_next;
124
void
*msg_user;
125
unsigned
msg_size;
126
unsigned
msg_flags;
127
msg_error_t
*msg_error;
128
msg_header_t
*msg_request;
129
msg_header_t
*msg_status;
130
msg_header_t
*msg_headers[MSG_HEADER_N];
131
};
132
133
#define msg_ident msg_common->h_class
134
140
struct
msg_numeric_s
{
141
msg_common_t
x_common
[1];
142
msg_numeric_t
*
x_next
;
143
unsigned
long
x_value
;
144
};
145
151
struct
msg_generic_s
{
152
msg_common_t
g_common
[1];
153
msg_generic_t
*
g_next
;
154
char
const
*
g_string
;
155
};
156
161
struct
msg_list_s
{
162
msg_common_t
k_common
[1];
163
msg_list_t
*
k_next
;
164
msg_param_t *
k_items
;
165
};
166
172
struct
msg_auth_s
{
173
msg_common_t
au_common
[1];
174
msg_auth_t
*
au_next
;
175
char
const
*
au_scheme
;
176
msg_param_t
const
*
au_params
;
177
};
178
183
struct
msg_auth_info_s
184
{
185
msg_common_t
ai_common
[1];
186
msg_error_t
*
ai_next
;
187
msg_param_t
const
*
ai_params
;
188
};
189
191
struct
msg_unknown_s
{
192
msg_common_t
un_common
[1];
193
msg_unknown_t
*
un_next
;
194
char
const
*
un_name
;
195
char
const
*
un_value
;
196
};
197
199
struct
msg_error_s
{
200
msg_common_t
er_common
[1];
201
msg_error_t
*
er_next
;
202
char
const
*
er_name
;
203
};
204
205
207
struct
msg_separator_s
{
208
msg_common_t
sep_common
[1];
209
msg_error_t
*
sep_next
;
210
char
sep_data
[4];
211
};
212
214
struct
msg_payload_s
{
215
msg_common_t
pl_common
[1];
216
msg_payload_t
*
pl_next
;
217
char
*
pl_data
;
218
usize_t
pl_len
;
219
};
220
222
union
msg_header_u
{
223
msg_common_t
sh_common
[1];
224
struct
{
225
msg_common_t
shn_common;
226
msg_header_t
*shn_next;
227
} sh_header_next[1];
228
#define sh_next sh_header_next->shn_next
229
#define sh_class sh_common->h_class
230
#define sh_succ sh_common->h_succ
231
#define sh_prev sh_common->h_prev
232
#define sh_data sh_common->h_data
233
#define sh_len sh_common->h_len
234
235
msg_generic_t
sh_generic[1];
236
msg_numeric_t
sh_numeric[1];
237
msg_list_t
sh_list[1];
238
msg_auth_t
sh_auth[1];
239
msg_separator_t
sh_separator[1];
240
msg_payload_t
sh_payload[1];
241
msg_unknown_t
sh_unknown[1];
242
msg_error_t
sh_error[1];
243
};
244
245
/* ====================================================================== */
246
250
typedef
enum
{
251
msg_kind_single
,
252
msg_kind_append
,
253
msg_kind_list
,
255
msg_kind_apndlist
,
256
msg_kind_prepend
257
}
msg_header_kind_t
;
258
259
struct
su_home_s
;
260
261
typedef
issize_t msg_parse_f(
struct
su_home_s
*,
msg_header_t
*,
char
*, isize_t);
262
typedef
issize_t msg_print_f(
char
buf[], isize_t bufsiz,
263
msg_header_t
const
*,
int
flags);
264
typedef
char
*msg_dup_f(
msg_header_t
*dst,
msg_header_t
const
*src,
265
char
*buf, isize_t bufsiz);
266
typedef
isize_t msg_xtra_f(
msg_header_t
const
*h, isize_t offset);
267
268
typedef
int
msg_update_f(
msg_common_t
*,
char
const
*name, isize_t namelen,
269
char
const
*value);
270
278
struct
msg_hclass_s
279
{
280
/* XXX size of header class missing. Someone has saved bits in wrong place. */
281
int
hc_hash
;
282
msg_parse_f *
hc_parse
;
283
msg_print_f *
hc_print
;
284
msg_xtra_f *
hc_dxtra
;
285
msg_dup_f *
hc_dup_one
;
286
msg_update_f *
hc_update
;
287
char
const
*
hc_name
;
288
short
hc_len
;
289
char
hc_short
[2];
290
unsigned
char
hc_size
;
291
unsigned
char
hc_params
;
292
unsigned
hc_kind
:3;
294
unsigned
hc_critical
:1;
295
unsigned
/*pad*/
:0;
296
};
297
298
#define HC_LEN_MAX SHRT_MAX
299
300
SOFIA_END_DECLS
301
302
#endif
/* !defined MSG_TYPES_H */
Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.