25 #ifndef PLUGINS_E131_E131_BASEINFLATOR_H_
26 #define PLUGINS_E131_E131_BASEINFLATOR_H_
30 #include "plugins/e131/e131/HeaderSet.h"
31 #include "plugins/e131/e131/PDU.h"
37 class BaseInflatorTest;
50 virtual uint32_t Id()
const = 0;
55 virtual unsigned int InflatePDUBlock(
HeaderSet *headers,
57 unsigned int len) = 0;
65 friend class BaseInflatorTest;
68 explicit BaseInflator(PDU::vector_size v_size = PDU::FOUR_BYTES);
84 virtual unsigned int InflatePDUBlock(
HeaderSet *headers,
90 static const uint8_t LFLAG_MASK = 0x80;
92 static const uint8_t LENGTH_MASK = 0x0F;
95 uint32_t m_last_vector;
97 PDU::vector_size m_vector_size;
99 std::map<uint32_t, InflatorInterface*> m_proto_map;
102 virtual void ResetPDUFields();
103 virtual void ResetHeaderField() = 0;
106 bool DecodeLength(
const uint8_t *data,
107 unsigned int data_length,
108 unsigned int *pdu_length,
109 unsigned int *bytes_used)
const;
112 bool DecodeVector(uint8_t flags,
116 unsigned int *bytes_used);
119 virtual bool DecodeHeader(
HeaderSet *headers,
122 unsigned int *bytes_used) = 0;
128 unsigned int pdu_len);
131 virtual bool PostHeader(uint32_t vector,
const HeaderSet &headers);
134 virtual bool HandlePDUData(uint32_t vector,
137 unsigned int pdu_len);
142 #endif // PLUGINS_E131_E131_BASEINFLATOR_H_