bpftool
bpftool copied to clipboard
Pass map flags in a user-friendly way
Extract from man bpftool-map:
bpftool map create FILE type TYPE key KEY_SIZE value VALUE_SIZE
entries MAX_ENTRIES name NAME [flags FLAGS] [inner_map MAP]
[dev NAME]
bpftool map dump MAP
bpftool map update MAP [key DATA] [value VALUE] [UPDATE_FLAGS]
Instead of passing integer for FLAGS and UPDATE_FLAGS that are the sum of all relevant flags, we could support something more user-friendly as well, like a comma-separated list of flags: BPF_F_NO_PREALLOC,BPF_F_RDONLY,...