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; }
491 std::string getUri()
const;
498 bool setUri(std::string newUri);
516 int getSize()
const {
return m_FirstLineEndOffset; }
536 void setMessage(std::string message) { m_Message = message; }
537 virtual const char* what()
const throw()
539 return m_Message.c_str();
542 std::string m_Message;
554 std::string m_Version;
557 int m_FirstLineEndOffset;
586 int getStatusCodeAsInt()
const;
591 std::string getStatusCodeString()
const;
610 void setVersion(std::string newVersion);
626 static std::string parseVersion(
char* data,
size_t dataLen);
631 int getSize()
const {
return m_FirstLineEndOffset; }
651 void setMessage(std::string message) { m_Message = message; }
652 virtual const char* what()
const throw()
654 return m_Message.c_str();
657 std::string m_Message;
668 std::string m_Version;
670 int m_FirstLineEndOffset;
677 #endif // PACKETPP_SIP_LAYER Definition: SipLayer.h:355
Definition: SipLayer.h:267
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
Definition: ProtocolType.h:253
Definition: SipLayer.h:325
Definition: SipLayer.h:295
Definition: SipLayer.h:391
Definition: SipLayer.h:319
HeaderField * setContentLength(int contentLength, const std::string prevFieldName="")
bool isComplete() const
Definition: SipLayer.h:524
Definition: SipLayer.h:373
Definition: SipLayer.h:359
Definition: SipLayer.h:293
std::string getVersion() const
Definition: SipLayer.h:503
Definition: SipLayer.h:367
Definition: SipLayer.h:160
Definition: SipLayer.h:289
Definition: SipLayer.h:311
Definition: SipLayer.h:180
Definition: SipLayer.h:156
Definition: SipLayer.h:349
Definition: SipLayer.h:305
Definition: SipLayer.h:383
Definition: SipLayer.h:285
int getSize() const
Definition: SipLayer.h:516
Definition: SipLayer.h:397
Definition: SipLayer.h:168
Definition: SipLayer.h:287
Definition: SipLayer.h:263
Definition: SipLayer.h:365
Definition: SipLayer.h:315
Definition: SipLayer.h:341
Definition: SipLayer.h:317
Definition: SipLayer.h:333
Definition: SipLayer.h:351
SipResponseLayer::SipResponseStatusCode getStatusCode() const
Definition: SipLayer.h:581
Definition: SipLayer.h:335
Definition: SipLayer.h:74
Definition: SipLayer.h:273
static bool isSipPort(uint16_t port)
Definition: SipLayer.h:119
Definition: SipLayer.h:395
Definition: SipLayer.h:307
Definition: SipLayer.h:532
Definition: TextBasedProtocol.h:113
Definition: SipLayer.h:277
std::string getVersion() const
Definition: SipLayer.h:604
Definition: SipLayer.h:379
Definition: SipLayer.h:343
Definition: SipLayer.h:172
Definition: SipLayer.h:166
Definition: SipLayer.h:291
Definition: SipLayer.h:301
Definition: SipLayer.h:371
Definition: SipLayer.h:403
Definition: SipLayer.h:299
Definition: SipLayer.h:176
Definition: SipLayer.h:321
Definition: SipLayer.h:158
Definition: SipLayer.h:405
Definition: SipLayer.h:248
Definition: SipLayer.h:162
Definition: SipLayer.h:399
void computeCalculateFields()
Definition: SipLayer.h:345
Definition: SipLayer.h:303
Definition: SipLayer.h:381
SipRequestLayer::SipMethod getMethod() const
Definition: SipLayer.h:479
Definition: SipLayer.h:174
Definition: SipLayer.h:385
Definition: SipLayer.h:337
Definition: SipLayer.h:369
Definition: SipLayer.h:309
Definition: SipLayer.h:323
Definition: SipLayer.h:283
int getSize() const
Definition: SipLayer.h:631
Definition: SipLayer.h:377
SipMethod
Definition: SipLayer.h:153
Definition: SipLayer.h:401
SipResponseStatusCode
Definition: SipLayer.h:256
Definition: SipLayer.h:261
Definition: SipLayer.h:393
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:264
Definition: SipLayer.h:375
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:347
Definition: SipLayer.h:331
Definition: SipLayer.h:647
Definition: SipLayer.h:170
Definition: SipLayer.h:265
Definition: SipLayer.h:574
Definition: SipLayer.h:387
Definition: SipLayer.h:357
Definition: SipLayer.h:389
SipResponseFirstLine * getFirstLine() const
Definition: SipLayer.h:449
Definition: SipLayer.h:327
Definition: SipLayer.h:353
Definition: SipLayer.h:271
bool isComplete() const
Definition: SipLayer.h:639
Definition: SipLayer.h:281
Definition: SipLayer.h:363
Definition: SipLayer.h:279
Definition: SipLayer.h:339
Definition: SipLayer.h:145
Definition: SipLayer.h:329
Definition: SipLayer.h:361
Definition: SipLayer.h:182
SipRequestFirstLine * getFirstLine() const
Definition: SipLayer.h:223
Definition: SipLayer.h:471