Loading...
Searching...
No Matches
msg_types.h
Go to the documentation of this file.
/*
* This file is part of the Sofia-SIP package
*
* Copyright (C) 2005 Nokia Corporation.
*
* Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* as published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This library is distributed in the hope that it will be useful, but
* WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this library; if not, write to the Free Software
* Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
* 02110-1301 USA
*
*/
#ifndef MSG_TYPES_H
#define MSG_TYPES_H
#ifndef SU_TYPES_H
#include <sofia-sip/su_types.h>
#endif
SOFIA_BEGIN_DECLS
typedef struct msg_mclass_s msg_mclass_t;
typedef struct msg_hclass_s const msg_hclass_t;
typedef struct msg_href_s msg_href_t;
typedef struct msg_s msg_t;
#ifndef MSG_TIME_T_DEFINED
#define MSG_TIME_T_DEFINED
typedef unsigned long msg_time_t;
#endif
#ifndef MSG_TIME_MAX
#define MSG_TIME_MAX ((msg_time_t)ULONG_MAX)
#endif
#ifndef MSG_PUB_T
#ifdef MSG_OBJ_T
#define MSG_PUB_T MSG_OBJ_T
#else
#define MSG_PUB_T struct msg_pub_s
#endif
#endif
typedef MSG_PUB_T msg_pub_t;
#ifndef MSG_HDR_T
#define MSG_HDR_T union msg_header_u
#endif
typedef MSG_HDR_T msg_header_t;
typedef struct msg_common_s msg_common_t;
typedef struct msg_separator_s msg_separator_t;
typedef struct msg_payload_s msg_payload_t;
typedef struct msg_unknown_s msg_unknown_t;
typedef struct msg_error_s msg_error_t;
typedef msg_common_t msg_frg_t;
typedef char const *msg_param_t;
typedef struct msg_numeric_s msg_numeric_t;
typedef struct msg_generic_s msg_generic_t;
typedef struct msg_list_s msg_list_t;
typedef struct msg_auth_s msg_auth_t;
typedef struct msg_auth_info_s msg_auth_info_t;
#define MSG_HEADER_N 16377
struct msg_common_s {
msg_header_t *h_succ;
msg_header_t **h_prev;
msg_hclass_t *h_class;
void const *h_data;
usize_t h_len;
};
struct msg_pub_s {
msg_common_t msg_common[1];
msg_pub_t *msg_next;
void *msg_user;
unsigned msg_size;
unsigned msg_flags;
msg_error_t *msg_error;
msg_header_t *msg_request;
msg_header_t *msg_status;
msg_header_t *msg_headers[MSG_HEADER_N];
};
#define msg_ident msg_common->h_class
struct msg_numeric_s {
msg_common_t x_common[1];
msg_numeric_t *x_next;
unsigned long x_value;
};
struct msg_generic_s {
msg_common_t g_common[1];
msg_generic_t *g_next;
char const *g_string;
};
struct msg_list_s {
msg_common_t k_common[1];
msg_list_t *k_next;
msg_param_t *k_items;
};
struct msg_auth_s {
msg_common_t au_common[1];
msg_auth_t *au_next;
char const *au_scheme;
msg_param_t const *au_params;
};
struct msg_auth_info_s
{
msg_common_t ai_common[1];
msg_error_t *ai_next;
msg_param_t const *ai_params;
};
struct msg_unknown_s {
msg_common_t un_common[1];
msg_unknown_t *un_next;
char const *un_name;
char const *un_value;
};
struct msg_error_s {
msg_common_t er_common[1];
msg_error_t *er_next;
char const *er_name;
};
struct msg_separator_s {
msg_common_t sep_common[1];
msg_error_t *sep_next;
char sep_data[4];
};
struct msg_payload_s {
msg_common_t pl_common[1];
msg_payload_t *pl_next;
char *pl_data;
usize_t pl_len;
};
union msg_header_u {
msg_common_t sh_common[1];
struct {
msg_common_t shn_common;
msg_header_t *shn_next;
} sh_header_next[1];
#define sh_next sh_header_next->shn_next
#define sh_class sh_common->h_class
#define sh_succ sh_common->h_succ
#define sh_prev sh_common->h_prev
#define sh_data sh_common->h_data
#define sh_len sh_common->h_len
msg_generic_t sh_generic[1];
msg_numeric_t sh_numeric[1];
msg_list_t sh_list[1];
msg_auth_t sh_auth[1];
msg_separator_t sh_separator[1];
msg_payload_t sh_payload[1];
msg_unknown_t sh_unknown[1];
msg_error_t sh_error[1];
};
/* ====================================================================== */
typedef enum {
msg_kind_single,
msg_kind_append,
msg_kind_list,
msg_kind_apndlist,
msg_kind_prepend
} msg_header_kind_t;
struct su_home_s;
typedef issize_t msg_parse_f(struct su_home_s *, msg_header_t *, char *, isize_t);
typedef issize_t msg_print_f(char buf[], isize_t bufsiz,
msg_header_t const *, int flags);
typedef char *msg_dup_f(msg_header_t *dst, msg_header_t const *src,
char *buf, isize_t bufsiz);
typedef isize_t msg_xtra_f(msg_header_t const *h, isize_t offset);
typedef int msg_update_f(msg_common_t *, char const *name, isize_t namelen,
char const *value);
struct msg_hclass_s
{
/* XXX size of header class missing. Someone has saved bits in wrong place. */
int hc_hash;
msg_parse_f *hc_parse;
msg_print_f *hc_print;
msg_xtra_f *hc_dxtra;
msg_dup_f *hc_dup_one;
msg_update_f *hc_update;
char const *hc_name;
short hc_len;
char hc_short[2];
unsigned char hc_size;
unsigned char hc_params;
unsigned hc_kind:3;
unsigned hc_critical:1;
unsigned /*pad*/:0;
};
#define HC_LEN_MAX SHRT_MAX
SOFIA_END_DECLS
#endif /* !defined MSG_TYPES_H */
msg_error_t
struct msg_error_s msg_error_t
Type for erroneous headers.
Definition msg_types.h:94
msg_payload_t
struct msg_payload_s msg_payload_t
The structure msg_payload_t contains representation of MIME message payload.
Definition msg_types.h:92
msg_separator_t
struct msg_separator_s msg_separator_t
The structure msg_separator_t contains representation of separator line between message headers and b...
Definition msg_types.h:91
msg_unknown_t
struct msg_unknown_s msg_unknown_t
Type for unknown headers.
Definition msg_types.h:93
msg_time_t
unsigned long msg_time_t
Time in seconds since epoch (1900-Jan-01 00:00:00).
Definition msg_date.h:48
msg_hclass_t
struct msg_hclass_s const msg_hclass_t
Header class.
Definition msg_types.h:48
msg_header_t
MSG_HDR_T msg_header_t
Any protocol-specific header object.
Definition msg_types.h:87
msg_list_t
struct msg_list_s msg_list_t
Type for token list headers.
Definition msg_types.h:101
msg_t
struct msg_s msg_t
Message object.
Definition msg_types.h:54
msg_common_t
struct msg_common_s msg_common_t
Common part of header.
Definition msg_types.h:89
msg_header_kind_t
msg_header_kind_t
Define how to handle existing headers when a new header is added to a message.
Definition msg_types.h:250
msg_kind_prepend
@ msg_kind_prepend
New header is prepended.
Definition msg_types.h:256
msg_kind_list
@ msg_kind_list
A token list header, new header is combined with old one.
Definition msg_types.h:253
msg_kind_single
@ msg_kind_single
Only one header is allowed.
Definition msg_types.h:251
msg_kind_append
@ msg_kind_append
New header is appended.
Definition msg_types.h:252
msg_kind_apndlist
@ msg_kind_apndlist
A complex list header.
Definition msg_types.h:255
msg_href_t
struct msg_href_s msg_href_t
Header reference.
Definition msg_types.h:51
msg_pub_t
MSG_PUB_T msg_pub_t
Public protocol-specific message structure for accessing the message.
Definition msg_types.h:81
msg_mclass_t
struct msg_mclass_s msg_mclass_t
Message class.
Definition msg_types.h:45
msg_auth_info_s
Authentication-Info header.
Definition msg_types.h:184
msg_auth_info_s::ai_common
msg_common_t ai_common[1]
Common fragment info.
Definition msg_types.h:185
msg_auth_info_s::ai_next
msg_error_t * ai_next
Dummy link to next.
Definition msg_types.h:186
msg_auth_info_s::ai_params
msg_param_t const * ai_params
List of ainfo.
Definition msg_types.h:187
msg_auth_s
Authentication header.
Definition msg_types.h:172
msg_auth_s::au_scheme
char const * au_scheme
Auth-scheme like Basic or Digest.
Definition msg_types.h:175
msg_auth_s::au_params
msg_param_t const * au_params
Comma-separated parameters.
Definition msg_types.h:176
msg_auth_s::au_next
msg_auth_t * au_next
Link to next header.
Definition msg_types.h:174
msg_auth_s::au_common
msg_common_t au_common[1]
Common fragment info.
Definition msg_types.h:173
msg_common_s
Common part of the header objects (or message fragments).
Definition msg_types.h:111
msg_common_s::h_prev
msg_header_t ** h_prev
Pointer to preceeding fragment.
Definition msg_types.h:113
msg_common_s::h_data
void const * h_data
Fragment data.
Definition msg_types.h:115
msg_common_s::h_len
usize_t h_len
Fragment length (including CRLF).
Definition msg_types.h:116
msg_common_s::h_succ
msg_header_t * h_succ
Pointer to succeeding fragment.
Definition msg_types.h:112
msg_common_s::h_class
msg_hclass_t * h_class
Header class.
Definition msg_types.h:114
msg_error_s
Erroneus header.
Definition msg_types.h:199
msg_error_s::er_name
char const * er_name
Name of bad header (if any).
Definition msg_types.h:202
msg_error_s::er_common
msg_common_t er_common[1]
Common fragment info.
Definition msg_types.h:200
msg_error_s::er_next
msg_error_t * er_next
Link to next header.
Definition msg_types.h:201
msg_generic_s
Generic header.
Definition msg_types.h:151
msg_generic_s::g_common
msg_common_t g_common[1]
Common fragment info.
Definition msg_types.h:152
msg_generic_s::g_string
char const * g_string
Header value.
Definition msg_types.h:154
msg_generic_s::g_next
msg_generic_t * g_next
Link to next header.
Definition msg_types.h:153
msg_hclass_s
Factory object for a header.
Definition msg_types.h:279
msg_hclass_s::hc_parse
msg_parse_f * hc_parse
Parse header.
Definition msg_types.h:282
msg_hclass_s::hc_print
msg_print_f * hc_print
Print header.
Definition msg_types.h:283
msg_hclass_s::hc_size
unsigned char hc_size
Size of header structure.
Definition msg_types.h:290
msg_hclass_s::hc_dxtra
msg_xtra_f * hc_dxtra
Calculate extra size for dup.
Definition msg_types.h:284
msg_hclass_s::hc_critical
unsigned hc_critical
True if header is critical.
Definition msg_types.h:294
msg_hclass_s::hc_hash
int hc_hash
Header name hash or ID.
Definition msg_types.h:281
msg_hclass_s::hc_name
char const * hc_name
Full name.
Definition msg_types.h:287
msg_hclass_s::hc_update
msg_update_f * hc_update
Update parameter(s).
Definition msg_types.h:286
msg_hclass_s::hc_dup_one
msg_dup_f * hc_dup_one
Duplicate one header.
Definition msg_types.h:285
msg_hclass_s::hc_params
unsigned char hc_params
Offset of parameter list.
Definition msg_types.h:291
msg_hclass_s::hc_len
short hc_len
Length of hc_name.
Definition msg_types.h:288
msg_hclass_s::hc_kind
unsigned hc_kind
Kind of header (msg_header_kind_t): single, append, list, apndlist, prepend.
Definition msg_types.h:292
msg_hclass_s::hc_short
char hc_short[2]
Short name, if any.
Definition msg_types.h:289
msg_href_s
Header reference.
Definition msg_mclass.h:63
msg_list_s
List header.
Definition msg_types.h:161
msg_list_s::k_common
msg_common_t k_common[1]
Common fragment info.
Definition msg_types.h:162
msg_list_s::k_next
msg_list_t * k_next
Link to next header.
Definition msg_types.h:163
msg_list_s::k_items
msg_param_t * k_items
List of items.
Definition msg_types.h:164
msg_mclass_s
Factory object for protocol messages.
Definition msg_mclass.h:97
msg_numeric_s
Numeric header.
Definition msg_types.h:140
msg_numeric_s::x_next
msg_numeric_t * x_next
Link to next header.
Definition msg_types.h:142
msg_numeric_s::x_common
msg_common_t x_common[1]
Common fragment info.
Definition msg_types.h:141
msg_numeric_s::x_value
unsigned long x_value
Numeric header value.
Definition msg_types.h:143
msg_payload_s
Message payload.
Definition msg_types.h:214
msg_payload_s::pl_next
msg_payload_t * pl_next
Next payload chunk.
Definition msg_types.h:216
msg_payload_s::pl_len
usize_t pl_len
Length of message payload.
Definition msg_types.h:218
msg_payload_s::pl_data
char * pl_data
Data - may contain NUL.
Definition msg_types.h:217
msg_payload_s::pl_common
msg_common_t pl_common[1]
Common fragment info.
Definition msg_types.h:215
msg_pub_s
Message object, common view.
Definition msg_types.h:121
msg_pub_s::msg_common
msg_common_t msg_common[1]
Recursive.
Definition msg_types.h:122
msg_s
Message object.
Definition msg_internal.h:59
msg_separator_s
Separator.
Definition msg_types.h:207
msg_separator_s::sep_next
msg_error_t * sep_next
Dummy link to next header.
Definition msg_types.h:209
msg_separator_s::sep_common
msg_common_t sep_common[1]
Common fragment info.
Definition msg_types.h:208
msg_separator_s::sep_data
char sep_data[4]
NUL-terminated separator.
Definition msg_types.h:210
msg_unknown_s
Unknown header.
Definition msg_types.h:191
msg_unknown_s::un_common
msg_common_t un_common[1]
Common fragment info.
Definition msg_types.h:192
msg_unknown_s::un_next
msg_unknown_t * un_next
Link to next unknown header.
Definition msg_types.h:193
msg_unknown_s::un_name
char const * un_name
Header name.
Definition msg_types.h:194
msg_unknown_s::un_value
char const * un_value
Header field value.
Definition msg_types.h:195
su_home_s
su_types.h
msg_header_u
Any header.
Definition msg_types.h:222
msg_header_u::sh_common
msg_common_t sh_common[1]
Common fragment info.
Definition msg_types.h:223

Sofia-SIP 1.12.11devel - Copyright (C) 2006 Nokia Corporation. All rights reserved. Licensed under the terms of the GNU Lesser General Public License.