bpftool: Extract helpers for showing link attach type
authorJakub Sitnicki <jakub@cloudflare.com>
Sun, 31 May 2020 08:28:41 +0000 (10:28 +0200)
committerAlexei Starovoitov <ast@kernel.org>
Mon, 1 Jun 2020 22:21:03 +0000 (15:21 -0700)
commitbe6e19818ba626eb1b354490aee40a2cfc1a219f
treedd45dc2eeff5cc6fd1893064d7f46f39413a9018
parentd60d81acc2c180e33244857e35ef60072573b000
bpftool: Extract helpers for showing link attach type

Code for printing link attach_type is duplicated in a couple of places, and
likely will be duplicated for future link types as well. Create helpers to
prevent duplication.

Suggested-by: Andrii Nakryiko <andriin@fb.com>
Signed-off-by: Jakub Sitnicki <jakub@cloudflare.com>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Link: https://lore.kernel.org/bpf/20200531082846.2117903-8-jakub@cloudflare.com
tools/bpf/bpftool/link.c