msg 1.12.10
|
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 00096 struct msg_mclass_s 00097 { 00098 struct msg_hclass_s 00099 mc_hclass[1]; 00100 char const *mc_name; 00101 void *mc_tag; 00102 unsigned mc_flags; 00103 unsigned mc_msize; 00105 issize_t (*mc_extract_body)(msg_t *msg, msg_pub_t *pub, 00106 char b[], isize_t bsiz, int eos); 00107 00108 msg_href_t mc_request[1]; 00109 msg_href_t mc_status[1]; 00110 msg_href_t mc_separator[1]; 00111 msg_href_t mc_payload[1]; 00112 msg_href_t mc_unknown[1]; 00113 msg_href_t mc_error[1]; 00114 msg_href_t mc_multipart[1]; 00115 msg_href_t const * 00116 mc_short; 00117 short mc_hash_size; 00118 short mc_hash_used; 00120 msg_href_t mc_hash[MC_HASH_SIZE]; 00121 }; 00122 00123 enum { msg_mclass_copy = 0, msg_mclass_empty = 1 }; 00124 00125 SOFIAPUBFUN msg_mclass_t *msg_mclass_clone(msg_mclass_t const *old, 00126 int newsize, int empty); 00127 00128 SOFIAPUBFUN int msg_mclass_insert(msg_mclass_t *mc, msg_href_t const *hr); 00129 00130 SOFIAPUBFUN 00131 int msg_mclass_insert_header(msg_mclass_t *mc, 00132 msg_hclass_t *hc, 00133 unsigned short offset); 00134 00135 SOFIAPUBFUN 00136 int msg_mclass_insert_with_mask(msg_mclass_t *mc, 00137 msg_hclass_t *hc, 00138 unsigned short offset, 00139 unsigned short mask); 00140 00141 SOFIAPUBFUN 00142 msg_href_t const *msg_find_hclass(msg_mclass_t const *, char const *, isize_t *); 00143 00144 SOFIAPUBFUN msg_mclass_t const *msg_mclass(msg_t const *); 00145 00146 SOFIA_END_DECLS 00147 00148 #endif /* !defined(MSG_MCLASS_H) */