/[resiprocate]/branches/b-directory-reorg/sip/resiprocate/HeaderTypes.hxx
ViewVC logotype

Contents of /branches/b-directory-reorg/sip/resiprocate/HeaderTypes.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 5271 - (show annotations) (download)
Thu Aug 18 23:43:07 2005 UTC (14 years, 3 months ago) by jason
File size: 10190 byte(s)
new directory reorg proposal
1 #if !defined(RESIP_HEADERTYPES_HXX)
2 #define RESIP_HEADERTYPES_HXX
3
4 #include "resiprocate/os/Data.hxx"
5
6 //****************************************************************************
7 //
8 // !dlb! until automated, must ensure that this set is consistent with
9 //
10 // ************ PLEASE RUN testParserCategories AFTER CHANGING ***************
11 //
12 // HeaderTypes.hxx
13 // Headers.hxx
14 // HeaderHash.gperf
15 // Headers.cxx
16 // SipMessage.hxx
17 // SipMessage.cxx
18 //
19 //****************************************************************************
20
21 // eventually use these macros to automate Headers.hxx, Headers.cxx+gperf
22 #define UNUSED_defineHeader(_enum, _name, _type, _rfc) SAVE##_enum, _enum = UNKNOWN, RESET##enum = SAVE##_enum-1
23 #define UNUSED_defineMultiHeader(_enum, _name, _type, _rfc) SAVE##_enum, _enum = UNKNOWN, RESET##enum = SAVE##_enum-1
24 #define defineHeader(_enum, _name, _type, _rfc) _enum
25 #define defineMultiHeader(_enum, _name, _type, _rfc) _enum
26
27 namespace resip
28 {
29
30 /**
31 Maps from header name to derived ParserCategory. Determines whether the
32 header is single or multiple valued.
33
34 The Type enum controls the order of output of the headers in the encoded
35 SipMessage. Put headers that you want to appear early in the message early
36 in this list.
37 */
38 class Headers
39 {
40 public:
41 enum Type
42 {
43 UNKNOWN = -1,
44 defineMultiHeader(Via, "Via", Via, "RFC 3261"), // rjs says must be first
45 defineHeader(MaxForwards, "Max-Forwards", IntegerCategory, "RFC 3261"),
46 defineMultiHeader(Route, "Route", NameAddr, "RFC 3261"),
47 defineMultiHeader(RecordRoute, "Record-Route", NameAddr, "RFC 3261"),
48 defineMultiHeader(Path, "Path", NameAddr, "RFC 3327"),
49 defineMultiHeader(ServiceRoute, "Service-Route", NameAddr, "RFC 3608"),
50 defineMultiHeader(ProxyRequire, "Proxy-Require", Token, "RFC 3261"),
51 defineMultiHeader(ProxyAuthenticate, "Proxy-Authenticate", Auth, "RFC 3261"),
52 defineHeader(Identity, "Identity", StringCategory, "draft-sip-identity-03"),
53 defineHeader(IdentityInfo, "Identity-Info", GenericUri, "draft-sip-identity-03"),
54 defineMultiHeader(Require, "Require", Token, "RFC 3261"),
55 defineMultiHeader(Contact, "Contact", NameAddr, "RFC 3261"),
56
57 defineHeader(To, "To", NameAddr, "RFC 3261"),
58 defineHeader(From, "From", NameAddr, "RFC 3261"),
59 defineHeader(CallID, "Call-ID", CallId, "RFC 3261"),
60 defineHeader(CSeq, "CSeq", CSeqCategory, "RFC 3261"),
61 defineHeader(Subject, "Subject", StringCategory, "RFC 3261"),
62 defineHeader(Expires, "Expires", ExpiresCategory, "RFC 3261"),
63 defineHeader(SessionExpires, "Session-Expires", ExpiresCategory, "RFC 4028"),
64 defineHeader(MinSE, "Min-SE", ExpiresCategory, "RFC 4028"),
65 defineMultiHeader(Accept, "Accept", Mime, "RFC 3261"),
66 defineMultiHeader(AcceptEncoding, "Accept-Encoding", Token, "RFC 3261"),
67 defineMultiHeader(AcceptLanguage, "Accept-Language", Token, "RFC 3261"),
68 defineMultiHeader(AlertInfo, "Alert-Info", GenericUri, "RFC 3261"),
69 defineMultiHeader(Allow, "Allow", Token, "RFC 3261"),
70 defineHeader(AuthenticationInfo, "Authentication-Info", Auth, "RFC 3261"),
71 defineMultiHeader(CallInfo, "Call-Info", GenericUri, "RFC 3261"),
72 defineHeader(ContentDisposition, "Content-Disposition", Token, "RFC ?"),
73 defineHeader(ContentEncoding, "Content-Encoding", Token, "RFC ?"),
74 defineHeader(ContentId, "Content-ID", Token, "RFC 2045"),
75 defineMultiHeader(ContentLanguage, "Content-Language", Token, "RFC ?"),
76 // i really think that Content-Transfer-Encoding should be a Token !rwm
77 defineHeader(ContentTransferEncoding, "Content-Transfer-Encoding", StringCategory, "RFC ?"), // !dlb! defineMultiHeader
78 defineHeader(ContentType, "Content-Type", Mime, "RFC 3261"),
79 defineHeader(Date, "Date", DateCategory, "RFC 3261"),
80 defineMultiHeader(ErrorInfo, "Error-Info", GenericUri, "RFC 3261"),
81 defineHeader(InReplyTo, "In-Reply-To", CallId, "RFC 3261"),
82 defineHeader(MinExpires, "Min-Expires", IntegerCategory, "RFC 3261"),
83 defineHeader(MIMEVersion, "MIME-Version", Token, "RFC 3261"),
84 defineHeader(Organization, "Organization", StringCategory, "RFC 3261"),
85 defineHeader(Priority, "Priority", Token, "RFC 3261"),
86 defineMultiHeader(ProxyAuthorization, "Proxy-Authorization", Auth, "RFC 3261"),
87 defineHeader(ReplyTo, "Reply-To", NameAddr, "RFC 3261"),
88 defineHeader(RetryAfter, "Retry-After", IntegerCategory, "RFC 3261"),
89 defineHeader(Server, "Server", StringCategory, "RFC 3261"),
90 defineHeader(SIPETag, "SIP-ETag", Token, "RFC 3903"),
91 defineHeader(SIPIfMatch, "SIP-If-Match", Token, "RFC 3903"),
92 defineMultiHeader(Supported, "Supported", Token, "RFC 3261"),
93 defineHeader(Timestamp, "Timestamp", StringCategory, "RFC 3261"),
94 defineMultiHeader(Unsupported, "Unsupported", Token, "RFC 3261"),
95 defineHeader(UserAgent, "User-Agent", StringCategory, "RFC 3261"),
96 defineMultiHeader(Warning, "Warning", WarningCategory, "RFC 3261"),
97 defineMultiHeader(WWWAuthenticate, "WWW-Authenticate", Auth, "RFC 3261"),
98 defineHeader(SubscriptionState, "Subscription-State", Token, "RFC 3265"),
99 defineHeader(ReferTo, "Refer-To", NameAddr, "RFC 3515"),
100 defineHeader(ReferredBy, "Referred-By", NameAddr, "RFC 3892"),
101 defineMultiHeader(Authorization, "Authorization", Auth, "RFC 3261"),
102 defineHeader(Replaces, "Replaces", CallId, "RFC 3891"),
103 defineHeader(Event, "Event", Token, "RFC 3265"),
104 defineMultiHeader(AllowEvents, "Allow-Events", Token, "RFC 3265"),
105 defineMultiHeader(SecurityClient, "Security-Client", Token, "RFC 3329"),
106 defineMultiHeader(SecurityServer, "Security-Server", Token, "RFC 3329"),
107 defineMultiHeader(SecurityVerify, "Security-Verify", Token, "RFC 3329"),
108 defineHeader(RSeq, "RSeq", IntegerCategory, "RFC 3262"),
109 defineHeader(RAck, "RAck", RAckCategory, "RFC 3262"),
110
111 defineMultiHeader(Reason, "Reason", Token, "RFC 3326"),
112 defineMultiHeader(Privacy, "Privacy", Token, "RFC 3323"),
113 defineMultiHeader(RequestDisposition, "Request-Disposition", Token, "RFC 3841"),
114 defineMultiHeader(PMediaAuthorization, "P-Media-Authorization", Token, "RFC 3313"),
115 defineHeader(Join, "Join", CallId, "RFC 3911"),
116 defineHeader(TargetDialog, "Target-Dialog", CallId, "Target Dialog draft"),
117 defineMultiHeader(PAssertedIdentity, "P-Asserted-Identity", NameAddr, "RFC 3325"),
118 defineMultiHeader(PPreferredIdentity, "P-Preferred-Identity", NameAddr, "RFC 3325"),
119 defineMultiHeader(AcceptContact, "Accept-Contact", NameAddr, "RFC 3841"),
120 defineMultiHeader(RejectContact, "Reject-Contact", NameAddr, "RFC 3841"),
121 defineHeader(PCalledPartyId, "P-Called-Party-ID", NameAddr, "RFC 3455"),
122 defineMultiHeader(PAssociatedUri, "P-Associated-URI", NameAddr, "RFC 3455"),
123
124 defineHeader(ContentLength, "Content-Length", IntegerCategory, "RFC 3261"),
125
126 MAX_HEADERS,
127 NONE
128 };
129
130 // get enum from header name
131 static Type getType(const char* name, int len);
132 static bool isCommaTokenizing(Type type);
133 static bool isCommaEncoding(Type type);
134 static const Data& getHeaderName(int);
135
136 // treat as private
137 static bool CommaTokenizing[MAX_HEADERS+1];
138 static bool CommaEncoding[MAX_HEADERS+1];
139 static Data HeaderNames[MAX_HEADERS+1];
140 };
141
142 }
143
144 #undef UNUSED_defineHeader
145 #undef UNUSED_defineMultiHeader
146 #undef defineHeader
147 #undef defineMultiHeader
148
149 #endif
150
151 /* ====================================================================
152 * The Vovida Software License, Version 1.0
153 *
154 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
155 *
156 * Redistribution and use in source and binary forms, with or without
157 * modification, are permitted provided that the following conditions
158 * are met:
159 *
160 * 1. Redistributions of source code must retain the above copyright
161 * notice, this list of conditions and the following disclaimer.
162 *
163 * 2. Redistributions in binary form must reproduce the above copyright
164 * notice, this list of conditions and the following disclaimer in
165 * the documentation and/or other materials provided with the
166 * distribution.
167 *
168 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
169 * and "Vovida Open Communication Application Library (VOCAL)" must
170 * not be used to endorse or promote products derived from this
171 * software without prior written permission. For written
172 * permission, please contact vocal@vovida.org.
173 *
174 * 4. Products derived from this software may not be called "VOCAL", nor
175 * may "VOCAL" appear in their name, without prior written
176 * permission of Vovida Networks, Inc.
177 *
178 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
179 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
180 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
181 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
182 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
183 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
184 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
185 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
186 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
187 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
188 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
189 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
190 * DAMAGE.
191 *
192 * ====================================================================
193 *
194 * This software consists of voluntary contributions made by Vovida
195 * Networks, Inc. and many individuals on behalf of Vovida Networks,
196 * Inc. For more information on Vovida Networks, Inc., please see
197 * <http://www.vovida.org/>.
198 *
199 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27