Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ForwardExists ¶
ForwardExists check that at least 2 rules are present in the CNI-HOSTPORT-DNAT chain and checks for regex matches in the list of rules
func ForwardExistsFromRules ¶
ForwardExistsFromRules checks whether an iptables forwarding rule exists in the provided list of rule strings. Unlike ForwardExists, this function does not query iptables directly, making it suitable for use with pre-captured command output (e.g., from helpers.Custom("iptables", ...)).
func GetRedirectedChain ¶
func GetRedirectedChain(t *testing.T, ipt *iptables.IPTables, chain, namespace, containerID string) string
GetRedirectedChain returns the chain where the traffic is being redirected. This is how libcni manage its port maps. Suppose you have the following rule: -A CNI-HOSTPORT-DNAT -p tcp -m comment --comment "dnat name: \"bridge\" id: \"default-YYYYYY\"" -m multiport --dports 9999 -j CNI-DN-XXXXXX So the chain where the traffic is redirected is CNI-DN-XXXXXX Returns an empty string in case nothing was found.
Types ¶
This section is empty.