Loading...
Searching...
No Matches
msg_mclass.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_MCLASS_H
#define MSG_MCLASS_H
#ifndef MSG_HEADER_H
#include <sofia-sip/msg_header.h>
#endif
SOFIA_BEGIN_DECLS
enum {
MC_HASH_SIZE = 127,
MC_SHORT_SIZE = 'Z' - 'A' + 1
};
struct msg_href_s
{
msg_hclass_t *hr_class;
unsigned short hr_offset;
unsigned short hr_flags;
};
struct msg_mclass_s
{
struct msg_hclass_s
mc_hclass[1];
char const *mc_name;
void *mc_tag;
unsigned mc_flags;
unsigned mc_msize;
issize_t (*mc_extract_body)(msg_t *msg, msg_pub_t *pub,
char b[], isize_t bsiz, int eos);
msg_href_t mc_request[1];
msg_href_t mc_status[1];
msg_href_t mc_separator[1];
msg_href_t mc_payload[1];
msg_href_t mc_unknown[1];
msg_href_t mc_error[1];
msg_href_t mc_multipart[1];
msg_href_t const *
mc_short;
short mc_hash_size;
short mc_hash_used;
msg_href_t mc_hash[MC_HASH_SIZE];
};
enum { msg_mclass_copy = 0, msg_mclass_empty = 1 };
SOFIAPUBFUN msg_mclass_t *msg_mclass_clone(msg_mclass_t const *old,
int newsize, int empty);
SOFIAPUBFUN int msg_mclass_insert(msg_mclass_t *mc, msg_href_t const *hr);
SOFIAPUBFUN
int msg_mclass_insert_header(msg_mclass_t *mc,
msg_hclass_t *hc,
unsigned short offset);
SOFIAPUBFUN
int msg_mclass_insert_with_mask(msg_mclass_t *mc,
msg_hclass_t *hc,
unsigned short offset,
unsigned short mask);
SOFIAPUBFUN
msg_href_t const *msg_find_hclass(msg_mclass_t const *, char const *, isize_t *);
SOFIAPUBFUN msg_mclass_t const *msg_mclass(msg_t const *);
SOFIA_END_DECLS
#endif /* !defined(MSG_MCLASS_H) */
msg_mclass_clone
msg_mclass_t * msg_mclass_clone(msg_mclass_t const *old, int newsize, int empty)
Clone a message class.
Definition msg_mclass.c:91
msg_header.h
Message headers.
msg_mclass_insert
int msg_mclass_insert(msg_mclass_t *mc, msg_href_t const *hr)
Add a header reference to the message class.
Definition msg_mclass.c:223
msg_find_hclass
msg_href_t const * msg_find_hclass(msg_mclass_t const *, char const *, isize_t *)
Search for a header class.
Definition msg_mclass.c:298
msg_mclass_insert_with_mask
int msg_mclass_insert_with_mask(msg_mclass_t *mc, msg_hclass_t *hc, unsigned short offset, unsigned short mask)
Add a new header to the message class.
Definition msg_mclass.c:187
MC_HASH_SIZE
@ MC_HASH_SIZE
Default size of hash table.
Definition msg_mclass.h:46
MC_SHORT_SIZE
@ MC_SHORT_SIZE
Size of short form table.
Definition msg_mclass.h:48
msg_mclass_insert_header
int msg_mclass_insert_header(msg_mclass_t *mc, msg_hclass_t *hc, unsigned short offset)
Add a new header to the message class.
Definition msg_mclass.c:163
msg_mclass
msg_mclass_t const * msg_mclass(msg_t const *)
Retrieve message class.
Definition msg.c:251
msg_hclass_t
struct msg_hclass_s const msg_hclass_t
Header class.
Definition msg_types.h:48
msg_t
struct msg_s msg_t
Message object.
Definition msg_types.h:54
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_hclass_s
Factory object for a header.
Definition msg_types.h:279
msg_href_s
Header reference.
Definition msg_mclass.h:63
msg_href_s::hr_class
msg_hclass_t * hr_class
Header class.
Definition msg_mclass.h:64
msg_href_s::hr_offset
unsigned short hr_offset
Offset within public message struct.
Definition msg_mclass.h:65
msg_href_s::hr_flags
unsigned short hr_flags
Header flags.
Definition msg_mclass.h:66
msg_mclass_s
Factory object for protocol messages.
Definition msg_mclass.h:97
msg_mclass_s::mc_request
msg_href_t mc_request[1]
Request line reference.
Definition msg_mclass.h:108
msg_mclass_s::mc_separator
msg_href_t mc_separator[1]
Separator line reference.
Definition msg_mclass.h:110
msg_mclass_s::mc_hclass
struct msg_hclass_s mc_hclass[1]
Recursive header class.
Definition msg_mclass.h:98
msg_mclass_s::mc_hash_used
short mc_hash_used
Number of headers in parsing table.
Definition msg_mclass.h:118
msg_mclass_s::mc_short
msg_href_t const * mc_short
Short forms (or NULL).
Definition msg_mclass.h:116
msg_mclass_s::mc_extract_body
issize_t(* mc_extract_body)(msg_t *msg, msg_pub_t *pub, char b[], isize_t bsiz, int eos)
Function extracting the message contents.
Definition msg_mclass.h:105
msg_mclass_s::mc_hash
msg_href_t mc_hash[MC_HASH_SIZE]
Hash table for parsing containing reference for each header.
Definition msg_mclass.h:120
msg_mclass_s::mc_status
msg_href_t mc_status[1]
Status line reference.
Definition msg_mclass.h:109
msg_mclass_s::mc_error
msg_href_t mc_error[1]
Reference for erroneous header.
Definition msg_mclass.h:113
msg_mclass_s::mc_flags
unsigned mc_flags
Default flags.
Definition msg_mclass.h:102
msg_mclass_s::mc_name
char const * mc_name
Protocol name, e.g., "SIP/2.0".
Definition msg_mclass.h:100
msg_mclass_s::mc_payload
msg_href_t mc_payload[1]
Message body reference.
Definition msg_mclass.h:111
msg_mclass_s::mc_multipart
msg_href_t mc_multipart[1]
Multipart body reference.
Definition msg_mclass.h:114
msg_mclass_s::mc_hash_size
short mc_hash_size
Size of parsing table.
Definition msg_mclass.h:117
msg_mclass_s::mc_tag
void * mc_tag
Protocol-specific tag.
Definition msg_mclass.h:101
msg_mclass_s::mc_unknown
msg_href_t mc_unknown[1]
Reference for unknown headers.
Definition msg_mclass.h:112
msg_mclass_s::mc_msize
unsigned mc_msize
Size of public message structure.
Definition msg_mclass.h:103
SOFIAPUBFUN
#define SOFIAPUBFUN

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