00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
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