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" 117 SipLayer() : TextBasedProtocolMessage() {}
118 SipLayer(
const SipLayer& other) : TextBasedProtocolMessage(other) {}
119 SipLayer& operator=(
const SipLayer& other) { TextBasedProtocolMessage::operator=(other);
return *
this; }
122 char getHeaderFieldNameValueSeparator() {
return ':'; }
123 bool spacesAllowedBetweenHeaderFieldNameAndValue() {
return true; }
128 class SipRequestFirstLine;
231 class SipResponseFirstLine;
493 bool setUri(std::string newUri);
511 inline int getSize() {
return m_FirstLineEndOffset; }
531 void setMessage(std::string message) { m_Message = message; }
532 virtual const char* what()
const throw()
534 return m_Message.c_str();
537 std::string m_Message;
549 std::string m_Version;
552 int m_FirstLineEndOffset;
618 inline int getSize() {
return m_FirstLineEndOffset; }
638 void setMessage(std::string message) { m_Message = message; }
639 virtual const char* what()
const throw()
641 return m_Message.c_str();
644 std::string m_Message;
651 static std::string parseVersion(
char* data,
size_t dataLen);
656 std::string m_Version;
658 int m_FirstLineEndOffset;
665 #endif // PACKETPP_SIP_LAYER bool setUri(std::string newUri)
Definition: SipLayer.h:177
Definition: SipLayer.h:260
Definition: SipLayer.h:328
Definition: SipLayer.h:151
Definition: SipLayer.h:159
Definition: SipLayer.h:282
Definition: SipLayer.h:316
Definition: SipLayer.h:402
Definition: SipLayer.h:398
Definition: SipLayer.h:384
Definition: SipLayer.h:284
SipResponseFirstLine * getFirstLine()
Definition: SipLayer.h:444
Definition: SipLayer.h:344
Definition: SipLayer.h:280
Definition: SipLayer.h:569
Definition: SipLayer.h:243
SipResponseLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
Definition: SipLayer.h:256
Definition: TextBasedProtocol.h:104
Definition: SipLayer.h:332
SipResponseLayer::SipResponseStatusCode getStatusCode()
Definition: SipLayer.h:576
bool isComplete()
Definition: SipLayer.h:519
int getSize()
Definition: SipLayer.h:618
Definition: SipLayer.h:290
SipRequestLayer::SipMethod getMethod()
Definition: SipLayer.h:474
Definition: SipLayer.h:394
std::string getVersion()
Definition: SipLayer.h:599
Definition: SipLayer.h:527
Definition: SipLayer.h:268
Definition: SipLayer.h:378
Definition: SipLayer.h:338
Definition: SipLayer.h:322
Definition: SipLayer.h:140
The main namespace for the PcapPlusPlus lib.
Definition: TextBasedProtocol.h:31
Definition: SipLayer.h:276
Definition: SipLayer.h:278
Definition: SipLayer.h:298
Definition: SipLayer.h:390
Definition: SipLayer.h:310
Definition: SipLayer.h:294
Definition: SipLayer.h:169
Definition: SipLayer.h:300
Definition: SipLayer.h:274
Definition: SipLayer.h:330
Definition: SipLayer.h:388
Definition: SipLayer.h:312
Definition: SipLayer.h:634
Definition: SipLayer.h:386
Definition: SipLayer.h:286
OsiModelLayer
Definition: ProtocolType.h:208
Definition: SipLayer.h:173
Definition: SipLayer.h:264
Definition: SipLayer.h:167
Definition: SipLayer.h:366
Definition: SipLayer.h:340
Definition: SipLayer.h:380
Definition: SipLayer.h:163
SipRequestLayer & operator=(const SipRequestLayer &other)
void setVersion(std::string newVersion)
SipResponseLayer & operator=(const SipResponseLayer &other)
Definition: SipLayer.h:358
Definition: SipLayer.h:356
Definition: SipLayer.h:288
Definition: SipLayer.h:350
Definition: SipLayer.h:74
Definition: SipLayer.h:258
std::string getVersion()
Definition: SipLayer.h:498
Definition: SipLayer.h:314
Definition: SipLayer.h:352
SipRequestLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
void computeCalculateFields()
Definition: SipLayer.h:370
Definition: SipLayer.h:318
Definition: SipLayer.h:304
HeaderField * setContentLength(int contentLength, const std::string prevFieldName="")
Definition: SipLayer.h:354
Definition: SipLayer.h:308
OsiModelLayer getOsiModelLayer()
Definition: SipLayer.h:102
Definition: SipLayer.h:306
Definition: SipLayer.h:171
Definition: SipLayer.h:266
Definition: SipLayer.h:324
Definition: SipLayer.h:254
Definition: SipLayer.h:334
Definition: SipLayer.h:155
bool isComplete()
Definition: SipLayer.h:626
Definition: SipLayer.h:376
Definition: SipLayer.h:157
Definition: ProtocolType.h:219
Definition: SipLayer.h:382
int getSize()
Definition: SipLayer.h:511
Definition: SipLayer.h:392
Definition: SipLayer.h:342
Definition: SipLayer.h:175
SipResponseStatusCode
Definition: SipLayer.h:251
Definition: SipLayer.h:346
Definition: SipLayer.h:372
Definition: SipLayer.h:362
Definition: SipLayer.h:302
Definition: SipLayer.h:272
Definition: SipLayer.h:326
Definition: SipLayer.h:270
Definition: SipLayer.h:396
Definition: SipLayer.h:360
Definition: SipLayer.h:262
bool setStatusCode(SipResponseLayer::SipResponseStatusCode newStatusCode, std::string statusCodeString="")
Definition: SipLayer.h:400
Definition: SipLayer.h:374
Definition: SipLayer.h:466
Definition: SipLayer.h:320
SipRequestFirstLine * getFirstLine()
Definition: SipLayer.h:218
Definition: SipLayer.h:179
Definition: SipLayer.h:165
Definition: SipLayer.h:336
SipMethod
Definition: SipLayer.h:148
Definition: SipLayer.h:348
Definition: SipLayer.h:161
Definition: SipLayer.h:368
std::string getStatusCodeString()
Definition: SipLayer.h:296
bool setMethod(SipRequestLayer::SipMethod newMethod)
Definition: SipLayer.h:292
Definition: SipLayer.h:364
static SipResponseLayer::SipResponseStatusCode parseStatusCode(char *data, size_t dataLen)
static SipRequestLayer::SipMethod parseMethod(char *data, size_t dataLen)
Definition: SipLayer.h:153