/[resiprocate]/main/sip/resiprocate/SipMessageExplicit.cxx
ViewVC logotype

Contents of /main/sip/resiprocate/SipMessageExplicit.cxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4599 - (show annotations) (download)
Wed May 11 23:10:19 2005 UTC (14 years, 7 months ago) by derek
File size: 9653 byte(s)
set svn:eol-style to LF
1 #if defined(HAVE_CONFIG_H)
2 #include "resiprocate/config.hxx"
3 #endif
4
5 // Included in SipMessage.cxx
6
7 #define EXISTS(_T) \
8 bool \
9 SipMessage::exists(const Header<Headers::_T>& headerType) const \
10 { \
11 return mHeaders[Headers::_T] != 0; \
12 }
13
14 EXISTS(CSeq);
15 EXISTS(Call_ID);
16 EXISTS(Contact);
17 EXISTS(Content_Length);
18 EXISTS(Expires);
19 EXISTS(From);
20 EXISTS(Max_Forwards);
21 EXISTS(Route);
22 EXISTS(Subject);
23 EXISTS(To);
24 EXISTS(Via);
25 EXISTS(Accept);
26 EXISTS(Accept_Encoding);
27 EXISTS(Accept_Language);
28 EXISTS(Alert_Info);
29 EXISTS(Allow);
30 EXISTS(Authentication_Info);
31 EXISTS(Call_Info);
32 EXISTS(Content_Disposition);
33 EXISTS(Content_Encoding);
34 EXISTS(Content_Language);
35 EXISTS(Content_Type);
36 EXISTS(Date);
37 EXISTS(Error_Info);
38 EXISTS(In_Reply_To);
39 EXISTS(Min_Expires);
40 EXISTS(MIME_Version);
41 EXISTS(Organization);
42 EXISTS(Priority);
43 EXISTS(Proxy_Authenticate);
44 EXISTS(Proxy_Authorization);
45 EXISTS(Proxy_Require);
46 EXISTS(Record_Route);
47 EXISTS(Reply_To);
48 EXISTS(Require);
49 EXISTS(Retry_After);
50 EXISTS(Server);
51 EXISTS(Supported);
52 EXISTS(Timestamp);
53 EXISTS(Unsupported);
54 EXISTS(User_Agent);
55 EXISTS(Warning);
56 EXISTS(WWW_Authenticate);
57 EXISTS(Subscription_State);
58 EXISTS(Refer_To);
59 EXISTS(Referred_By);
60 EXISTS(Authorization);
61 EXISTS(Replaces);
62
63 #define HEADER(_T) \
64 Header<Headers::_T>::Type& \
65 SipMessage::header(const Header<Headers::_T>& headerType) const \
66 { \
67 HeaderFieldValueList* hfvs = ensureHeader(Headers::_T); \
68 \
69 if (!hfvs->front()->isParsed()) \
70 { \
71 hfvs->front()->setParserCategory(new Header<Headers::_T>::Type(hfvs->front())); \
72 if (hfvs->moreThanOne()) \
73 { \
74 } \
75 } \
76 \
77 return *dynamic_cast<Header<Headers::_T>::Type*>(mHeaders[Headers::_T]->first->getParserCategory()); \
78 }
79
80
81 HEADER(CSeq);
82 HEADER(Call_ID);
83 HEADER(Authentication_Info);
84 HEADER(Authorization);
85 HEADER(Content_Disposition);
86 HEADER(Content_Encoding);
87 HEADER(Content_Length);
88 HEADER(Content_Type);
89 HEADER(Date);
90 HEADER(Expires);
91 HEADER(From);
92 HEADER(In_Reply_To);
93 HEADER(MIME_Version);
94 HEADER(Max_Forwards);
95 HEADER(Min_Expires);
96 HEADER(Organization);
97 HEADER(Priority);
98 HEADER(Proxy_Authenticate);
99 HEADER(Proxy_Authorization);
100 HEADER(Refer_To);
101 HEADER(Referred_By);
102 HEADER(Replaces);
103 HEADER(Reply_To);
104 HEADER(Retry_After);
105 HEADER(Server);
106 HEADER(Subject);
107 HEADER(Subscription_State);
108 HEADER(Timestamp);
109 HEADER(To);
110 HEADER(User_Agent);
111 HEADER(WWW_Authenticate);
112 HEADER(Warning);
113
114 #define MULTI_HEADER(_T) \
115 ParserContainer<MultiHeader<Headers::_T>::Type>& \
116 SipMessage::header(const MultiHeader<Headers::_T>& headerType) const \
117 { \
118 HeaderFieldValueList* hfvs = ensureHeader(Headers::_T); \
119 \
120 if (!hfvs->front()->isParsed()) \
121 { \
122 hfvs->setParserContainer(new ParserContainer<MultiHeader<Headers::_T>::Type>(hfvs)); \
123 } \
124 \
125 return *dynamic_cast<ParserContainer<MultiHeader<Headers::_T>::Type>*>(mHeaders[Headers::_T]->getParserContainer()); \
126 }
127
128 MULTI_HEADER(Accept);
129 MULTI_HEADER(Accept_Encoding);
130 MULTI_HEADER(Accept_Language);
131 MULTI_HEADER(Alert_Info);
132 MULTI_HEADER(Allow);
133 MULTI_HEADER(Call_Info);
134 MULTI_HEADER(Contact);
135 MULTI_HEADER(Content_Language);
136 MULTI_HEADER(Error_Info);
137 MULTI_HEADER(Proxy_Require);
138 MULTI_HEADER(Record_Route);
139 MULTI_HEADER(Require);
140 MULTI_HEADER(Route);
141 MULTI_HEADER(Supported);
142 MULTI_HEADER(Unsupported);
143 MULTI_HEADER(Via);
144
145 #define REMOVE(_T) \
146 void \
147 SipMessage::remove(const Header<Headers::_T>& headerType) \
148 { \
149 delete mHeaders[Headers::_T]; \
150 mHeaders[Headers::_T] = 0; \
151 }
152
153 REMOVE(CSeq);
154 REMOVE(Call_ID);
155 REMOVE(Contact);
156 REMOVE(Content_Length);
157 REMOVE(Expires);
158 REMOVE(From);
159 REMOVE(Max_Forwards);
160 REMOVE(Route);
161 REMOVE(Subject);
162 REMOVE(To);
163 REMOVE(Via);
164 REMOVE(Accept);
165 REMOVE(Accept_Encoding);
166 REMOVE(Accept_Language);
167 REMOVE(Alert_Info);
168 REMOVE(Allow);
169 REMOVE(Authentication_Info);
170 REMOVE(Call_Info);
171 REMOVE(Content_Disposition);
172 REMOVE(Content_Encoding);
173 REMOVE(Content_Language);
174 REMOVE(Content_Type);
175 REMOVE(Date);
176 REMOVE(Error_Info);
177 REMOVE(In_Reply_To);
178 REMOVE(Min_Expires);
179 REMOVE(MIME_Version);
180 REMOVE(Organization);
181 REMOVE(Priority);
182 REMOVE(Proxy_Authenticate);
183 REMOVE(Proxy_Authorization);
184 REMOVE(Proxy_Require);
185 REMOVE(Record_Route);
186 REMOVE(Reply_To);
187 REMOVE(Require);
188 REMOVE(Retry_After);
189 REMOVE(Server);
190 REMOVE(Supported);
191 REMOVE(Timestamp);
192 REMOVE(Unsupported);
193 REMOVE(User_Agent);
194 REMOVE(Warning);
195 REMOVE(WWW_Authenticate);
196 REMOVE(Subscription_State);
197 REMOVE(Refer_To);
198 REMOVE(Referred_By);
199 REMOVE(Authorization);
200 REMOVE(Replaces);
201
202 #undef EXISTS
203 #undef HEADERS
204 #undef MULTI_HEADERS
205 #undef REMOVE
206
207
208 /* ====================================================================
209 * The Vovida Software License, Version 1.0
210 *
211 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
212 *
213 * Redistribution and use in source and binary forms, with or without
214 * modification, are permitted provided that the following conditions
215 * are met:
216 *
217 * 1. Redistributions of source code must retain the above copyright
218 * notice, this list of conditions and the following disclaimer.
219 *
220 * 2. Redistributions in binary form must reproduce the above copyright
221 * notice, this list of conditions and the following disclaimer in
222 * the documentation and/or other materials provided with the
223 * distribution.
224 *
225 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
226 * and "Vovida Open Communication Application Library (VOCAL)" must
227 * not be used to endorse or promote products derived from this
228 * software without prior written permission. For written
229 * permission, please contact vocal@vovida.org.
230 *
231 * 4. Products derived from this software may not be called "VOCAL", nor
232 * may "VOCAL" appear in their name, without prior written
233 * permission of Vovida Networks, Inc.
234 *
235 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
236 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
237 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
238 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
239 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
240 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
241 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
242 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
243 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
244 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
245 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
246 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
247 * DAMAGE.
248 *
249 * ====================================================================
250 *
251 * This software consists of voluntary contributions made by Vovida
252 * Networks, Inc. and many individuals on behalf of Vovida Networks,
253 * Inc. For more information on Vovida Networks, Inc., please see
254 * <http://www.vovida.org/>.
255 *
256 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27