PcapPlusPlus
|
#include <SipLayer.h>
Public Types | |
enum | SipMethod { SipINVITE, SipACK, SipBYE, SipCANCEL, SipREGISTER, SipPRACK, SipOPTIONS, SipSUBSCRIBE, SipNOTIFY, SipPUBLISH, SipINFO, SipREFER, SipMESSAGE, SipUPDATE, SipMethodUnknown } |
Public Member Functions | |
SipRequestLayer (uint8_t *data, size_t dataLen, Layer *prevLayer, Packet *packet) | |
SipRequestLayer (SipMethod method, std::string requestUri, std::string version="SIP/2.0") | |
SipRequestLayer (const SipRequestLayer &other) | |
SipRequestLayer & | operator= (const SipRequestLayer &other) |
SipRequestFirstLine * | getFirstLine () |
std::string | toString () |
![]() | |
int | getContentLength () |
HeaderField * | setContentLength (int contentLength, const std::string prevFieldName="") |
OsiModelLayer | getOsiModelLayer () |
void | parseNextLayer () |
void | computeCalculateFields () |
![]() | |
HeaderField * | getFieldByName (std::string fieldName, int index=0) |
HeaderField * | getFirstField () |
HeaderField * | getNextField (HeaderField *prevField) |
int | getFieldCount () |
virtual HeaderField * | addField (const std::string &fieldName, const std::string &fieldValue) |
virtual HeaderField * | addField (const HeaderField &newField) |
HeaderField * | addEndOfHeader () |
virtual HeaderField * | insertField (HeaderField *prevField, const std::string &fieldName, const std::string &fieldValue) |
virtual HeaderField * | insertField (std::string prevFieldName, const std::string &fieldName, const std::string &fieldValue) |
virtual HeaderField * | insertField (HeaderField *prevField, const HeaderField &newField) |
bool | removeField (HeaderField *fieldToRemove) |
bool | removeField (std::string fieldName, int index=0) |
bool | isHeaderComplete () |
size_t | getHeaderLen () |
![]() | |
virtual | ~Layer () |
Layer * | getNextLayer () |
Layer * | getPrevLayer () |
ProtocolType | getProtocol () |
uint8_t * | getData () |
size_t | getDataLen () |
uint8_t * | getLayerPayload () |
size_t | getLayerPayloadSize () |
bool | isAllocatedToPacket () |
void | copyData (uint8_t *toArr) |
uint8_t * | getDataPtr (size_t offset=0) |
Represents a SIP request header and inherits all basic functionality of SipLayer and TextBasedProtocolMessage. The functionality that is added for this class is the SIP first line concept. A SIP request has the following first line: INVITE sip:bla@b:12345 SIP/2.0 Since it's not an "ordinary" header field, it requires a special treatment and gets a class of it's own: la.c omSipRequestFirstLine. In most cases a SIP request will be contained in a single packet but for cases it is not, only the first packet will be identified as SIP request layer. You can find out whether the header is complete by using SipLayer::isHeaderComplete()
pcpp::SipRequestLayer::SipRequestLayer | ( | uint8_t * | data, |
size_t | dataLen, | ||
Layer * | prevLayer, | ||
Packet * | packet | ||
) |
A constructor that creates the layer from an existing packet raw data
[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 |
pcpp::SipRequestLayer::SipRequestLayer | ( | SipMethod | method, |
std::string | requestUri, | ||
std::string | version = "SIP/2.0" |
||
) |
A constructor that allocates a new SIP request with only the first line filled. The request will be created without further fields. The user can then add fields using addField() or insertField() methods
[in] | method | The SIP method to be used in this SIP request |
[in] | requestUri | The URI of the request |
[in] | version | SIP version to be used in this request. Default is "SIP/2.0" |
pcpp::SipRequestLayer::SipRequestLayer | ( | const SipRequestLayer & | other | ) |
A copy constructor for this layer. Inherits base copy constructor SipLayer and adds the functionality of copying the first line
[in] | other | The instance to copy from |
|
inline |
SipRequestLayer& pcpp::SipRequestLayer::operator= | ( | const SipRequestLayer & | other | ) |
An assignment operator overload for this layer. This method inherits base assignment operator SipLayer::operator=() and adds the functionality of copying the first line
[in] | other | The instance to copy from |
|
virtual |
Implements pcpp::Layer.