package
1.42.1
Repository: https://github.com/codingjzy/netlink-go.git
Documentation: pkg.go.dev

# README

nflog-go

nflog-go implements a go native implementation for the nflog netlink interface provided by Linux to the in-kernel packets logged by the kernel packet filter.

The library implements a subset of the functionality provided by https://www.netfilter.org/projects/libnetfilter_log/

The library implements the following APIs

  • Receiving logs (packets) from kernel based on groups and chains from iptables

# Packages

No description provided by the author

# Functions

BindAndListenForLogs -- a complete set to open/unbind/bind/bindgroup and listen for logs group -- group to bind with and listen packetSize -- max expected packetSize (0:unlimited).
NewNFLog -- Create a new Nflog handle.
NfaAlign16 -- To align payload.

# Constants

No description provided by the author
nfulnl_msg_config_cmd */.
__u16 */.
nfulnl_msg_config_mode */.
__u32 buffer size */.
__u32 */.
__u32 in 1/100 s */.
enum nfulnl_attr_config.
nf_conntrack_netlink.h */.
enum ip_conntrack_info */.
group id of socket */.
nfulnl_msg_packet_hw */.
hardware header */.
hardware header length */.
hardware type */.
__u32 ifindex */.
__u32 ifindex */.
__u32 ifindex */.
__u32 ifindex */.
__u32 nfmark */.
enum nfulnl_attr_type.
opaque data payload */.
string prefix */.
instance-local sequence number */.
global sequence number */.
nfulnl_msg_packet_timestamp */.
user id of socket */.
enum nfulnl_attr_type.
enum nfulnl_msg_config_cmds.
enum nfulnl_msg_config_cmds.
enum nfulnl_msg_config_cmds.
enum nfulnl_msg_config_cmds.
enum nfulnl_msg_config_cmds.
No description provided by the author
No description provided by the author
No description provided by the author
enum nfulnl_msg_types.
enum nfulnl_msg_types.
enum nfulnl_msg_types.
No description provided by the author
No description provided by the author

# Structs

IPLayer -- IPLayer struct.
NflMsgConfigCommand -- NflMsgConfigCommand struct for configs (ex: bind).
NflMsgConfigMode -- NflMsgConfigMode struct for copy range and mode (ex: copy meta).
NfLog -- Nflog struct Groups -- Nflog group to bind with.
NfPacket -- NfPacket struct for parsing logs Payload -- Complete packet with ethernet,tcp and ip IPLayer -- Iplayer struct TCPLayer -- Tcplayer struct PacketPayload -- Tcp payload.
PacketPayload -- PacketPayload struct.
Ports -- Generic struct for TCP and UDP ports.
SockHandles -- Sock handle of netlink socketfd -- fd of socketrcvbufSize -- rcv buffer Sizelsa -- local address.

# Interfaces

NFLog -- This is the interface which has all the necessary functions to read logs from kernel This is needed if we don't want to call BindAndListenForLogs() Useful for testing and debugging.
SockHandle Opaque interface with unexported functions.