|
PcapPlusPlus
Next
|
#include <SipLayer.h>
Public Member Functions | |
| int | getContentLength () const |
| HeaderField * | setContentLength (int contentLength, const std::string &prevFieldName="") |
| OsiModelLayer | getOsiModelLayer () const override |
| void | parseNextLayer () override |
| void | computeCalculateFields () override |
Public Member Functions inherited from pcpp::Layer | |
| ~Layer () override | |
| Layer * | getNextLayer () const |
| Layer * | getPrevLayer () const |
| ProtocolType | getProtocol () const |
| bool | isMemberOfProtocolFamily (ProtocolTypeFamily protocolTypeFamily) const |
| uint8_t * | getData () const |
| size_t | getDataLen () const |
| uint8_t * | getLayerPayload () const |
| size_t | getLayerPayloadSize () const |
| bool | isAllocatedToPacket () const |
| void | copyData (uint8_t *toArr) const |
| uint8_t * | getDataPtr (size_t offset=0) const override |
| virtual std::string | toString () const =0 |
Static Public Member Functions | |
| static bool | isSipPort (uint16_t port) |
| static SipLayer * | parseSipLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet, uint16_t srcPort, uint16_t dstPort) |
| static SipLayer * | parseSipLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) |
Additional Inherited Members | |
Protected Member Functions inherited from pcpp::Layer | |
| Packet * | getAttachedPacket () |
| Get a pointer to the Packet this layer is attached to (if any). More... | |
| Packet const * | getAttachedPacket () const |
| Get a pointer to the Packet this layer is attached to (if any). More... | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Construct the next layer in the protocol stack. No validation is performed on the data. More... | |
| template<typename T , typename... Args> | |
| Layer * | constructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename TFactory , typename... Args> | |
| Layer * | constructNextLayerFromFactory (TFactory factoryFn, uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Construct the next layer in the protocol stack using a factory functor. More... | |
| template<typename TFactory , typename... Args> | |
| Layer * | constructNextLayerFromFactory (TFactory factoryFn, uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| Construct the next layer in the protocol stack using a factory functor. More... | |
| template<typename T , typename... Args> | |
| Layer * | tryConstructNextLayer (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| template<typename T , typename... Args> | |
| Layer * | tryConstructNextLayer (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack with a fallback option. More... | |
| template<typename T , typename TFallback , typename... Args> | |
| Layer * | tryConstructNextLayerWithFallback (uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| template<typename TFallback , typename TFactory , typename... Args> | |
| Layer * | tryConstructNextLayerFromFactoryWithFallback (TFactory factoryFn, uint8_t *data, size_t dataLen, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack using a factory functor with a fallback option. More... | |
| template<typename TFallback , typename TFactory , typename... Args> | |
| Layer * | tryConstructNextLayerFromFactoryWithFallback (TFactory factoryFn, uint8_t *data, size_t dataLen, Packet *packet, Args &&... extraArgs) |
| Try to construct the next layer in the protocol stack using a factory functor with a fallback option. More... | |
Static Protected Member Functions inherited from pcpp::Layer | |
| template<typename T > | |
| static bool | canReinterpretAs (const uint8_t *data, size_t dataLen) |
| Check if the data is large enough to reinterpret as a type. More... | |
Represents a general SIP message. It's an abstract class and cannot be instantiated. It's inherited by SipRequestLayer and SipResponseLayer
|
overridevirtual |
Set the content-length only if a content-length field already exists and if its current value is different than the total length of the next layer(s)
Implements pcpp::Layer.
| int pcpp::SipLayer::getContentLength | ( | ) | const |
The length of the body of many SIP response messages is determined by a SIP header field called "Content-Length". This method parses this field, extracts its value and return it. If this field doesn't exist 0 is returned
|
inlineoverridevirtual |
Implements pcpp::Layer.
|
inlinestatic |
A static method that checks whether the port is considered as SIP
| [in] | port | The port number to be checked |
|
overridevirtual |
Currently identifies only SDP if content-length field exists and set to a value greater than zero. If content-length field doesn't exist or set to zero and still there is data after this layer, a PayloadLayer will be created
Implements pcpp::Layer.
|
static |
A static factory method that attempts to create a SIP layer from existing packet raw data This method does not check source or destination ports. Instead, it uses heuristics to determine whether the data represents a SIP request or response.
| [in] | data | A pointer to the raw data |
| [in] | dataLen | Size of the data in bytes |
| [in] | prevLayer | A pointer to the previous layer |
| [in] | packet | A pointer to the Packet instance where layer will be stored in |
|
static |
A static factory method that attempts to create a SIP layer from existing packet raw data The method first checks whether the source or destination port matches the SIP protocol.
| [in] | data | A pointer to the raw data |
| [in] | dataLen | Size of the data in bytes |
| [in] | prevLayer | A pointer to the previous layer |
| [in] | packet | A pointer to the Packet instance where layer will be stored in |
| [in] | srcPort | Source port number to check |
| [in] | dstPort | Dest port number to check |
| HeaderField* pcpp::SipLayer::setContentLength | ( | int | contentLength, |
| const std::string & | prevFieldName = "" |
||
| ) |
The length of the body of many SIP messages is determined by a header field called "Content-Length". This method sets The content-length field value. The method supports several cases:
| [in] | contentLength | The content length value to set |
| [in] | prevFieldName | Optional parameter, if specified and "Content-Length" field doesn't exist, it will be created after this field |