1#if defined(HAVE_CONFIG_H)
21#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
25inline Data generateTransactionId()
39 const std::bitset<256>& terminators)
41 mHasMagicCookie(false),
46 mInteropMagicCookie(0),
74 if (mHasMagicCookie &&
75 (pb.
end() - start > 8) &&
80 const char* curr=start;
89 pb.
data(encoded, curr);
98 pb.
data(encoded,curr);
108 pb.
data(mTransactionId, start);
112 mTransactionId=generateTransactionId();
119 mHasMagicCookie(true),
121 mTransactionId(generateTransactionId()),
123 mInteropMagicCookie(0),
124 mSigcompCompartment()
130 mHasMagicCookie(other.mHasMagicCookie),
131 mIsMyBranch(other.mIsMyBranch),
132 mTransactionId(other.mTransactionId),
133 mTransportSeq(other.mTransportSeq),
134 mClientData(other.mClientData),
135 mSigcompCompartment(other.mSigcompCompartment)
137 if (other.mInteropMagicCookie)
139 mInteropMagicCookie =
new Data(*other.mInteropMagicCookie);
143 mInteropMagicCookie = 0;
149 delete mInteropMagicCookie;
157 mHasMagicCookie = other.mHasMagicCookie;
158 mIsMyBranch = other.mIsMyBranch;
159 mTransactionId = other.mTransactionId;
160 mTransportSeq = other.mTransportSeq;
161 mClientData = other.mClientData;
162 mSigcompCompartment = other.mSigcompCompartment;
163 if (other.mInteropMagicCookie)
165 delete mInteropMagicCookie;
166 mInteropMagicCookie =
new Data(*other.mInteropMagicCookie);
170 delete mInteropMagicCookie;
171 mInteropMagicCookie = 0;
180 if (mIsMyBranch != other.mIsMyBranch ||
181 mHasMagicCookie != other.mHasMagicCookie ||
182 mTransportSeq != other.mTransportSeq ||
183 mTransactionId != other.mTransactionId ||
184 mClientData != other.mClientData ||
185 mSigcompCompartment != other.mSigcompCompartment)
195 return mHasMagicCookie;
201 return mTransactionId;
240 mSigcompCompartment = id;
246 return mSigcompCompartment;
252 mHasMagicCookie =
true;
254 delete mInteropMagicCookie;
255 mInteropMagicCookie = 0;
260 if (!transactionId.
empty())
262 mTransactionId = transactionId;
266 mTransactionId = generateTransactionId();
282 if (mInteropMagicCookie)
284 stream << *mInteropMagicCookie;
294 stream << mTransportSeq;
296 if(!mClientData.
empty())
303 if(!mSigcompCompartment.
empty())
311 stream << mTransactionId;
#define resip_assert(x)
This file needs to work for both C and C++ code.
Represents the "via-branch" parameter of the RFC 3261 grammar.
BranchParameter & operator=(const BranchParameter &other)
bool operator==(const BranchParameter &other) const
virtual EncodeStream & encode(EncodeStream &stream) const
Data getSigcompCompartment() const
void setSigcompCompartment(const Data &)
void reset(const Data &transactionId=Data::Empty)
BranchParameter(ParameterTypes::Type, ParseBuffer &pb, const std::bitset< 256 > &terminators)
bool hasMagicCookie() const
const Data & getTransactionId() const
virtual Parameter * clone() const
void incrementTransportSequence()
An iostream that operates on an existing Data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
Data base64decode() const
Performs RFC 3548 Base 64 decoding of the contents of this data.
static const Data Empty
Constant that represents a zero-length data.
Data base64encode(bool useUrlSafe=false) const
Performs RFC 3548 Base 64 encoding of the contents of this data.
bool empty() const noexcept
Checks whether the Data is empty.
static std::bitset< 256 > toBitset(const resip::Data &chars)
Creates a bitset reflecting the contents of this data (as a set) ie.
virtual const Data & getName() const
Provides string-parsing functionality with protection from buffer overflow.
uint32_t uInt32()
dcm! – merge these, ask about length checks
CurrentPosition skipWhitespace()
CurrentPosition skipToChar(char c)
CurrentPosition position() const
CurrentPosition skipToOneOf(const char *cs)
CurrentPosition skipN(size_t count)
CurrentPosition skipChar()
void data(Data &data, const char *start) const
make the passed in data share memory with the buffer (uses Data::Share)
BaseException used to indicate parse failures.
static Data getCryptoRandomHex(unsigned int numBytes)
static uint64_t getTimeMicroSec()
Returns the current clock time in microseconds.
static const char * EQUALS
static const char *const resipCookie
static const char *const MagicCookie
dcm! – add UnusedChecking(_enum) below;