Commit 13a370b9 authored by Andrey Ignatov's avatar Andrey Ignatov Committed by Daniel Borkmann

bpftool: Support sendmsg{4,6} attach types

Add support for recently added BPF_CGROUP_UDP4_SENDMSG and
BPF_CGROUP_UDP6_SENDMSG attach types to bpftool, update documentation
and bash completion.
Signed-off-by: default avatarAndrey Ignatov <rdna@fb.com>
Reviewed-by: default avatarJakub Kicinski <jakub.kicinski@netronome.com>
Acked-by: default avatarSong Liu <songliubraving@fb.com>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
parent ee7dbd97
...@@ -27,7 +27,8 @@ MAP COMMANDS ...@@ -27,7 +27,8 @@ MAP COMMANDS
| |
| *PROG* := { **id** *PROG_ID* | **pinned** *FILE* | **tag** *PROG_TAG* } | *PROG* := { **id** *PROG_ID* | **pinned** *FILE* | **tag** *PROG_TAG* }
| *ATTACH_TYPE* := { **ingress** | **egress** | **sock_create** | **sock_ops** | **device** | | *ATTACH_TYPE* := { **ingress** | **egress** | **sock_create** | **sock_ops** | **device** |
| **bind4** | **bind6** | **post_bind4** | **post_bind6** | **connect4** | **connect6** } | **bind4** | **bind6** | **post_bind4** | **post_bind6** | **connect4** | **connect6** |
| **sendmsg4** | **sendmsg6** }
| *ATTACH_FLAGS* := { **multi** | **override** } | *ATTACH_FLAGS* := { **multi** | **override** }
DESCRIPTION DESCRIPTION
...@@ -70,7 +71,11 @@ DESCRIPTION ...@@ -70,7 +71,11 @@ DESCRIPTION
**post_bind4** return from bind(2) for an inet4 socket (since 4.17); **post_bind4** return from bind(2) for an inet4 socket (since 4.17);
**post_bind6** return from bind(2) for an inet6 socket (since 4.17); **post_bind6** return from bind(2) for an inet6 socket (since 4.17);
**connect4** call to connect(2) for an inet4 socket (since 4.17); **connect4** call to connect(2) for an inet4 socket (since 4.17);
**connect6** call to connect(2) for an inet6 socket (since 4.17). **connect6** call to connect(2) for an inet6 socket (since 4.17);
**sendmsg4** call to sendto(2), sendmsg(2), sendmmsg(2) for an
unconnected udp4 socket (since 4.18);
**sendmsg6** call to sendto(2), sendmsg(2), sendmmsg(2) for an
unconnected udp6 socket (since 4.18).
**bpftool cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG* **bpftool cgroup detach** *CGROUP* *ATTACH_TYPE* *PROG*
Detach *PROG* from the cgroup *CGROUP* and attach type Detach *PROG* from the cgroup *CGROUP* and attach type
......
...@@ -407,7 +407,7 @@ _bpftool() ...@@ -407,7 +407,7 @@ _bpftool()
attach|detach) attach|detach)
local ATTACH_TYPES='ingress egress sock_create sock_ops \ local ATTACH_TYPES='ingress egress sock_create sock_ops \
device bind4 bind6 post_bind4 post_bind6 connect4 \ device bind4 bind6 post_bind4 post_bind6 connect4 \
connect6' connect6 sendmsg4 sendmsg6'
local ATTACH_FLAGS='multi override' local ATTACH_FLAGS='multi override'
local PROG_TYPE='id pinned tag' local PROG_TYPE='id pinned tag'
case $prev in case $prev in
...@@ -416,7 +416,8 @@ _bpftool() ...@@ -416,7 +416,8 @@ _bpftool()
return 0 return 0
;; ;;
ingress|egress|sock_create|sock_ops|device|bind4|bind6|\ ingress|egress|sock_create|sock_ops|device|bind4|bind6|\
post_bind4|post_bind6|connect4|connect6) post_bind4|post_bind6|connect4|connect6|sendmsg4|\
sendmsg6)
COMPREPLY=( $( compgen -W "$PROG_TYPE" -- \ COMPREPLY=( $( compgen -W "$PROG_TYPE" -- \
"$cur" ) ) "$cur" ) )
return 0 return 0
......
...@@ -20,7 +20,7 @@ ...@@ -20,7 +20,7 @@
" ATTACH_TYPE := { ingress | egress | sock_create |\n" \ " ATTACH_TYPE := { ingress | egress | sock_create |\n" \
" sock_ops | device | bind4 | bind6 |\n" \ " sock_ops | device | bind4 | bind6 |\n" \
" post_bind4 | post_bind6 | connect4 |\n" \ " post_bind4 | post_bind6 | connect4 |\n" \
" connect6 }" " connect6 | sendmsg4 | sendmsg6 }"
static const char * const attach_type_strings[] = { static const char * const attach_type_strings[] = {
[BPF_CGROUP_INET_INGRESS] = "ingress", [BPF_CGROUP_INET_INGRESS] = "ingress",
...@@ -34,6 +34,8 @@ static const char * const attach_type_strings[] = { ...@@ -34,6 +34,8 @@ static const char * const attach_type_strings[] = {
[BPF_CGROUP_INET6_CONNECT] = "connect6", [BPF_CGROUP_INET6_CONNECT] = "connect6",
[BPF_CGROUP_INET4_POST_BIND] = "post_bind4", [BPF_CGROUP_INET4_POST_BIND] = "post_bind4",
[BPF_CGROUP_INET6_POST_BIND] = "post_bind6", [BPF_CGROUP_INET6_POST_BIND] = "post_bind6",
[BPF_CGROUP_UDP4_SENDMSG] = "sendmsg4",
[BPF_CGROUP_UDP6_SENDMSG] = "sendmsg6",
[__MAX_BPF_ATTACH_TYPE] = NULL, [__MAX_BPF_ATTACH_TYPE] = NULL,
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment