/[resiprocate]/branches/b-identity-0505/BranchParameter.hxx
ViewVC logotype

Contents of /branches/b-identity-0505/BranchParameter.hxx

Parent Directory Parent Directory | Revision Log Revision Log


Revision 4598 - (show annotations) (download)
Wed May 11 22:53:07 2005 UTC (14 years, 6 months ago) by derek
File size: 4246 byte(s)
set svn:eol-style to LF
1 #if !defined(RESIP_BRANCHPARAMETER_HXX)
2 #define RESIP_BRANCHPARAMETER_HXX
3
4 #include <iosfwd>
5
6 #include "resiprocate/Parameter.hxx"
7 #include "resiprocate/ParameterTypeEnums.hxx"
8 #include "resiprocate/os/Data.hxx"
9
10 namespace resip
11 {
12
13 class ParseBuffer;
14
15 // BranchParameter of the form:
16 // rfc3261cookie-sip2cookie-tid-transportseq-clientdata-sip2cookie
17 // Notably, the tid MAY contain dashes by the clientdata MUST NOT.
18 //
19 class BranchParameter : public Parameter
20 {
21 public:
22 typedef BranchParameter Type;
23
24 BranchParameter(ParameterTypes::Type, ParseBuffer& pb, const char* terminators);
25 explicit BranchParameter(ParameterTypes::Type);
26
27 // contains z9hG4bK
28 bool hasMagicCookie() const;
29
30 // returns tid
31 const Data& getTransactionId() const;
32
33 // increments the transport sequence component - not part of tid
34 void incrementTransportSequence();
35
36 // pseudo-random tid if none specified, zero sequences either way
37 void reset(const Data& transactionId = Data::Empty);
38
39 // access the client specific portion of the branch - not part of tid
40 Data& clientData();
41 const Data& clientData() const;
42
43 static Parameter* decode(ParameterTypes::Type type, ParseBuffer& pb, const char* terminators)
44 {
45 return new BranchParameter(type, pb, terminators);
46 }
47
48 virtual Parameter* clone() const;
49 virtual std::ostream& encode(std::ostream& stream) const;
50
51 BranchParameter(const BranchParameter& other);
52 BranchParameter& operator=(const BranchParameter& other);
53 bool operator==(const BranchParameter& other);
54
55 private:
56 friend class ParserCategory;
57 Type& value() {return *this;}
58
59 bool mHasMagicCookie;
60 bool mIsMyBranch;
61 Data mTransactionId;
62 unsigned long mTransportSeq;
63 Data mClientData;
64 };
65
66 }
67
68 #endif
69
70 /* ====================================================================
71 * The Vovida Software License, Version 1.0
72 *
73 * Copyright (c) 2000 Vovida Networks, Inc. All rights reserved.
74 *
75 * Redistribution and use in source and binary forms, with or without
76 * modification, are permitted provided that the following conditions
77 * are met:
78 *
79 * 1. Redistributions of source code must retain the above copyright
80 * notice, this list of conditions and the following disclaimer.
81 *
82 * 2. Redistributions in binary form must reproduce the above copyright
83 * notice, this list of conditions and the following disclaimer in
84 * the documentation and/or other materials provided with the
85 * distribution.
86 *
87 * 3. The names "VOCAL", "Vovida Open Communication Application Library",
88 * and "Vovida Open Communication Application Library (VOCAL)" must
89 * not be used to endorse or promote products derived from this
90 * software without prior written permission. For written
91 * permission, please contact vocal@vovida.org.
92 *
93 * 4. Products derived from this software may not be called "VOCAL", nor
94 * may "VOCAL" appear in their name, without prior written
95 * permission of Vovida Networks, Inc.
96 *
97 * THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED
98 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
99 * OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, TITLE AND
100 * NON-INFRINGEMENT ARE DISCLAIMED. IN NO EVENT SHALL VOVIDA
101 * NETWORKS, INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT DAMAGES
102 * IN EXCESS OF $1,000, NOR FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
103 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
104 * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
105 * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
106 * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
107 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
108 * USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH
109 * DAMAGE.
110 *
111 * ====================================================================
112 *
113 * This software consists of voluntary contributions made by Vovida
114 * Networks, Inc. and many individuals on behalf of Vovida Networks,
115 * Inc. For more information on Vovida Networks, Inc., please see
116 * <http://www.vovida.org/>.
117 *
118 */

Properties

Name Value
svn:eol-style LF

webmaster AT resiprocate DOT org
ViewVC Help
Powered by ViewVC 1.1.27