History

bpf: expose prog id for cls_bpf and act_bpf

In order to be able to retrieve the attached programs from cls_bpf and act_bpf, we need to expose the prog ids via netlink so that an application can later on get an fd based on the id through the BPF_PROG_GET_FD_BY_ID command, and dump related prog info via BPF_OBJ_GET_INFO_BY_FD command for bpf(2).

Daniel Borkmann committed 9 years ago

Commit e8628301 parent 34cfb544 files · +8 −0Browse files

Showing the changes to include/uapi/linux (2 of 4 files). Show all

Unified · Split

2 files
  1. include/uapi/linux/pkt_cls.h +1 −0
  2. include/uapi/linux/tc_act/tc_bpf.h +1 −0
include/uapi/linux/pkt_cls.h+1−0
@@ -369,6 +369,7 @@ enum { · 368 unmodified lines
369369 TCA_BPF_FLAGS,
370370 TCA_BPF_FLAGS_GEN,
371371 TCA_BPF_TAG,
372+ TCA_BPF_ID,
372373 __TCA_BPF_MAX,
373374 };
374375
include/uapi/linux/tc_act/tc_bpf.h+1−0
@@ -28,6 +28,7 @@ enum { · 27 unmodified lines
2828 TCA_ACT_BPF_NAME,
2929 TCA_ACT_BPF_PAD,
3030 TCA_ACT_BPF_TAG,
31+ TCA_ACT_BPF_ID,
3132 __TCA_ACT_BPF_MAX,
3233 };
3334 #define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1)