1#if defined(HAVE_CONFIG_H)
15#define RESIPROCATE_SUBSYSTEM Subsystem::SIP
24 mProtocolVersion(
Data::Share,
Symbols::ProtocolVersion),
30 this->
param(p_branch);
42 mProtocolVersion(
Data::Share,
Symbols::ProtocolVersion),
51 mProtocolName(rhs.mProtocolName),
52 mProtocolVersion(rhs.mProtocolVersion),
53 mTransport(rhs.mTransport),
54 mSentHost(rhs.mSentHost),
55 mSentPort(rhs.mSentPort)
65 mProtocolName = rhs.mProtocolName;
66 mProtocolVersion = rhs.mProtocolVersion;
67 mTransport = rhs.mTransport;
68 mSentHost = rhs.mSentHost;
69 mSentPort = rhs.mSentPort;
77 return new Via(*
this);
83 return new (location)
Via(*
this);
89 return new (pool)
Via(*
this, pool);
103 return mProtocolName;
110 return mProtocolVersion;
117 return mProtocolVersion;
165 const char* startMark;
169 pb.
data(mProtocolName, startMark);
174 pb.
data(mProtocolVersion, startMark);
183 pb.
data(mTransport, startMark);
187 if (*startMark ==
'[')
191 pb.
data(mSentHost, startMark);
195 if(canonicalizedHost.
empty())
199 " be unparsable because IPV6 support is not"
211 pb.
data(mSentHost, startMark);
238 str <<
'[' << mSentHost <<
']';
260 return ParameterFactories[type](type, pb, terminators, pool);
280#define defineParam(_enum, _name, _type, _RFC_ref_ignored) \
281_enum##_Param::DType& \
282Via::param(const _enum##_Param& paramType) \
285 _enum##_Param::Type* p = \
286 static_cast<_enum##_Param::Type*>(getParameterByEnum(paramType.getTypeNum())); \
289 p = new _enum##_Param::Type(paramType.getTypeNum()); \
290 mParameters.push_back(p); \
295const _enum##_Param::DType& \
296Via::param(const _enum##_Param& paramType) const \
299 _enum##_Param::Type* p = \
300 static_cast<_enum##_Param::Type*>(getParameterByEnum(paramType.getTypeNum())); \
303 InfoLog(<< "Missing parameter " _name " " << ParameterTypes::ParameterNames[paramType.getTypeNum()]); \
304 DebugLog(<< *this); \
305 throw Exception("Missing parameter " _name, __FILE__, __LINE__); \
#define defineParam(_enum, _name, _type, _RFC_ref_ignored)
Represents the "via-branch" parameter of the RFC 3261 grammar.
Generically represents miscellaneous parameter data.
An alternative to std::string, encapsulates an arbitrary buffer of bytes.
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.
static bool isIpV6Address(const Data &ipAddress)
static Data canonicalizeIpV6Address(const Data &ipV6Address)
Converts the printable form of an IPv6 address into consistent format so that string comparisons will...
static bool getRportEnabled()
virtual ParameterTypes::Type getTypeNum() const =0
Parameter *(* Factory)(ParameterTypes::Type, ParseBuffer &, const std::bitset< 256 > &terminators, PoolBase *pool)
Provides string-parsing functionality with protection from buffer overflow.
CurrentPosition skipNonWhitespace()
CurrentPosition skipWhitespace()
CurrentPosition skipToChar(char c)
CurrentPosition position() const
void assertNotEof() const
CurrentPosition skipToOneOf(const char *cs)
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.
Base class for all SIP grammar elements that can have parameters.
Parameter * getParameterByEnum(ParameterTypes::Type type) const
ParserCategory & operator=(const ParserCategory &rhs)
void removeParameterByEnum(ParameterTypes::Type type)
void parseParameters(ParseBuffer &pb)
EncodeStream & encodeParameters(EncodeStream &str) const
Encodes parameters as they should appear on the wire.
Generically represents miscellaneous parameter data that is encoded using double quotes.
Represents the "via-received" element in the RFC 3261 grammar.
Represents the "response-port" element of the SIP grammar (as extended in RFC 3581).
static const char * SPACE
static const char * COLON
static const char * SLASH
Generically represents unsigned 32-bit integer values conveyed by SIP parameters.
Represents the "via-parm" element in the RFC 3261 grammar.
void remove(const Param< Via > ¶mType)
virtual void parse(ParseBuffer &pb)
virtual ParserCategory * clone() const
Via & operator=(const Via &)
bool exists(const Param< Via > ¶mType) const
virtual Parameter * createParam(ParameterTypes::Type type, ParseBuffer &pb, const std::bitset< 256 > &terminators, PoolBase *pool)
virtual EncodeStream & encodeParsed(EncodeStream &str) const
const Data & param(const ExtensionParameter ¶m) const
Const accessor for non-natively-supported parameter types.
dcm! – add UnusedChecking(_enum) below;