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;
214 static std::vector<FieldDescriptor>
all()
218 std::copy(extra.begin(), extra.end(), std::back_inserter(result));
243 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
void serializeLayer(ObjectScope &serializer) const override
static bool isDataValid(const uint8_t *data, size_t dataLen)
uint8_t getVersion() const
std::string toString() const override
NflogTlv getTlvByType(NflogTlvType type) const
OsiModelLayer getOsiModelLayer() const override
Definition: NflogLayer.h:197
uint16_t getResourceId() const
uint8_t getFamily() const
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: Serializers.h:230
Definition: TLVData.h:219
const ProtocolType NFLOG
NFLOG (Linux Netfilter NFLOG) Protocol.
Definition: ProtocolType.h:210
The main namespace for the PcapPlusPlus lib.
Definition: AssertionUtils.h:19
OsiModelLayer
An enum representing OSI model layers.
Definition: ProtocolType.h:425
@ OsiModelDataLinkLayer
Data link layer (layer 2)
Definition: ProtocolType.h:429
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.
Definition: Serializers.h:18
static std::vector< FieldDescriptor > all()
Definition: Layer.h:214
Definition: NflogLayer.h:212
static const FieldDescriptor Version
Field descriptor for the pseudo-header version (0 for the current version).
Definition: NflogLayer.h:226
static const FieldDescriptor ResourceID
Field descriptor for the resource ID, i.e. the nflog group the packet was received on.
Definition: NflogLayer.h:229
static std::vector< FieldDescriptor > all()
Definition: NflogLayer.h:214
static const FieldDescriptor Family
Field descriptor for the address family of the packet (e.g. 2 for IPv4, 10 for IPv6).
Definition: NflogLayer.h:223
static const FieldDescriptor Attributes
Field descriptor for the array of TLV attributes found in the layer.
Definition: NflogLayer.h:232
static const FieldDescriptor Attribute
Field descriptor for a single entry of the Attributes array, written as the attribute type name (e....
Definition: NflogLayer.h:236