/[resiprocate]/main/sip/resiprocate/HeaderTypes.hxx
ViewVC logotype

Contents of /main/sip/resiprocate/HeaderTypes.hxx

Parent Directory Parent Directory | Revision Log Revision Log


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

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27