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;
81 HeaderField(std::string name, std::string value,
char nameValueSeperator,
bool spacesAllowedBetweenNameAndValue);
84 char* getData()
const;
87 void initNewField(std::string name, std::string value);
88 void attachToTextBasedProtocolMessage(TextBasedProtocolMessage* message,
int fieldOffsetInMessage);
90 uint8_t* m_NewFieldData;
91 TextBasedProtocolMessage* m_TextBasedProtocolMessage;
92 int m_NameOffsetInMessage;
93 size_t m_FieldNameSize;
94 int m_ValueOffsetInMessage;
95 size_t m_FieldValueSize;
98 bool m_IsEndOfHeaderField;
99 char m_NameValueSeperator;
100 bool m_SpacesAllowedBetweenNameAndValue;
127 HeaderField* getFieldByName(std::string fieldName,
int index = 0)
const;
144 int getFieldCount()
const;
152 virtual HeaderField* addField(
const std::string& fieldName,
const std::string& fieldValue);
174 virtual HeaderField* insertField(
HeaderField* prevField,
const std::string& fieldName,
const std::string& fieldValue);
184 virtual HeaderField* insertField(std::string prevFieldName,
const std::string& fieldName,
const std::string& fieldValue);
209 bool removeField(std::string fieldName,
int index = 0);
215 bool isHeaderComplete()
const;
222 virtual void parseNextLayer();
227 size_t getHeaderLen()
const;
232 virtual void computeCalculateFields();
245 void shiftFieldsOffset(
HeaderField* fromField,
int numOfBytesToShift);
248 virtual char getHeaderFieldNameValueSeparator()
const = 0;
249 virtual bool spacesAllowedBetweenHeaderFieldNameAndValue()
const = 0;
254 std::multimap<std::string, HeaderField*> m_FieldNameToFieldMap;
261 #endif // PACKETPP_TEXT_BASED_PROTOCOL_LAYER The main namespace for the PcapPlusPlus lib.
HeaderField * getFirstField() const
Definition: TextBasedProtocol.h:132
Definition: TextBasedProtocol.h:113
HeaderField * getNextField(HeaderField *prevField) const
Definition: TextBasedProtocol.h:139