1 #ifndef PACKETPP_SIP_LAYER 2 #define PACKETPP_SIP_LAYER 17 #define PCPP_SIP_FROM_FIELD "From" 19 #define PCPP_SIP_TO_FIELD "To" 21 #define PCPP_SIP_VIA_FIELD "Via" 23 #define PCPP_SIP_CALL_ID_FIELD "Call-ID" 25 #define PCPP_SIP_CONTENT_TYPE_FIELD "Content-Type" 27 #define PCPP_SIP_CONTENT_LENGTH_FIELD "Content-Length" 29 #define PCPP_SIP_CONTENT_DISPOSITION_FIELD "Content-Disposition" 31 #define PCPP_SIP_CONTENT_ENCODING_FIELD "Content-Encoding" 33 #define PCPP_SIP_CONTENT_LANGUAGE_FIELD "Content-Language" 35 #define PCPP_SIP_CSEQ_FIELD "CSeq" 37 #define PCPP_SIP_CONTACT_FIELD "Contact" 39 #define PCPP_SIP_MAX_FORWARDS_FIELD "Max-Forwards" 41 #define PCPP_SIP_USER_AGENT_FIELD "User-Agent" 43 #define PCPP_SIP_ACCEPT_FIELD "Accept" 45 #define PCPP_SIP_ACCEPT_ENCODING_FIELD "Accept-Encoding" 47 #define PCPP_SIP_ACCEPT_LANGUAGE_FIELD "Accept-Language" 49 #define PCPP_SIP_ALLOW_FIELD "Allow" 51 #define PCPP_SIP_AUTHORIZATION_FIELD "Authorization" 53 #define PCPP_SIP_DATE_FIELD "Date" 55 #define PCPP_SIP_MIME_VERSION_FIELD "MIME-Version" 57 #define PCPP_SIP_REASON_FIELD "Reason" 59 #define PCPP_SIP_SUPPORTED_FIELD "Supported" 61 #define PCPP_SIP_SERVER_FIELD "Server" 63 #define PCPP_SIP_WWW_AUTHENTICATE_FIELD "WWW-Authenticate" 65 #define PCPP_SIP_RETRY_AFTER_FIELD "Retry-After" 67 #define PCPP_SIP_RECORD_ROUTE_FIELD "Record-Route" 119 static bool isSipPort(uint16_t port) {
return port == 5060 || port == 5061; }
125 SipLayer& operator=(
const SipLayer& other) { TextBasedProtocolMessage::operator=(other);
return *
this; }
128 char getHeaderFieldNameValueSeparator()
const {
return ':'; }
129 bool spacesAllowedBetweenHeaderFieldNameAndValue()
const {
return true; }
497 std::string getUri()
const;
504 bool setUri(
const std::string& newUri);
522 int getSize()
const {
return m_FirstLineEndOffset; }
542 void setMessage(
const std::string &message) { m_Message = message; }
543 virtual const char* what()
const throw()
545 return m_Message.c_str();
548 std::string m_Message;
559 std::string m_Version;
562 int m_FirstLineEndOffset;
591 int getStatusCodeAsInt()
const;
596 std::string getStatusCodeString()
const;
615 void setVersion(
const std::string& newVersion);
631 static std::string parseVersion(
const char* data,
size_t dataLen);
636 int getSize()
const {
return m_FirstLineEndOffset; }
656 void setMessage(
const std::string &message) { m_Message = message; }
657 virtual const char* what()
const throw()
659 return m_Message.c_str();
662 std::string m_Message;
670 std::string m_Version;
672 int m_FirstLineEndOffset;
679 #endif // PACKETPP_SIP_LAYER Definition: SipLayer.h:357
Definition: SipLayer.h:267
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:333
Definition: SipLayer.h:325
Definition: SipLayer.h:411
Definition: SipLayer.h:295
Definition: SipLayer.h:393
Definition: SipLayer.h:319
bool isComplete() const
Definition: SipLayer.h:530
Definition: SipLayer.h:375
Definition: SipLayer.h:361
Definition: SipLayer.h:293
std::string getVersion() const
Definition: SipLayer.h:509
Definition: SipLayer.h:369
Definition: SipLayer.h:160
Definition: SipLayer.h:289
Definition: SipLayer.h:311
Definition: SipLayer.h:180
Definition: SipLayer.h:156
Definition: SipLayer.h:351
Definition: SipLayer.h:305
Definition: SipLayer.h:385
Definition: SipLayer.h:285
int getSize() const
Definition: SipLayer.h:522
Definition: SipLayer.h:401
Definition: SipLayer.h:397
Definition: SipLayer.h:168
Definition: SipLayer.h:287
Definition: SipLayer.h:263
Definition: SipLayer.h:367
Definition: SipLayer.h:315
Definition: SipLayer.h:343
Definition: SipLayer.h:317
Definition: SipLayer.h:335
Definition: SipLayer.h:353
SipResponseLayer::SipResponseStatusCode getStatusCode() const
Definition: SipLayer.h:586
Definition: SipLayer.h:337
Definition: SipLayer.h:74
Definition: SipLayer.h:273
static bool isSipPort(uint16_t port)
Definition: SipLayer.h:119
Definition: SipLayer.h:399
Definition: SipLayer.h:307
Definition: SipLayer.h:538
Definition: TextBasedProtocol.h:115
Definition: SipLayer.h:277
std::string getVersion() const
Definition: SipLayer.h:609
Definition: SipLayer.h:381
Definition: SipLayer.h:345
Definition: SipLayer.h:172
Definition: SipLayer.h:166
Definition: SipLayer.h:291
Definition: SipLayer.h:301
Definition: SipLayer.h:373
Definition: SipLayer.h:407
Definition: SipLayer.h:299
Definition: SipLayer.h:176
Definition: SipLayer.h:321
Definition: SipLayer.h:158
Definition: SipLayer.h:409
Definition: SipLayer.h:248
Definition: SipLayer.h:162
Definition: SipLayer.h:403
void computeCalculateFields()
Definition: SipLayer.h:347
Definition: SipLayer.h:303
Definition: SipLayer.h:383
SipRequestLayer::SipMethod getMethod() const
Definition: SipLayer.h:485
Definition: SipLayer.h:174
Definition: SipLayer.h:387
Definition: SipLayer.h:339
Definition: SipLayer.h:371
Definition: SipLayer.h:309
Definition: SipLayer.h:323
Definition: SipLayer.h:283
int getSize() const
Definition: SipLayer.h:636
Definition: SipLayer.h:379
SipMethod
Definition: SipLayer.h:153
Definition: SipLayer.h:333
Definition: SipLayer.h:405
SipResponseStatusCode
Definition: SipLayer.h:256
Definition: SipLayer.h:261
Definition: SipLayer.h:395
Definition: SipLayer.h:178
OsiModelLayer getOsiModelLayer() const
Definition: SipLayer.h:102
Definition: SipLayer.h:164
int getContentLength() const
Definition: SipLayer.h:259
Definition: ProtocolType.h:344
Definition: SipLayer.h:377
Definition: SipLayer.h:269
Definition: SipLayer.h:275
virtual std::string toString() const =0
Definition: SipLayer.h:297
Definition: SipLayer.h:313
Definition: SipLayer.h:349
Definition: SipLayer.h:331
Definition: SipLayer.h:652
Definition: SipLayer.h:170
Definition: SipLayer.h:265
Definition: SipLayer.h:579
Definition: SipLayer.h:389
Definition: SipLayer.h:359
Definition: SipLayer.h:391
SipResponseFirstLine * getFirstLine() const
Definition: SipLayer.h:455
Definition: SipLayer.h:327
Definition: SipLayer.h:355
HeaderField * setContentLength(int contentLength, const std::string &prevFieldName="")
Definition: SipLayer.h:271
bool isComplete() const
Definition: SipLayer.h:644
Definition: SipLayer.h:281
Definition: SipLayer.h:365
Definition: SipLayer.h:279
Definition: SipLayer.h:341
Definition: SipLayer.h:145
Definition: SipLayer.h:329
Definition: SipLayer.h:363
Definition: SipLayer.h:182
SipRequestFirstLine * getFirstLine() const
Definition: SipLayer.h:223
Definition: SipLayer.h:477