sofia-sip/msg_mclass.h

Go to the documentation of this file.
00001 /*
00002  * This file is part of the Sofia-SIP package
00003  *
00004  * Copyright (C) 2005 Nokia Corporation.
00005  *
00006  * Contact: Pekka Pessi <pekka.pessi@nokia-email.address.hidden>
00007  *
00008  * This library is free software; you can redistribute it and/or
00009  * modify it under the terms of the GNU Lesser General Public License
00010  * as published by the Free Software Foundation; either version 2.1 of
00011  * the License, or (at your option) any later version.
00012  *
00013  * This library is distributed in the hope that it will be useful, but
00014  * WITHOUT ANY WARRANTY; without even the implied warranty of
00015  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
00016  * Lesser General Public License for more details.
00017  *
00018  * You should have received a copy of the GNU Lesser General Public
00019  * License along with this library; if not, write to the Free Software
00020  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
00021  * 02110-1301 USA
00022  *
00023  */
00024 
00025 #ifndef MSG_MCLASS_H
00026 
00027 #define MSG_MCLASS_H
00028 
00038 #ifndef MSG_HEADER_H
00039 #include <sofia-sip/msg_header.h>
00040 #endif
00041 
00042 SOFIA_BEGIN_DECLS
00043 
00044 enum { 
00046   MC_HASH_SIZE = 127, 
00048   MC_SHORT_SIZE = 'Z' - 'A' + 1 
00049 };
00050 
00062 struct msg_href_s
00063 {
00064   msg_hclass_t  *hr_class;      
00065   unsigned short hr_offset;     
00066   unsigned short hr_flags;      
00067 };
00068 
00092 struct msg_mclass_s
00093 {
00094   struct msg_hclass_s
00095                 mc_hclass[1];   
00096   char const   *mc_name;        
00097   void         *mc_tag;         
00098   unsigned      mc_flags;       
00099   int           mc_msize;       
00101   int         (*mc_extract_body)(msg_t *msg, msg_pub_t *pub, 
00102                                  char b[], int bsiz, int eos);
00103 
00104   msg_href_t    mc_request[1];  
00105   msg_href_t    mc_status[1];   
00106   msg_href_t    mc_separator[1];
00107   msg_href_t    mc_payload[1];  
00108   msg_href_t    mc_unknown[1];  
00109   msg_href_t    mc_error[1];    
00110   msg_href_t    mc_multipart[1];
00111   msg_href_t const *
00112                 mc_short;       
00113   short         mc_hash_size;   
00114   short         mc_hash_used;   
00116   msg_href_t    mc_hash[MC_HASH_SIZE]; 
00117 };
00118 
00119 enum { msg_mclass_copy = 0, msg_mclass_empty = 1 };
00120 
00121 SOFIAPUBFUN msg_mclass_t *msg_mclass_clone(msg_mclass_t const *old,
00122                                            int newsize, int empty);
00123 
00124 SOFIAPUBFUN int msg_mclass_insert(msg_mclass_t *mc, msg_href_t const *hr);
00125 
00126 SOFIAPUBFUN
00127 int msg_mclass_insert_header(msg_mclass_t *mc, 
00128                              msg_hclass_t *hc,
00129                              unsigned short offset);
00130 
00131 SOFIAPUBFUN
00132 int msg_mclass_insert_with_mask(msg_mclass_t *mc, 
00133                                 msg_hclass_t *hc,
00134                                 unsigned short offset,
00135                                 unsigned short mask);
00136 
00137 SOFIAPUBFUN
00138 msg_href_t const *msg_find_hclass(msg_mclass_t const *, char const *, int *);
00139 
00140 SOFIAPUBFUN msg_mclass_t const *msg_mclass(msg_t const *);
00141 
00142 SOFIA_END_DECLS
00143 
00144 #endif /* !defined(MSG_MCLASS_H) */

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