Lines Matching +full:level +full:- +full:triggered
1 .. SPDX-License-Identifier: GPL-2.0
10 * ``BPF_CGROUP_GETSOCKOPT`` - called every time process executes ``getsockopt``
12 * ``BPF_CGROUP_SETSOCKOPT`` - called every time process executes ``setsockopt``
16 all input arguments: ``level``, ``optname``, ``optval`` and ``optlen``.
21 ``BPF_CGROUP_SETSOCKOPT`` is triggered *before* the kernel handling of
26 If BPF program sets ``optlen`` to -1, the control will be returned
30 Note, that ``optlen`` can not be increased beyond the user-supplied
31 value. It can only be decreased or set to -1. Any other value will
35 -----------
37 * ``0`` - reject the syscall, ``EPERM`` will be returned to the userspace.
38 * ``1`` - success, continue with next BPF program in the cgroup chain.
43 ``BPF_CGROUP_GETSOCKOPT`` is triggered *after* the kernel handing of
57 -----------
59 * ``0`` - reject the syscall, ``EPERM`` will be returned to the userspace.
60 * ``1`` - success: copy ``optval`` and ``optlen`` to userspace, return
68 has ``BPF_CGROUP_GETSOCKOPT`` attached at each level with
84 to the input arguments (``level``, ``optname``, ``optval``, ``optlen``),
110 .. code-block:: c
116 if (ctx->level == MY_SOL && ctx->optname == MY_OPTNAME) {
117 ctx->retval = 0;
119 ctx->optlen = 1;
124 if (ctx->level == SOL_IP && ctx->optname == IP_FREEBIND) {
125 ctx->retval = 0;
127 ctx->optlen = 1;
132 if (ctx->optlen > PAGE_SIZE)
133 ctx->optlen = 0;
142 if (ctx->level == MY_SOL && ctx->optname == MY_OPTNAME) {
144 ctx->optlen = -1;
149 if (ctx->level == SOL_IP && ctx->optname == IP_FREEBIND) {
155 if (ctx->optlen > PAGE_SIZE)
156 ctx->optlen = 0;