16 #define PCPP_SIP_FROM_FIELD "From"
18 #define PCPP_SIP_TO_FIELD "To"
20 #define PCPP_SIP_VIA_FIELD "Via"
22 #define PCPP_SIP_CALL_ID_FIELD "Call-ID"
24 #define PCPP_SIP_CONTENT_TYPE_FIELD "Content-Type"
26 #define PCPP_SIP_CONTENT_LENGTH_FIELD "Content-Length"
28 #define PCPP_SIP_CONTENT_DISPOSITION_FIELD "Content-Disposition"
30 #define PCPP_SIP_CONTENT_ENCODING_FIELD "Content-Encoding"
32 #define PCPP_SIP_CONTENT_LANGUAGE_FIELD "Content-Language"
34 #define PCPP_SIP_CSEQ_FIELD "CSeq"
36 #define PCPP_SIP_CONTACT_FIELD "Contact"
38 #define PCPP_SIP_MAX_FORWARDS_FIELD "Max-Forwards"
40 #define PCPP_SIP_USER_AGENT_FIELD "User-Agent"
42 #define PCPP_SIP_ACCEPT_FIELD "Accept"
44 #define PCPP_SIP_ACCEPT_ENCODING_FIELD "Accept-Encoding"
46 #define PCPP_SIP_ACCEPT_LANGUAGE_FIELD "Accept-Language"
48 #define PCPP_SIP_ALLOW_FIELD "Allow"
50 #define PCPP_SIP_AUTHORIZATION_FIELD "Authorization"
52 #define PCPP_SIP_DATE_FIELD "Date"
54 #define PCPP_SIP_MIME_VERSION_FIELD "MIME-Version"
56 #define PCPP_SIP_REASON_FIELD "Reason"
58 #define PCPP_SIP_SUPPORTED_FIELD "Supported"
60 #define PCPP_SIP_SERVER_FIELD "Server"
62 #define PCPP_SIP_WWW_AUTHENTICATE_FIELD "WWW-Authenticate"
64 #define PCPP_SIP_RETRY_AFTER_FIELD "Retry-After"
66 #define PCPP_SIP_RECORD_ROUTE_FIELD "Record-Route"
127 return port == 5060 || port == 5061;
134 SipLayer() : TextBasedProtocolMessage()
136 SipLayer(
const SipLayer& other) : TextBasedProtocolMessage(other)
138 SipLayer& operator=(
const SipLayer& other)
140 TextBasedProtocolMessage::operator=(other);
145 char getHeaderFieldNameValueSeparator()
const override
149 bool spacesAllowedBetweenHeaderFieldNameAndValue()
const override
155 class SipRequestFirstLine;
494 const std::string& sipVersion =
"SIP/2.0");
594 return m_FirstLineEndOffset;
619 void setMessage(
const std::string& message)
623 virtual const char* what()
const noexcept
625 return m_Message.c_str();
629 std::string m_Message;
635 const std::string& uri);
641 std::string m_Version;
644 int m_FirstLineEndOffset;
728 return m_FirstLineEndOffset;
753 void setMessage(
const std::string& message)
757 virtual const char* what()
const noexcept
759 return m_Message.c_str();
763 std::string m_Message;
772 std::string m_Version;
774 int m_FirstLineEndOffset;
Definition: SipLayer.h:74
void computeCalculateFields() override
OsiModelLayer getOsiModelLayer() const override
Definition: SipLayer.h:103
HeaderField * setContentLength(int contentLength, const std::string &prevFieldName="")
static bool isSipPort(uint16_t port)
Definition: SipLayer.h:125
int getContentLength() const
void parseNextLayer() override
Definition: SipLayer.h:615
Definition: SipLayer.h:540
std::string getVersion() const
Definition: SipLayer.h:576
bool setUri(const std::string &newUri)
bool isComplete() const
Definition: SipLayer.h:603
std::string getUri() const
int getSize() const
Definition: SipLayer.h:592
bool setMethod(SipRequestLayer::SipMethod newMethod)
static SipRequestLayer::SipMethod parseMethod(const char *data, size_t dataLen)
SipRequestLayer::SipMethod getMethod() const
Definition: SipLayer.h:547
Definition: SipLayer.h:167
SipRequestLayer(const SipRequestLayer &other)
SipRequestLayer & operator=(const SipRequestLayer &other)
SipRequestFirstLine * getFirstLine() const
Definition: SipLayer.h:244
SipRequestLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
std::string toString() const override
SipRequestLayer(SipMethod method, const std::string &requestUri, const std::string &version="SIP/2.0")
SipMethod
Definition: SipLayer.h:175
@ SipMESSAGE
Definition: SipLayer.h:201
@ SipSUBSCRIBE
Definition: SipLayer.h:191
@ SipINFO
Definition: SipLayer.h:197
@ SipUPDATE
Definition: SipLayer.h:203
@ SipPUBLISH
Definition: SipLayer.h:195
@ SipCANCEL
Definition: SipLayer.h:183
@ SipINVITE
Definition: SipLayer.h:177
@ SipNOTIFY
Definition: SipLayer.h:193
@ SipPRACK
Definition: SipLayer.h:187
@ SipOPTIONS
Definition: SipLayer.h:189
@ SipREGISTER
Definition: SipLayer.h:185
@ SipMethodUnknown
Definition: SipLayer.h:205
@ SipACK
Definition: SipLayer.h:179
@ SipREFER
Definition: SipLayer.h:199
@ SipBYE
Definition: SipLayer.h:181
Definition: SipLayer.h:749
Definition: SipLayer.h:661
static SipResponseLayer::SipResponseStatusCode parseStatusCode(const char *data, size_t dataLen)
static std::string parseVersion(const char *data, size_t dataLen)
bool setStatusCode(SipResponseLayer::SipResponseStatusCode newStatusCode, std::string statusCodeString="")
SipResponseLayer::SipResponseStatusCode getStatusCode() const
Definition: SipLayer.h:668
int getStatusCodeAsInt() const
void setVersion(const std::string &newVersion)
int getSize() const
Definition: SipLayer.h:726
bool isComplete() const
Definition: SipLayer.h:737
std::string getVersion() const
Definition: SipLayer.h:695
std::string getStatusCodeString() const
Definition: SipLayer.h:269
SipResponseStatusCode
Definition: SipLayer.h:278
@ Sip416UnsupportedURIScheme
Definition: SipLayer.h:354
@ Sip608Rejected
Definition: SipLayer.h:469
@ Sip415UnsupportedMediaType
Definition: SipLayer.h:352
@ Sip420BadExtension
Definition: SipLayer.h:358
@ Sip428UseIdentityHeader
Definition: SipLayer.h:371
@ Sip502BadGateway
Definition: SipLayer.h:437
@ Sip181CallisBeingForwarded
Definition: SipLayer.h:285
@ Sip503ServiceUnavailable
Definition: SipLayer.h:440
@ Sip183SessioninProgress
Definition: SipLayer.h:290
@ Sip301MovedPermanently
Definition: SipLayer.h:306
@ Sip414RequestURITooLong
Definition: SipLayer.h:350
@ Sip555PushNotificationServiceNotSupported
Definition: SipLayer.h:450
@ Sip504ServerTimeout
Definition: SipLayer.h:443
@ Sip380AlternativeService
Definition: SipLayer.h:313
@ Sip600BusyEverywhere
Definition: SipLayer.h:455
@ Sip202Accepted
Definition: SipLayer.h:298
@ Sip500ServerInternalError
Definition: SipLayer.h:430
@ Sip493Undecipherable
Definition: SipLayer.h:424
@ Sip412ConditionalRequestFailed
Definition: SipLayer.h:345
@ Sip402PaymentRequired
Definition: SipLayer.h:319
@ Sip436BadIdentityInfo
Definition: SipLayer.h:381
@ Sip422SessionIntervalTooSmall
Definition: SipLayer.h:362
@ Sip406NotAcceptable
Definition: SipLayer.h:331
@ Sip180Ringing
Definition: SipLayer.h:283
@ Sip470ConsentNeeded
Definition: SipLayer.h:400
@ Sip199EarlyDialogTerminated
Definition: SipLayer.h:293
@ Sip305UseProxy
Definition: SipLayer.h:311
@ Sip604DoesNotExistAnywhere
Definition: SipLayer.h:461
@ Sip424BadLocationInformation
Definition: SipLayer.h:366
@ Sip400BadRequest
Definition: SipLayer.h:315
@ Sip486BusyHere
Definition: SipLayer.h:414
@ Sip484AddressIncomplete
Definition: SipLayer.h:410
@ Sip413RequestEntityTooLarge
Definition: SipLayer.h:347
@ Sip433AnonymityDisallowed
Definition: SipLayer.h:379
@ Sip501NotImplemented
Definition: SipLayer.h:434
@ Sip491RequestPending
Definition: SipLayer.h:422
@ Sip429ProvideReferrerIdentity
Definition: SipLayer.h:373
@ Sip408RequestTimeout
Definition: SipLayer.h:337
@ Sip603Decline
Definition: SipLayer.h:459
@ Sip440MaxBreadthExceeded
Definition: SipLayer.h:394
@ Sip439FirstHopLacksOutboundSupport
Definition: SipLayer.h:389
@ Sip480TemporarilyUnavailable
Definition: SipLayer.h:402
@ Sip481Call_TransactionDoesNotExist
Definition: SipLayer.h:404
@ Sip409Conflict
Definition: SipLayer.h:339
@ Sip606NotAcceptable
Definition: SipLayer.h:464
@ Sip403Forbidden
Definition: SipLayer.h:321
@ Sip421ExtensionRequired
Definition: SipLayer.h:360
@ Sip487RequestTerminated
Definition: SipLayer.h:416
@ Sip404NotFound
Definition: SipLayer.h:325
@ Sip100Trying
Definition: SipLayer.h:281
@ Sip411LengthRequired
Definition: SipLayer.h:343
@ Sip407ProxyAuthenticationRequired
Definition: SipLayer.h:333
@ Sip204NoNotification
Definition: SipLayer.h:300
@ Sip494SecurityAgreementRequired
Definition: SipLayer.h:428
@ Sip437UnsupportedCertificate
Definition: SipLayer.h:383
@ Sip488NotAcceptableHere
Definition: SipLayer.h:418
@ Sip417UnknownResourcePriority
Definition: SipLayer.h:356
@ Sip405MethodNotAllowed
Definition: SipLayer.h:328
@ SipStatusCodeUnknown
Definition: SipLayer.h:471
@ Sip430FlowFailed
Definition: SipLayer.h:377
@ Sip469BadInfoPackage
Definition: SipLayer.h:398
@ Sip302MovedTemporarily
Definition: SipLayer.h:309
@ Sip489BadEvent
Definition: SipLayer.h:420
@ Sip410Gone
Definition: SipLayer.h:341
@ Sip300MultipleChoices
Definition: SipLayer.h:303
@ Sip482LoopDetected
Definition: SipLayer.h:406
@ Sip483TooManyHops
Definition: SipLayer.h:408
@ Sip513MessageTooLarge
Definition: SipLayer.h:447
@ Sip580PreconditionFailure
Definition: SipLayer.h:452
@ Sip401Unauthorized
Definition: SipLayer.h:317
@ Sip438InvalidIdentityHeader
Definition: SipLayer.h:386
@ Sip485Ambiguous
Definition: SipLayer.h:412
@ Sip607Unwanted
Definition: SipLayer.h:467
@ Sip425BadAlertMessage
Definition: SipLayer.h:369
@ Sip200OK
Definition: SipLayer.h:295
@ Sip182Queued
Definition: SipLayer.h:288
@ Sip423IntervalTooBrief
Definition: SipLayer.h:364
@ Sip505VersionNotSupported
Definition: SipLayer.h:445
std::string toString() const override
SipResponseLayer(SipResponseLayer::SipResponseStatusCode statusCode, std::string statusCodeString="", const std::string &sipVersion="SIP/2.0")
SipResponseLayer & operator=(const SipResponseLayer &other)
SipResponseFirstLine * getFirstLine() const
Definition: SipLayer.h:515
SipResponseLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
SipResponseLayer(const SipResponseLayer &other)
Definition: TextBasedProtocol.h:123
The main namespace for the PcapPlusPlus lib.
uint8_t ProtocolType
Definition: ProtocolType.h:17
OsiModelLayer
Definition: ProtocolType.h:364
@ OsiModelSesionLayer
Definition: ProtocolType.h:374