Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/google/nftables
/ functions
Functions
499 in github.com/google/nftables
⨍
Functions
499
◇
Types & classes
131
↓ 146 callers
Method
PutUint32
(v uint32)
binaryutil/binaryutil.go:28
↓ 123 callers
Method
Uint32
(b []byte)
binaryutil/binaryutil.go:31
↓ 121 callers
Method
FlushRuleset
FlushRuleset flushes the entire ruleset. See also https://wiki.nftables.org/wiki-nftables/index.php/Operations_at_ruleset_level
conn.go:287
↓ 113 callers
Method
Flush
Flush sends all buffered commands in a single batch to nftables.
conn.go:243
↓ 87 callers
Method
AddTable
AddTable adds the specified Table, just like `nft add table ...`. See also https://wiki.nftables.org/wiki-nftables/index.php/Configuring_tables
table.go:88
↓ 80 callers
Function
nfdump
nfdump returns a hexdump of 4 bytes per line (like nft --debug=all), allowing users to make sense of large byte literals more easily.
nftables_test.go:43
↓ 70 callers
Method
AddRule
(r *Rule)
rule.go:187
↓ 70 callers
Method
PutUint16
(v uint16)
binaryutil/binaryutil.go:27
↓ 61 callers
Method
AddChain
AddChain adds the specified Chain. See also https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains#Adding_base_chains
chain.go:110
↓ 52 callers
Function
CleanupSystemConn
(t *testing.T, newNS netns.NsHandle)
internal/nftest/system_conn.go:36
↓ 52 callers
Function
OpenSystemConn
OpenSystemConn returns a netlink connection that tests against the running kernel in a separate network namespace. nftest.CleanupSystemConn() must be
internal/nftest/system_conn.go:15
↓ 49 callers
Function
New
New returns a netlink connection for querying and modifying nftables. Some aspects of the new netlink connection can be configured using the options W
conn.go:62
↓ 44 callers
Function
WithTestDial
WithTestDial sets the specified nltest.Func when creating a new netlink connection.
conn.go:103
↓ 42 callers
Method
Uint16
(b []byte)
binaryutil/binaryutil.go:30
↓ 40 callers
Function
linediff
linediff returns a side-by-side diff of two nfdump() return values, flagging lines which are not equal with an exclamation point prefix.
nftables_test.go:62
↓ 37 callers
Method
marshalAttr
(attrs []netlink.Attribute)
conn.go:331
↓ 30 callers
Function
extraHeader
(family uint8, resID uint16)
util.go:25
↓ 28 callers
Method
GetRules
GetRules returns the rules in the specified table and chain.
rule.go:66
↓ 27 callers
Method
AddObj
AddObj adds the specified Obj. See also https://wiki.nftables.org/wiki-nftables/index.php/Stateful_objects
obj.go:109
↓ 26 callers
Method
Uint64
(b []byte)
binaryutil/binaryutil.go:32
↓ 25 callers
Method
AddSet
AddSet adds the specified Set.
set.go:493
↓ 24 callers
Method
PutUint64
(v uint64)
binaryutil/binaryutil.go:29
↓ 24 callers
Method
String
String unmarshals a null terminated string
alignedbuff/alignedbuff.go:144
↓ 24 callers
Method
Uint8
Uint8 unmarshals an uint8 in native endianess and alignment. It returns ErrEOF when trying to read beyond the payload.
alignedbuff/alignedbuff.go:79
↓ 21 callers
Function
ChainPriorityRef
ChainPriorityRef returns a pointer to a ChainPriority value.
chain.go:72
↓ 18 callers
Function
NewWithData
NewWithData returns a new AlignedBuff for unmarshalling the passed data in native endianess.
alignedbuff/alignedbuff.go:46
↓ 17 callers
Function
New
New returns a new AlignedBuff for marshalling aligned data in native endianess.
alignedbuff/alignedbuff.go:40
↓ 15 callers
Method
PutUint8
PutUint8 marshals an uint8 in native endianess and alignment.
alignedbuff/alignedbuff.go:204
↓ 12 callers
Method
Data
Data returns the properly padded info payload data written before by calling the various Uint8, Uint16, ... marshalling functions.
alignedbuff/alignedbuff.go:52
↓ 11 callers
Method
GetObject
GetObject gets the specified Object This function returns the same concrete type as passed, e.g. QuotaObj, CounterObj or NamedObj. Prefer using the mo
obj.go:180
↓ 10 callers
Method
marshal
(fam byte)
expr/expr.go:220
↓ 10 callers
Method
netlinkConn
netlinkConn returns a netlink connection together with a netlinkCloser that later must be called by the caller when it doesn't need the returned netli
conn.go:130
↓ 10 callers
Method
unmarshal
(fam TableFamily, rev uint32, data []byte)
xt/info.go:15
↓ 9 callers
Method
GetObj
GetObj is a legacy method that return all Obj that belongs to the same table as the given one This function returns the same concrete type as passed,
obj.go:163
↓ 9 callers
Method
marshal
(fam TableFamily, rev uint32)
xt/info.go:14
↓ 8 callers
Method
SetAddElements
SetAddElements applies data points to an nftables set.
set.go:374
↓ 7 callers
Function
ChainHookRef
ChainHookRef returns a pointer to a ChainHookRef value.
chain.go:44
↓ 7 callers
Method
GetSetElements
GetSetElements returns the elements in the specified set.
set.go:970
↓ 7 callers
Method
GetSets
GetSets returns the sets in the specified table.
set.go:881
↓ 7 callers
Method
alignWrite
alignWrite aligns the (write) position if necessary and suitable according to the specified alignment mask. It doubles as final payload padding helpma
alignedbuff/alignedbuff.go:283
↓ 7 callers
Function
iPv46
(ab *alignedbuff.AlignedBuff, fam TableFamily)
xt/util.go:30
↓ 7 callers
Function
putIPv46
(ab *alignedbuff.AlignedBuff, fam TableFamily, ip net.IP)
xt/util.go:50
↓ 7 callers
Function
receiveAckAware
(nlconn *netlink.Conn, sentMsgFlags netlink.HeaderFlags)
conn.go:149
↓ 7 callers
Method
table
()
obj.go:65
↓ 6 callers
Method
AddFlowtable
(f *Flowtable)
flowtable.go:109
↓ 6 callers
Method
alignCheckedRead
alignCheckedRead aligns the (read) position if necessary and suitable according to the specified alignment mask. alignCheckedRead returns an error if
alignedbuff/alignedbuff.go:272
↓ 5 callers
Method
Close
()
monitor.go:319
↓ 5 callers
Method
PutUint16BE
PutUint16BE marshals an uint16 in "network" (=big endian) endianess and native uint16 alignment.
alignedbuff/alignedbuff.go:218
↓ 5 callers
Method
Uint16BE
Uint16BE unmarshals an uint16 in "network" (=big endian) endianess and native uint16 alignment. It returns ErrEOF when trying to read beyond the paylo
alignedbuff/alignedbuff.go:101
↓ 5 callers
Function
genSetKeyType
(types ...uint32)
set_test.go:15
↓ 5 callers
Method
getObjWithLegacyType
(o Obj, t *Table, msgType uint16, returnLegacyObjType bool)
obj.go:328
↓ 5 callers
Method
newRule
AddRule adds the specified Rule
rule.go:110
↓ 4 callers
Function
AppendString
(udata []byte, typ Type, str string)
userdata/userdata.go:101
↓ 4 callers
Function
AppendUint32
(udata []byte, typ Type, num uint32)
userdata/userdata.go:86
↓ 4 callers
Function
ConcatSetType
ConcatSetType constructs a new SetDatatype which consists of a concatenation of the passed types. It returns ErrTooManyTypes, if nftMagic would overfl
set.go:210
↓ 4 callers
Method
GetObjects
GetObjects get all the Obj that belongs to the given table This function will always return legacy QuotaObj/CounterObj types for backwards compatibili
obj.go:193
↓ 4 callers
Method
ListFlowtables
(t *Table)
flowtable.go:174
↓ 4 callers
Method
PutBytesAligned32
PutBytesAligned32 marshals the given bytes starting with the native alignment for uint32 data types. It additionaly adds padding to reach the specifie
alignedbuff/alignedbuff.go:192
↓ 4 callers
Method
PutUint
PutUint marshals an uint in native endianess and alignment for the C "unsigned int" type. Please note that on 64bit platforms, the size and alignment
alignedbuff/alignedbuff.go:255
↓ 4 callers
Method
ResetObject
ResetObject reset the given Obj This function returns the same concrete type as passed, e.g. QuotaObj, CounterObj or NamedObj. Prefer using the more g
obj.go:207
↓ 4 callers
Method
Uint
Uint unmarshals an uint in native endianess and alignment for the C "unsigned int" type. It returns ErrEOF when trying to read beyond the payload. Ple
alignedbuff/alignedbuff.go:170
↓ 4 callers
Function
WithNetNSFd
WithNetNSFd sets the network namespace to create a new netlink connection to: the fd must reference a network namespace.
conn.go:95
↓ 4 callers
Function
getCompatPolicy
(exprs []expr.Any)
compat_policy.go:56
↓ 4 callers
Method
getObj
(o Obj, t *Table, msgType uint16)
obj.go:324
↓ 4 callers
Function
iPv46Mask
(ab *alignedbuff.AlignedBuff, fam TableFamily)
xt/util.go:45
↓ 4 callers
Function
ifname
(n string)
nftables_test.go:81
↓ 4 callers
Function
putIPv46Mask
(ab *alignedbuff.AlignedBuff, fam TableFamily, mask net.IPMask)
xt/util.go:62
↓ 4 callers
Method
setErr
(err error)
conn.go:324
↓ 4 callers
Function
setsFromMsg
(msg netlink.Message)
set.go:745
↓ 4 callers
Method
unmarshal
(fam byte, data []byte)
expr/expr.go:222
↓ 3 callers
Method
AddGenerationalMonitor
(monitor *Monitor)
monitor.go:354
↓ 3 callers
Function
AsLasting
AsLasting creates the new netlink connection as a lasting connection that is reused across multiple netlink operations, instead of opening and closing
conn.go:84
↓ 3 callers
Method
BytesAligned32
BytesAligned32 unmarshals the given amount of bytes starting with the native alignment for uint32 data types. It returns ErrEOF when trying to read be
alignedbuff/alignedbuff.go:65
↓ 3 callers
Method
DeleteObject
DeleteObject deletes the specified Obj
obj.go:138
↓ 3 callers
Function
FlowtablePriorityRef
(p FlowtablePriority)
flowtable.go:85
↓ 3 callers
Method
GetNamedObjects
GetNamedObjects get all the Obj that belongs to the given table This function always return NamedObj types
obj.go:199
↓ 3 callers
Function
GetString
(udata []byte, typ Type)
userdata/userdata.go:106
↓ 3 callers
Method
InsertRule
(r *Rule)
rule.go:195
↓ 3 callers
Method
ListTable
ListTable returns table found for the specified name. Searches for the table under IPv4 family. As per nft man page: "When no address family is specif
table.go:118
↓ 3 callers
Method
ListTableOfFamily
ListTableOfFamily returns table found for the specified name and table family
table.go:123
↓ 3 callers
Method
ListTables
ListTables returns currently configured tables in the kernel
table.go:135
↓ 3 callers
Function
Marshal
Marshal serializes the specified expression into a byte slice.
expr/expr.go:69
↓ 3 callers
Function
String
(b []byte)
binaryutil/binaryutil.go:123
↓ 3 callers
Function
Unmarshal
Unmarshal fills an expression from the specified byte slice.
expr/expr.go:78
↓ 3 callers
Function
chainFromMsg
(msg netlink.Message)
chain.go:269
↓ 3 callers
Function
decodeElement
(d []byte)
set.go:352
↓ 3 callers
Method
family
()
obj.go:66
↓ 3 callers
Method
makeElemList
(vals []SetElement, id uint32)
set.go:396
↓ 3 callers
Method
marshalAB
(fam TableFamily, rev uint32, ab *alignedbuff.AlignedBuff)
xt/match_conntrack.go:189
↓ 3 callers
Method
name
()
obj.go:68
↓ 3 callers
Method
objType
()
obj.go:69
↓ 3 callers
Function
parseSetDatatype
(magic uint32)
set.go:820
↓ 3 callers
Method
unmarshalAB
(fam TableFamily, rev uint32, ab *alignedbuff.AlignedBuff)
xt/match_conntrack.go:206
↓ 3 callers
Method
useLegacyObjType
(o Obj)
obj.go:383
↓ 2 callers
Function
Append
(udata []byte, typ Type, data []byte)
userdata/userdata.go:55
↓ 2 callers
Method
CloseLasting
CloseLasting closes the lasting netlink connection that has been opened using AsLasting option when creating this connection. If either no lasting net
conn.go:226
↓ 2 callers
Function
ConcatSetTypeElements
ConcatSetTypeElements uses the ConcatSetType name to calculate and return a list of base types which were used to construct the concatenated type
set.go:234
↓ 2 callers
Function
Get
(udata []byte, styp Type)
userdata/userdata.go:62
↓ 2 callers
Method
GetNFTMagic
GetNFTMagic returns a custom datatype based on user's parameters
set.go:62
↓ 2 callers
Method
GetObjReset
GetObjReset is a legacy method that reset all Obj that belongs the same table as the given one This function returns the same concrete type as passed,
obj.go:172
next →
1–100 of 499, ranked by callers