26 static_assert(
sizeof(
nflog_header) == 4,
"nflog_header size is not 4 bytes");
74 struct NflogTLVRawData
81 uint8_t recordValue[];
83 NflogTLVRawData* m_Data;
98 return align<4>(m_Data->recordLen);
105 m_Data =
reinterpret_cast<NflogTLVRawData*
>(recordRawData);
112 static bool canAssign(
const uint8_t* recordRawData,
size_t tlvDataLen)
114 return recordRawData !=
nullptr && tlvDataLen >=
sizeof(NflogTLVRawData::recordLen);
120 return (m_Data ==
nullptr);
126 return m_Data->recordType;
132 return reinterpret_cast<uint8_t*
>(m_Data);
138 return m_Data->recordValue;
209 uint8_t* getTlvsBasePtr()
const
Definition: NflogLayer.h:145
void parseNextLayer() override
NflogLayer(uint8_t *data, size_t dataLen, Packet *packet)
Definition: NflogLayer.h:151
void computeCalculateFields() override
Does nothing for this layer.
Definition: NflogLayer.h:193
size_t getHeaderLen() const override
nflog_header * getNflogHeader() const
Definition: NflogLayer.h:158
static bool isDataValid(const uint8_t *data, size_t dataLen)
std::string toString() const override
NflogTlv getTlvByType(NflogTlvType type) const
OsiModelLayer getOsiModelLayer() const override
Definition: NflogLayer.h:197
Definition: NflogLayer.h:72
uint16_t getType() const
Definition: NflogLayer.h:124
bool isNull() const
Definition: NflogLayer.h:118
uint8_t * getRecordBasePtr() const
Definition: NflogLayer.h:130
size_t getTotalSize() const
Definition: NflogLayer.h:94
NflogTlv(uint8_t *recordRawData)
Definition: NflogLayer.h:88
static bool canAssign(const uint8_t *recordRawData, size_t tlvDataLen)
Definition: NflogLayer.h:112
void assign(uint8_t *recordRawData)
Definition: NflogLayer.h:103
uint8_t * getValue() const
Definition: NflogLayer.h:136
Definition: TLVData.h:204
The main namespace for the PcapPlusPlus lib.
OsiModelLayer
An enum representing OSI model layers.
Definition: ProtocolType.h:225
@ OsiModelDataLinkLayer
Data link layer (layer 2)
Definition: ProtocolType.h:229
const ProtocolType NFLOG
NFLOG (Linux Netfilter NFLOG) Protocol.
Definition: ProtocolType.h:185
NflogTlvType
Definition: NflogLayer.h:31
@ NFULA_HWHEADER
skbuff's MAC-layer header
@ NFULA_PAYLOAD
packet payload
@ NFULA_HWADDR
nflog_hwaddr_t for hardware address
@ NFULA_TIMESTAMP
nflog_timestamp_t for skbuff's time stamp
@ NFULA_SEQ
sequence number of packets on this NFLOG socket
@ NFULA_UID
UID owning socket on which packet was sent/received.
@ NFULA_IFINDEX_PHYSINDEV
ifindex of physical device on which packet received (not bridge group)
@ NFULA_IFINDEX_INDEV
ifindex of device on which packet received (possibly bridge group)
@ NFULA_PREFIX
text string - null-terminated, count includes NUL
@ NFULA_GID
GID owning socket on which packet was sent/received.
@ NFULA_HWLEN
length of skbuff's MAC-layer header
@ NFULA_SEQ_GLOBAL
sequence number of packets on all NFLOG sockets
@ NFULA_MARK
packet mark from skbuff
@ NFULA_IFINDEX_OUTDEV
ifindex of device on which packet transmitted (possibly bridge group)
@ NFULA_PACKET_HDR
the packet header structure
@ NFULA_IFINDEX_PHYSOUTDEV
ifindex of physical device on which packet transmitted (not bridge group)
@ NFULA_HWTYPE
ARPHRD_ type of skbuff's device.