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).
Showing the changes to include/uapi/linux (2 of 4 files). Show all
Unified · Split
| @@ -369,6 +369,7 @@ enum { · 368 unmodified lines | ||
| 369 | 369 | TCA_BPF_FLAGS, |
| 370 | 370 | TCA_BPF_FLAGS_GEN, |
| 371 | 371 | TCA_BPF_TAG, |
| 372 | + TCA_BPF_ID, | |
| 372 | 373 | __TCA_BPF_MAX, |
| 373 | 374 | }; |
| 374 | 375 | |
| @@ -28,6 +28,7 @@ enum { · 27 unmodified lines | ||
| 28 | 28 | TCA_ACT_BPF_NAME, |
| 29 | 29 | TCA_ACT_BPF_PAD, |
| 30 | 30 | TCA_ACT_BPF_TAG, |
| 31 | + TCA_ACT_BPF_ID, | |
| 31 | 32 | __TCA_ACT_BPF_MAX, |
| 32 | 33 | }; |
| 33 | 34 | #define TCA_ACT_BPF_MAX (__TCA_ACT_BPF_MAX - 1) |