1 #ifndef PACKETPP_TEXT_BASED_PROTOCOL_LAYER 2 #define PACKETPP_TEXT_BASED_PROTOCOL_LAYER 13 #define PCPP_END_OF_TEXT_BASED_PROTOCOL_HEADER "" 15 class TextBasedProtocolMessage;
83 HeaderField(std::string name, std::string value,
char nameValueSeparator,
bool spacesAllowedBetweenNameAndValue);
86 char* getData()
const;
89 void initNewField(std::string name, std::string value);
90 void attachToTextBasedProtocolMessage(TextBasedProtocolMessage* message,
int fieldOffsetInMessage);
92 uint8_t* m_NewFieldData;
93 TextBasedProtocolMessage* m_TextBasedProtocolMessage;
94 int m_NameOffsetInMessage;
95 size_t m_FieldNameSize;
96 int m_ValueOffsetInMessage;
97 size_t m_FieldValueSize;
100 bool m_IsEndOfHeaderField;
101 char m_NameValueSeparator;
102 bool m_SpacesAllowedBetweenNameAndValue;
129 HeaderField* getFieldByName(std::string fieldName,
int index = 0)
const;
146 int getFieldCount()
const;
154 virtual HeaderField* addField(
const std::string& fieldName,
const std::string& fieldValue);
176 virtual HeaderField* insertField(
HeaderField* prevField,
const std::string& fieldName,
const std::string& fieldValue);
186 virtual HeaderField* insertField(std::string prevFieldName,
const std::string& fieldName,
const std::string& fieldValue);
211 bool removeField(std::string fieldName,
int index = 0);
217 bool isHeaderComplete()
const;
224 virtual void parseNextLayer();
229 size_t getHeaderLen()
const;
234 virtual void computeCalculateFields();
247 void shiftFieldsOffset(
HeaderField* fromField,
int numOfBytesToShift);
250 virtual char getHeaderFieldNameValueSeparator()
const = 0;
251 virtual bool spacesAllowedBetweenHeaderFieldNameAndValue()
const = 0;
256 std::multimap<std::string, HeaderField*> m_FieldNameToFieldMap;
263 #endif // PACKETPP_TEXT_BASED_PROTOCOL_LAYER The main namespace for the PcapPlusPlus lib.
HeaderField * getFirstField() const
Definition: TextBasedProtocol.h:134
Definition: TextBasedProtocol.h:115
HeaderField * getNextField(HeaderField *prevField) const
Definition: TextBasedProtocol.h:141