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

# Packages

No description provided by the author

# Functions

BuildNfAttrMsg -- Build nfattr messagelength -- length of the attr payload -- unusedattrType -- Type of attr being addeddata --- The actual data being added.
BuildNfAttrWithPaddingMsg -- Build nfattrWithPadding messageattrType -- Type of attr which needs paddingdataLen -- Length of the attribute.
BuildNfgenMsg -- Build nfgen msg strcuurefamily -- SOCK FAMILYVersion -- VersionresId -- queuenumn - syscall.NlMsghdr to adjust length after adding nfgen.
BuildNfNestedAttrMsg -- Build nfnestedattr messageattrType -- Type of attr being addeddataLEn -- Length of the attribute.
BuildNlMsgHeader -- Build syscall.NlMsgHdr structuremsgType: The message type to be send | SUBSYSID - 3 for usLen: Len of the payload including the sizeof nlmsghdrmsgFlags: Request Flags.
Int2ip converts uint32 to net.IP.
IP2int converts net.IP to uint32.
NativeEndian -- To get native endianess.
NetlinkErrMessagetoStruct -- parse byte slice and return syscall.NlMsgerr.
NetlinkMessageToNfAttrStruct -- Convert byte slice representing nfattr to nfattr struct slice.
NetlinkMessageToNfGenStruct -- Convert netlink byte slice to nfqgen msg structure.
NetlinkMessageToStruct -- Convert netlink message byte slice to struct and payload.
NfaAlign -- Align to 4 byte boundary.
NfaAlign32 -- Align to 4 byte boundary.
NfaLength -- adjust length to end on 4 byte multiple.
NlMsgAlign -- Align to 4 byte boundary.
NlMsgLength -- adjust length to end on 4 byte multiple.
NlMsgSpace -- Space required to hold this message.
NlMsgSubsysID returns the subsystem id -- 3 for queue.
NlMsgType Returns the Messagetype.
SerializeNlMsgHdr -- Serialize syscall.NlMsgHdr to byte slice.
SerializeNlMsgHdrBuf -- Serialize into passed buffer and returns number of bytes copied.
SetNetlinkData -- Sets netlink data.

# Constants

APUNSPEC -- PF_UNSPEC/AF_UNSPEC.
ConntrackExpectTable Conntrack expect table https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink.h -> #define NFNL_SUBSYS_CTNETLINK_EXP 2.
ConntrackTable Conntrack table https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink.h -> #define NFNL_SUBSYS_CTNETLINK 1.
https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink_conntrack.h.
https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink_conntrack.h.
https://github.com/torvalds/linux/blob/master/include/uapi/linux/netfilter/nfnetlink_conntrack.h.
NFNetlinkV0 - netlink v0.
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
No description provided by the author
NfnlBuffSize -- Buffer size of socket.
NFCTNL - Netfilter Conntrack Netink message types.
NFLOG - Netfilter NFLog message types.
NfqnlMsgConfig connect to a particular queue.
NfqnlMsgPacket packet from kernel to userspace.
NfqnlMsgVerdict verdict from userspace to kernel.
NfqnlMsgVerdictBatch batch verdict from userspace to kernel.
NFQUEUESUBSYSID The netlink subsystem id for nfqueue.
No description provided by the author
NlmFAck -- Reply with ack, with zero or error code */.
NlmFDumpFiltered -- Dump was filtered as requested */.
NlmFDumpintr -- Dump was inconsistent due to sequence change */.
NlmFEcho -- Echo this request */.
NlmFMulti -- Multipart message, terminated by NlMsgDone */.
NlmFRequest -- It is request message.
end of a dump */.
error */.
nothing.
data lost */.
SizeofMsgConfigCommand -- Sizeof config command struct.
SizeofNfAttr -- Sizeof nfattr struct This does not account for the size of the byte slice at the end.
SizeofNfGenMsg -- Sizeof nfgen msg struct.
SizeOfNfqMsgConfigParams -- Sizeof NfqMsgConfigParams.
SizeOfNfqMsgConfigQueueLen -- Sizeof NfqMsgConfigQueueLen.
SizeofNfqMsgMarkHdr -- sizeof mark hdr.
SizeofNfqMsgVerdictHdr -- Sizeof verdict hdr struct.
No description provided by the author
No description provided by the author
No description provided by the author
SOCKFAMILY constant for AF_NETLINK.
syscall.SOL_NETLINK not defined */.
For generic use.
For generic use.

# Structs

NfAttr -- attr struct headernfaLen -- sizeof struct + payloadnfaType -- nfaType.
NfAttrResponsePayload -- Response of attr from netlinkattr -- NfAttrdata -- payload for response.
NfqGenMsg -- the nfgen msg structurenfGenFamily -- Familyversion -- netlink versionresId -- queueNum in big endian format.
NfqMsgConfigCommand -- config commandCommand -- the config commandpf -- family.
NfqMsgConfigParams -- Config paramscopyRange -- Range of bytes to copycopyMode -- copyMode meta/none/packet.
NfqMsgConfigQueueLen -- Queue lengthqueueLen -- The length of queue.
NfqMsgMarkHdr -- Mark Payloadmark -- markval.
NfqMsgVerdictHdr -- Verdict Hdr structverdict -- accept/dropid -- packetid.
NfqNetlinkRequest -- netlink request to sendNlMsgHdr fieldsserialized data of structure passed to netlink.
NfValue16 -- uint16 type attribute structurevalue -- the value for a uint16 type attribute.
NfValue32 -- uint32 type attribute structurevalue -- the value for a uint32 type attribute.
NfValue8 -- uint8 type attribute structurevalue -- the value for a uint8 type attribute.
SockHandles -- Sock handle of netlink socketfd -- fd of socketrcvbufSize -- rcv buffer Sizelsa -- local address.

# Type aliases

NfAttrSlice is an array of attributes.
NlmFlags -- The flags passed to NlMsgHdr.