|
PcapPlusPlus
20.08
|
Go to the documentation of this file. 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; }
123 SipLayer() : TextBasedProtocolMessage() {}
124 SipLayer(
const SipLayer& other) : TextBasedProtocolMessage(other) {}
125 SipLayer& operator=(
const SipLayer& other) { TextBasedProtocolMessage::operator=(other);
return *
this; }
128 char getHeaderFieldNameValueSeparator()
const {
return ':'; }
129 bool spacesAllowedBetweenHeaderFieldNameAndValue()
const {
return true; }
133 class SipRequestFirstLine;
236 class SipResponseFirstLine;
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;
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
@ Sip470ConsentNeeded
Definition: SipLayer.h:353
int getContentLength() const
OsiModelLayer
Definition: ProtocolType.h:233
bool isComplete() const
Definition: SipLayer.h:639
void setVersion(std::string newVersion)
@ Sip305UseProxy
Definition: SipLayer.h:283
Definition: SipLayer.h:532
@ Sip424BadLocationInformation
Definition: SipLayer.h:331
@ SipINFO
Definition: SipLayer.h:176
@ Sip421ExtensionRequired
Definition: SipLayer.h:325
@ Sip415UnsupportedMediaType
Definition: SipLayer.h:317
@ Sip604DoesNotExistAnywhere
Definition: SipLayer.h:401
int getStatusCodeAsInt() const
int getSize() const
Definition: SipLayer.h:516
bool isComplete() const
Definition: SipLayer.h:524
@ Sip414RequestURITooLong
Definition: SipLayer.h:315
@ Sip469BadInfoPackage
Definition: SipLayer.h:351
@ Sip430FlowFailed
Definition: SipLayer.h:337
@ Sip487RequestTerminated
Definition: SipLayer.h:369
bool setMethod(SipRequestLayer::SipMethod newMethod)
@ Sip429ProvideReferrerIdentity
Definition: SipLayer.h:335
@ Sip440MaxBreadthExceeded
Definition: SipLayer.h:349
@ Sip438InvalidIdentityHeader
Definition: SipLayer.h:345
@ SipCANCEL
Definition: SipLayer.h:162
@ Sip401Unauthorized
Definition: SipLayer.h:289
@ Sip416UnsupportedURIScheme
Definition: SipLayer.h:319
std::string getVersion() const
Definition: SipLayer.h:604
@ Sip403Forbidden
Definition: SipLayer.h:293
@ Sip580PreconditionFailure
Definition: SipLayer.h:395
@ Sip486BusyHere
Definition: SipLayer.h:367
SipResponseLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
@ SipREFER
Definition: SipLayer.h:178
@ SipINVITE
Definition: SipLayer.h:156
@ Sip204NoNotification
Definition: SipLayer.h:275
OsiModelLayer getOsiModelLayer() const
Definition: SipLayer.h:102
Definition: SipLayer.h:248
@ Sip488NotAcceptableHere
Definition: SipLayer.h:371
@ Sip405MethodNotAllowed
Definition: SipLayer.h:297
SipResponseLayer::SipResponseStatusCode getStatusCode() const
Definition: SipLayer.h:581
@ Sip410Gone
Definition: SipLayer.h:307
SipResponseLayer & operator=(const SipResponseLayer &other)
SipRequestLayer::SipMethod getMethod() const
Definition: SipLayer.h:479
static SipRequestLayer::SipMethod parseMethod(char *data, size_t dataLen)
@ Sip433AnonymityDisallowed
Definition: SipLayer.h:339
bool setUri(std::string newUri)
@ Sip301MovedPermanently
Definition: SipLayer.h:279
SipRequestFirstLine * getFirstLine() const
Definition: SipLayer.h:223
@ SipBYE
Definition: SipLayer.h:160
Definition: SipLayer.h:574
@ Sip484AddressIncomplete
Definition: SipLayer.h:363
@ Sip402PaymentRequired
Definition: SipLayer.h:291
@ Sip607Unwanted
Definition: SipLayer.h:405
@ Sip482LoopDetected
Definition: SipLayer.h:359
@ Sip417UnknownResourcePriority
Definition: SipLayer.h:321
@ Sip413RequestEntityTooLarge
Definition: SipLayer.h:313
static std::string parseVersion(char *data, size_t dataLen)
@ Sip422SessionIntervalTooSmall
Definition: SipLayer.h:327
@ Sip489BadEvent
Definition: SipLayer.h:373
@ Sip412ConditionalRequestFailed
Definition: SipLayer.h:311
HeaderField * setContentLength(int contentLength, const std::string prevFieldName="")
@ Sip501NotImplemented
Definition: SipLayer.h:383
@ Sip423IntervalTooBrief
Definition: SipLayer.h:329
@ Sip200OK
Definition: SipLayer.h:271
Definition: SipLayer.h:74
@ Sip409Conflict
Definition: SipLayer.h:305
@ Sip505VersionNotSupported
Definition: SipLayer.h:391
@ Sip180Ringing
Definition: SipLayer.h:261
Definition: SipLayer.h:145
@ SipOPTIONS
Definition: SipLayer.h:168
std::string toString() const
SipRequestLayer & operator=(const SipRequestLayer &other)
@ Sip406NotAcceptable
Definition: SipLayer.h:299
@ Sip500ServerInternalError
Definition: SipLayer.h:381
@ Sip400BadRequest
Definition: SipLayer.h:287
static SipResponseLayer::SipResponseStatusCode parseStatusCode(char *data, size_t dataLen)
SipResponseStatusCode
Definition: SipLayer.h:256
@ Sip513MessageTooLarge
Definition: SipLayer.h:393
@ SipUPDATE
Definition: SipLayer.h:182
@ Sip420BadExtension
Definition: SipLayer.h:323
@ SipNOTIFY
Definition: SipLayer.h:172
@ Sip502BadGateway
Definition: SipLayer.h:385
Definition: TextBasedProtocol.h:113
@ Sip181CallisBeingForwarded
Definition: SipLayer.h:263
@ Sip436BadIdentityInfo
Definition: SipLayer.h:341
The main namespace for the PcapPlusPlus lib.
@ Sip100Trying
Definition: SipLayer.h:259
@ OsiModelSesionLayer
Definition: ProtocolType.h:244
@ Sip485Ambiguous
Definition: SipLayer.h:365
@ Sip600BusyEverywhere
Definition: SipLayer.h:397
void computeCalculateFields()
std::string getUri() const
@ Sip300MultipleChoices
Definition: SipLayer.h:277
@ Sip494SecurityAgreementRequired
Definition: SipLayer.h:379
@ Sip481Call_TransactionDoesNotExist
Definition: SipLayer.h:357
@ SipMESSAGE
Definition: SipLayer.h:180
@ Sip504ServerTimeout
Definition: SipLayer.h:389
@ Sip439FirstHopLacksOutboundSupport
Definition: SipLayer.h:347
@ Sip202Accepted
Definition: SipLayer.h:273
@ Sip380AlternativeService
Definition: SipLayer.h:285
@ Sip199EarlyDialogTerminated
Definition: SipLayer.h:269
SipRequestLayer(uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet)
static bool isSipPort(uint16_t port)
Definition: SipLayer.h:119
int getSize() const
Definition: SipLayer.h:631
@ Sip182Queued
Definition: SipLayer.h:265
@ SipStatusCodeUnknown
Definition: SipLayer.h:407
std::string getStatusCodeString() const
@ Sip437UnsupportedCertificate
Definition: SipLayer.h:343
SipResponseFirstLine * getFirstLine() const
Definition: SipLayer.h:449
std::string toString() const
@ Sip503ServiceUnavailable
Definition: SipLayer.h:387
bool setStatusCode(SipResponseLayer::SipResponseStatusCode newStatusCode, std::string statusCodeString="")
@ SipREGISTER
Definition: SipLayer.h:164
@ Sip428UseIdentityHeader
Definition: SipLayer.h:333
@ SipACK
Definition: SipLayer.h:158
@ Sip491RequestPending
Definition: SipLayer.h:375
@ SipPUBLISH
Definition: SipLayer.h:174
Definition: SipLayer.h:647
@ Sip493Undecipherable
Definition: SipLayer.h:377
@ Sip302MovedTemporarily
Definition: SipLayer.h:281
std::string getVersion() const
Definition: SipLayer.h:503
@ Sip408RequestTimeout
Definition: SipLayer.h:303
SipMethod
Definition: SipLayer.h:153
@ Sip183SessioninProgress
Definition: SipLayer.h:267
@ Sip407ProxyAuthenticationRequired
Definition: SipLayer.h:301
Definition: SipLayer.h:471
@ Sip480TemporarilyUnavailable
Definition: SipLayer.h:355
@ Sip411LengthRequired
Definition: SipLayer.h:309
@ SipMethodUnknown
Definition: SipLayer.h:184
@ SipPRACK
Definition: SipLayer.h:166
@ SipSUBSCRIBE
Definition: SipLayer.h:170
@ Sip483TooManyHops
Definition: SipLayer.h:361
@ Sip606NotAcceptable
Definition: SipLayer.h:403
@ Sip603Decline
Definition: SipLayer.h:399
@ Sip404NotFound
Definition: SipLayer.h:295