Debian Codegraph @

types.go

raw symbols SCIP
1 /*
2 Copyright 2023 The Kubernetes Authors.
3
4 Licensed under the Apache License, Version 2.0 (the "License");
5 you may not use this file except in compliance with the License.
6 You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10 Unless required by applicable law or agreed to in writing, software
11 distributed under the License is distributed on an "AS IS" BASIS,
12 WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 See the License for the specific language governing permissions and
14 limitations under the License.
15 */
16
17 package knftablesscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/
18
19 import (
20 "ioscip-go gomod github.com/golang/go/src go1.20 io/"
21 "timescip-go gomod github.com/golang/go/src go1.20 time/"
22 )
23
24 const (
25 // Maximum length of a table, chain, set, etc, name
26 NameLengthMaxscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/NameLengthMax. = 256
27
28 // Maximum length of a comment
29 CommentLengthMaxscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/CommentLengthMax. = 128
30 )
31
32 // Object is the interface for an nftables object. All of the concrete object types
33 // implement this interface.
34 type Objectscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Object# interface {
35 // validate validates an object for an operation
36 validatescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Object#validate.(verb verbscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/verb#) error
37
38 // writeOperation writes out an "nft" operation involving the object. It assumes
39 // that the object has been validated.
40 writeOperationscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Object#writeOperation.(verb verbscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/verb#, ctx *nftContextscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/nftContext#, writer ioscip-go gomod github.com/golang/go/src go1.20 io/.Writerscip-go gomod github.com/golang/go/src go1.20 io/Writer#)
41
42 // parse is the opposite of writeOperation; it fills Object fields based on an "nft add"
43 // command. line is the part of the line after "nft add <type> <family> <tablename>"
44 // (so for most types it starts with the object name).
45 // If error is returned, Object's fields may be partially filled, therefore Object should not be used.
46 parsescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Object#parse.(line string) error
47 }
48
49 // Family is an nftables family
50 type Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Family# string
51
52 const (
53 // IPv4Family represents the "ip" nftables family, for IPv4 rules.
54 IPv4Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/IPv4Family. Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Family# = "ip"
55
56 // IPv6Family represents the "ip6" nftables family, for IPv6 rules.
57 IPv6Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/IPv6Family. Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Family# = "ip6"
58
59 // InetFamily represents the "inet" nftables family, for mixed IPv4 and IPv6 rules.
60 InetFamilyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/InetFamily. Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Family# = "inet"
61
62 // ARPFamily represents the "arp" nftables family, for ARP rules.
63 ARPFamilyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/ARPFamily. Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Family# = "arp"
64
65 // BridgeFamily represents the "bridge" nftables family, for rules operating
66 // on packets traversing a bridge.
67 BridgeFamilyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BridgeFamily. Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Family# = "bridge"
68
69 // NetDevFamily represents the "netdev" nftables family, for rules operating on
70 // the device ingress/egress path.
71 NetDevFamilyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/NetDevFamily. Familyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Family# = "netdev"
72 )
73
74 // Table represents an nftables table.
75 type Tablescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Table# struct {
76 // Comment is an optional comment for the table. (Requires kernel >= 5.10 and
77 // nft >= 0.9.7; otherwise this field will be silently ignored. Requires
78 // nft >= 1.0.8 to include comments in List() results.)
79 Commentscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Table#Comment. *string
80
81 // Handle is an identifier that can be used to uniquely identify an object when
82 // deleting it. When adding a new object, this must be nil.
83 Handlescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Table#Handle. *int
84 }
85
86 // BaseChainType represents the "type" of a "base chain" (ie, a chain that is attached to a hook).
87 // See https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains#Base_chain_types
88 type BaseChainTypescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainType# string
89
90 const (
91 // FilterType is the chain type for basic packet filtering.
92 FilterTypescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/FilterType. BaseChainTypescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainType# = "filter"
93
94 // NATType is the chain type for doing DNAT, SNAT, and masquerading.
95 // NAT operations are only available from certain hooks.
96 NATTypescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/NATType. BaseChainTypescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainType# = "nat"
97
98 // RouteType is the chain type for rules that change the routing of packets.
99 // Chains of this type can only be added to the "output" hook.
100 RouteTypescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/RouteType. BaseChainTypescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainType# = "route"
101 )
102
103 // BaseChainHook represents the "hook" that a base chain is attached to.
104 // See https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains#Base_chain_hooks
105 // and https://wiki.nftables.org/wiki-nftables/index.php/Netfilter_hooks
106 type BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook# string
107
108 const (
109 // PreroutingHook is the "prerouting" stage of packet processing, which is the
110 // first stage (after "ingress") for inbound ("input path" and "forward path")
111 // packets.
112 PreroutingHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/PreroutingHook. BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook# = "prerouting"
113
114 // InputHook is the "input" stage of packet processing, which happens after
115 // "prerouting" for inbound packets being delivered to an interface on this host,
116 // in this network namespace.
117 InputHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/InputHook. BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook# = "input"
118
119 // ForwardHook is the "forward" stage of packet processing, which happens after
120 // "prerouting" for inbound packets destined for a non-local IP (i.e. on another
121 // host or in another network namespace)
122 ForwardHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/ForwardHook. BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook# = "forward"
123
124 // OutputHook is the "output" stage of packet processing, which is the first stage
125 // for outbound packets, regardless of their final destination.
126 OutputHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/OutputHook. BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook# = "output"
127
128 // PostroutingHook is the "postrouting" stage of packet processing, which is the
129 // final stage (before "egress") for outbound ("forward path" and "output path")
130 // packets.
131 PostroutingHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/PostroutingHook. BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook# = "postrouting"
132
133 // IngressHook is the "ingress" stage of packet processing, in the "netdev" family
134 // or (with kernel >= 5.10 and nft >= 0.9.7) the "inet" family.
135 IngressHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/IngressHook. BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook# = "ingress"
136
137 // EgressHook is the "egress" stage of packet processing, in the "netdev" family
138 // (with kernel >= 5.16 and nft >= 1.0.1).
139 EgressHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/EgressHook. BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook# = "egress"
140 )
141
142 // BaseChainPriority represents the "priority" of a base chain. Lower values run earlier.
143 // See https://wiki.nftables.org/wiki-nftables/index.php/Configuring_chains#Base_chain_priority
144 // and https://wiki.nftables.org/wiki-nftables/index.php/Netfilter_hooks#Priority_within_hook
145 //
146 // In addition to the const values, you can also use a signed integer value, or an
147 // arithmetic expression consisting of a const value followed by "+" or "-" and an
148 // integer.
149 type BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority# string
150
151 const (
152 // RawPriority is the earliest named priority. In particular, it can be used for
153 // rules that need to run before conntrack. It is equivalent to the value -300 and
154 // can be used in the ip, ip6, and inet families.
155 RawPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/RawPriority. BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority# = "raw"
156
157 // ManglePriority is the standard priority for packet-rewriting operations. It is
158 // equivalent to the value -150 and can be used in the ip, ip6, and inet families.
159 ManglePriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/ManglePriority. BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority# = "mangle"
160
161 // DNATPriority is the standard priority for DNAT operations. In the ip, ip6, and
162 // inet families, it is equivalent to the value -100. In the bridge family it is
163 // equivalent to the value -300. In both cases it can only be used from the
164 // prerouting hook.
165 DNATPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/DNATPriority. BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority# = "dstnat"
166
167 // FilterPriority is the standard priority for filtering operations. In the ip,
168 // ip6, inet, arp, and netdev families, it is equivalent to the value 0. In the
169 // bridge family it is equivalent to the value -200.
170 FilterPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/FilterPriority. BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority# = "filter"
171
172 // OutPriority is FIXME. It is equivalent to the value 300 and can only be used in
173 // the bridge family.
174 OutPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/OutPriority. BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority# = "out"
175
176 // SecurityPriority is the standard priority for security operations ("where
177 // secmark can be set for example"). It is equivalent to the value 50 and can be
178 // used in the ip, ip6, and inet families.
179 SecurityPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SecurityPriority. BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority# = "security"
180
181 // SNATPriority is the standard priority for SNAT operations. In the ip, ip6, and
182 // inet families, it is equivalent to the value 100. In the bridge family it is
183 // equivalent to the value 300. In both cases it can only be used from the
184 // postrouting hook.
185 SNATPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SNATPriority. BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority# = "srcnat"
186 )
187
188 // Chain represents an nftables chain; either a "base chain" (if Type, Hook, and Priority
189 // are specified), or a "regular chain" (if they are not).
190 type Chainscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Chain# struct {
191 // Name is the name of the chain.
192 Namescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Chain#Name. string
193
194 // Type is the chain type; this must be set for a base chain and unset for a
195 // regular chain.
196 Typescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Chain#Type. *BaseChainTypescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainType#
197 // Hook is the hook that the chain is connected to; this must be set for a base
198 // chain and unset for a regular chain.
199 Hookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Chain#Hook. *BaseChainHookscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainHook#
200 // Priority is the chain priority; this must be set for a base chain and unset for
201 // a regular chain. You can call ParsePriority() to convert this to a number.
202 Priorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Chain#Priority. *BaseChainPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/BaseChainPriority#
203
204 // Device is the network interface that the chain is attached to; this must be set
205 // for a base chain connected to the "ingress" or "egress" hooks, and unset for
206 // all other chains.
207 Devicescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Chain#Device. *string
208
209 // Comment is an optional comment for the object. (Requires kernel >= 5.10 and
210 // nft >= 0.9.7; otherwise this field will be silently ignored. Requires
211 // nft >= 1.0.8 to include comments in List() results.)
212 Commentscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Chain#Comment. *string
213
214 // Handle is an identifier that can be used to uniquely identify an object when
215 // deleting it. When adding a new object, this must be nil
216 Handlescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Chain#Handle. *int
217 }
218
219 // Rule represents a rule in a chain
220 type Rulescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Rule# struct {
221 // Chain is the name of the chain that contains this rule
222 Chainscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Rule#Chain. string
223
224 // Rule is the rule in standard nftables syntax. (Should be empty on Delete, but
225 // is ignored if not.) Note that this does not include any rule comment, which is
226 // separate from the rule itself.
227 Rulescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Rule#Rule. string
228
229 // Comment is an optional comment for the rule.
230 Commentscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Rule#Comment. *string
231
232 // Index is the number of a rule (counting from 0) to Add this Rule after or
233 // Insert it before. Cannot be specified along with Handle. If neither Index
234 // nor Handle is specified then Add appends the rule the end of the chain and
235 // Insert prepends it to the beginning.
236 Indexscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Rule#Index. *int
237
238 // Handle is a rule handle. In Add or Insert, if set, this is the handle of
239 // existing rule to put the new rule after/before. In Delete or Replace, this
240 // indicates the existing rule to delete/replace, and is mandatory. In the result
241 // of a List, this will indicate the rule's handle that can then be used in a
242 // later operation.
243 Handlescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Rule#Handle. *int
244 }
245
246 // SetFlag represents a set or map flag
247 type SetFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetFlag# string
248
249 const (
250 // ConstantFlag is a flag indicating that the set/map is constant. FIXME UNDOCUMENTED
251 ConstantFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/ConstantFlag. SetFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetFlag# = "constant"
252
253 // DynamicFlag is a flag indicating that the set contains stateful objects
254 // (counters, quotas, or limits) that will be dynamically updated.
255 DynamicFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/DynamicFlag. SetFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetFlag# = "dynamic"
256
257 // IntervalFlag is a flag indicating that the set contains either CIDR elements or
258 // IP ranges.
259 IntervalFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/IntervalFlag. SetFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetFlag# = "interval"
260
261 // TimeoutFlag is a flag indicating that the set/map has a timeout after which
262 // dynamically added elements will be removed. (It is set automatically if the
263 // set/map has a Timeout.)
264 TimeoutFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/TimeoutFlag. SetFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetFlag# = "timeout"
265 )
266
267 // SetPolicy represents a set or map storage policy
268 type SetPolicyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetPolicy# string
269
270 const (
271 // PolicyPerformance FIXME
272 PerformancePolicyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/PerformancePolicy. SetPolicyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetPolicy# = "performance"
273
274 // PolicyMemory FIXME
275 MemoryPolicyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/MemoryPolicy. SetPolicyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetPolicy# = "memory"
276 )
277
278 // Set represents the definition of an nftables set (but not its elements)
279 type Setscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set# struct {
280 // Name is the name of the set.
281 Namescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#Name. string
282
283 // Type is the type of the set key (eg "ipv4_addr"). Either Type or TypeOf, but
284 // not both, must be non-empty.
285 Typescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#Type. string
286
287 // TypeOf is the type of the set key as an nftables expression (eg "ip saddr").
288 // Either Type or TypeOf, but not both, must be non-empty. (Requires at least nft
289 // 0.9.4, and newer than that for some types.)
290 TypeOfscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#TypeOf. string
291
292 // Flags are the set flags
293 Flagsscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#Flags. []SetFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetFlag#
294
295 // Timeout is the time that an element will stay in the set before being removed.
296 // (Optional; mandatory for sets that will be added to from the packet path)
297 Timeoutscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#Timeout. *timescip-go gomod github.com/golang/go/src go1.20 time/.Durationscip-go gomod github.com/golang/go/src go1.20 time/Duration#
298
299 // GCInterval is the interval at which timed-out elements will be removed from the
300 // set. (Optional; FIXME DEFAULT)
301 GCIntervalscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#GCInterval. *timescip-go gomod github.com/golang/go/src go1.20 time/.Durationscip-go gomod github.com/golang/go/src go1.20 time/Duration#
302
303 // Size if the maximum numer of elements in the set.
304 // (Optional; mandatory for sets that will be added to from the packet path)
305 Sizescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#Size. *uint64
306
307 // Policy is the FIXME
308 Policyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#Policy. *SetPolicyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetPolicy#
309
310 // AutoMerge indicates that adjacent/overlapping set elements should be merged
311 // together (only for interval sets)
312 AutoMergescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#AutoMerge. *bool
313
314 // Comment is an optional comment for the object. (Requires kernel >= 5.10 and
315 // nft >= 0.9.7; otherwise this field will be silently ignored.)
316 Commentscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#Comment. *string
317
318 // Handle is an identifier that can be used to uniquely identify an object when
319 // deleting it. When adding a new object, this must be nil
320 Handlescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Set#Handle. *int
321 }
322
323 // Map represents the definition of an nftables map (but not its elements)
324 type Mapscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map# struct {
325 // Name is the name of the map.
326 Namescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#Name. string
327
328 // Type is the type of the map key and value (eg "ipv4_addr : verdict"). Either
329 // Type or TypeOf, but not both, must be non-empty.
330 Typescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#Type. string
331
332 // TypeOf is the type of the set key as an nftables expression (eg "ip saddr : verdict").
333 // Either Type or TypeOf, but not both, must be non-empty. (Requires at least nft 0.9.4,
334 // and newer than that for some types.)
335 TypeOfscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#TypeOf. string
336
337 // Flags are the map flags
338 Flagsscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#Flags. []SetFlagscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetFlag#
339
340 // Timeout is the time that an element will stay in the set before being removed.
341 // (Optional; mandatory for sets that will be added to from the packet path)
342 Timeoutscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#Timeout. *timescip-go gomod github.com/golang/go/src go1.20 time/.Durationscip-go gomod github.com/golang/go/src go1.20 time/Duration#
343
344 // GCInterval is the interval at which timed-out elements will be removed from the
345 // set. (Optional; FIXME DEFAULT)
346 GCIntervalscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#GCInterval. *timescip-go gomod github.com/golang/go/src go1.20 time/.Durationscip-go gomod github.com/golang/go/src go1.20 time/Duration#
347
348 // Size if the maximum numer of elements in the set.
349 // (Optional; mandatory for sets that will be added to from the packet path)
350 Sizescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#Size. *uint64
351
352 // Policy is the FIXME
353 Policyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#Policy. *SetPolicyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/SetPolicy#
354
355 // Comment is an optional comment for the object. (Requires kernel >= 5.10 and
356 // nft >= 0.9.7; otherwise this field will be silently ignored.)
357 Commentscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#Comment. *string
358
359 // Handle is an identifier that can be used to uniquely identify an object when
360 // deleting it. When adding a new object, this must be nil
361 Handlescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Map#Handle. *int
362 }
363
364 // Element represents a set or map element
365 type Elementscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Element# struct {
366 // Set is the name of the set that contains this element (or the empty string if
367 // this is a map element.)
368 Setscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Element#Set. string
369
370 // Map is the name of the map that contains this element (or the empty string if
371 // this is a set element.)
372 Mapscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Element#Map. string
373
374 // Key is the element key. (The list contains a single element for "simple" keys,
375 // or multiple elements for concatenations.)
376 Keyscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Element#Key. []string
377
378 // Value is the map element value. As with Key, this may be a single value or
379 // multiple. For set elements, this must be nil.
380 Valuescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Element#Value. []string
381
382 // Comment is an optional comment for the element
383 Commentscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Element#Comment. *string
384 }
385
386 type FlowtableIngressPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/FlowtableIngressPriority# string
387
388 const (
389 // FilterIngressPriority is the priority for the filter value in the Ingress hook
390 // that stands for 0.
391 FilterIngressPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/FilterIngressPriority. FlowtableIngressPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/FlowtableIngressPriority# = "filter"
392 )
393
394 // Flowtable represents an nftables flowtable.
395 // https://wiki.nftables.org/wiki-nftables/index.php/Flowtables
396 type Flowtablescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Flowtable# struct {
397 // Name is the name of the flowtable.
398 Namescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Flowtable#Name. string
399
400 // The Priority can be a signed integer or FlowtableIngressPriority which stands for 0.
401 // Addition and subtraction can be used to set relative priority, e.g. filter + 5 equals to 5.
402 Priorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Flowtable#Priority. *FlowtableIngressPriorityscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/FlowtableIngressPriority#
403
404 // The Devices are specified as iifname(s) of the input interface(s) of the traffic
405 // that should be offloaded.
406 Devicesscip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Flowtable#Devices. []string
407
408 // Handle is an identifier that can be used to uniquely identify an object when
409 // deleting it. When adding a new object, this must be nil
410 Handlescip-go gomod sigs.k8s.io/knftables . `sigs.k8s.io/knftables`/Flowtable#Handle. *int
411 }