PcapPlusPlus
|
#include <SipLayer.h>
Public Member Functions | |
int | getContentLength () |
HeaderField * | setContentLength (int contentLength, const std::string prevFieldName="") |
OsiModelLayer | getOsiModelLayer () |
void | parseNextLayer () |
void | computeCalculateFields () |
Public Member Functions inherited from pcpp::TextBasedProtocolMessage | |
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 () |
Public Member Functions inherited from pcpp::Layer | |
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) |
virtual std::string | toString ()=0 |
Represents a general SIP message. It's an abstract class and cannot be instantiated. It's inherited by SipRequestLayer and SipResponseLayer
|
virtual |
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)
Reimplemented from pcpp::TextBasedProtocolMessage.
int pcpp::SipLayer::getContentLength | ( | ) |
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
|
inlinevirtual |
Implements pcpp::Layer.
|
virtual |
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
Reimplemented from pcpp::TextBasedProtocolMessage.
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 |