You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: doc/usage/bfcli.rst
+6-4Lines changed: 6 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -340,6 +340,8 @@ With:
340
340
- ``BF_HOOK_NF_LOCAL_OUT``: similar to ``nftables`` and ``iptables`` output hook.
341
341
- ``BF_HOOK_NF_POST_ROUTING``: similar to ``nftables`` and ``iptables`` postrouting hook.
342
342
- ``BF_HOOK_TC_EGRESS``: egress TC hook.
343
+
- ``BF_HOOK_CGROUP_SOCK_ADDR_CONNECT4``: cgroup hook for IPv4 ``connect()`` syscalls.
344
+
- ``BF_HOOK_CGROUP_SOCK_ADDR_CONNECT6``: cgroup hook for IPv6 ``connect()`` syscalls.
343
345
- ``$POLICY``: action taken if no rule matches the packet, either ``ACCEPT`` forward the packet to the kernel, or ``DROP`` to discard it. Note while ``CONTINUE`` is a valid verdict for rules, it is not supported for chain policy.
344
346
345
347
``$OPTIONS`` are hook-specific comma separated key value pairs. A given hook option can only be specified once:
- ``$MATCHER``: zero or more matchers. Matchers are defined later.
391
393
- ``log``: optional. If set, log the requested protocol headers. ``link`` will log the link (layer 2) header, ``internet`` with log the internet (layer 3) header, and ``transport`` will log the transport (layer 4) header. At least one header type is required.
392
-
- ``counter``: optional literal. If set, the filter will counter the number of packets and bytes matched by the rule.
394
+
- ``counter``: optional literal. If set, the filter will count the number of events matched by the rule. For packet-based hooks, this includes both the number of packets and the total bytes. For ``BF_HOOK_CGROUP_SOCK_ADDR_*`` hooks, this counts the number of ``connect()`` calls.
393
395
- ``mark``: optional, ``$MARK`` must be a valid decimal or hexadecimal 32-bits value. If set, write the packet's marker value. This marker can be used later on in a rule (see ``meta.mark``) or with a TC filter.
394
396
- ``$VERDICT``: action taken by the rule if the packet is matched against **all** the criteria: either ``ACCEPT``, ``DROP``, ``CONTINUE``, or ``REDIRECT``.
395
397
- ``ACCEPT``: forward the packet to the kernel.
@@ -407,7 +409,7 @@ Note ``CONTINUE`` means a packet can be counted more than once if multiple rules
407
409
- ``BF_HOOK_XDP``: only ``out`` direction is supported (XDP always transmits out of the target interface).
408
410
- ``BF_HOOK_TC_INGRESS``, ``BF_HOOK_TC_EGRESS``: both ``in`` and ``out`` directions are supported.
409
411
410
-
``REDIRECT`` is **not** supported by Netfilter (``BF_HOOK_NF_*``) or cgroup_skb (``BF_HOOK_CGROUP_SKB_*``) hooks.
412
+
``REDIRECT`` is **not** supported by Netfilter (``BF_HOOK_NF_*``), cgroup_skb (``BF_HOOK_CGROUP_SKB_*``), or cgroup_sock_addr (``BF_HOOK_CGROUP_SOCK_ADDR_*``) hooks.
411
413
412
414
Sets
413
415
~~~~
@@ -539,7 +541,7 @@ Meta
539
541
- ``meta.probability``
540
542
- ``eq``
541
543
- ``$PROBABILITY``
542
-
- ``$PROBABILITY`` is a floating-point percentage value (i.e., within [0%, 100%], e.g., "50%" or "33.33%").
544
+
- ``$PROBABILITY`` is a floating-point percentage value (i.e., within [0%, 100%], e.g., "50%" or "33.33%"). For ``BF_HOOK_CGROUP_SOCK_ADDR_*`` hooks, probability applies at the connection level: each ``connect()`` call is independently accepted or dropped.
Copy file name to clipboardExpand all lines: doc/usage/daemon.rst
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -36,4 +36,4 @@ Namespaces
36
36
37
37
The network namespace will define the available interface indexes to attach the XDP and TC chains, as well as the interface indexes to filter packets on.
38
38
39
-
The mount namespace is required to ensure the daemon will attach a cgroup_skb chain to the proper cgroup.
39
+
The mount namespace is required to ensure the daemon will attach a cgroup_skb or cgroup_sock_addr chain to the proper cgroup.
0 commit comments