/** * Exports BPF uapi enums and other constants. * * Keep synchronized with `deps/libbpf/include/uapi/linux/bpf.h`. * For practicity, we omit the UNSPEC = 0 key from each enum, if present. */ /** */ /** * Maximum length of object names, in bytes, including NUL terminator. * Longer names will be truncated. */ export declare const OBJ_NAME_LEN = 16; export declare enum ProgramType { SOCKET_FILTER = 1, KPROBE = 2, SCHED_CLS = 3, SCHED_ACT = 4, TRACEPOINT = 5, XDP = 6, PERF_EVENT = 7, CGROUP_SKB = 8, CGROUP_SOCK = 9, LWT_IN = 10, LWT_OUT = 11, LWT_XMIT = 12, SOCK_OPS = 13, SK_SKB = 14, CGROUP_DEVICE = 15, SK_MSG = 16, RAW_TRACEPOINT = 17, CGROUP_SOCK_ADDR = 18, LWT_SEG6LOCAL = 19, LIRC_MODE2 = 20, SK_REUSEPORT = 21, FLOW_DISSECTOR = 22, CGROUP_SYSCTL = 23, RAW_TRACEPOINT_WRITABLE = 24, CGROUP_SOCKOPT = 25, TRACING = 26, STRUCT_OPS = 27, EXT = 28, LSM = 29, SK_LOOKUP = 30 } export declare enum AttachType { CGROUP_INET_INGRESS = 0, CGROUP_INET_EGRESS = 1, CGROUP_INET_SOCK_CREATE = 2, CGROUP_SOCK_OPS = 3, SK_SKB_STREAM_PARSER = 4, SK_SKB_STREAM_VERDICT = 5, CGROUP_DEVICE = 6, SK_MSG_VERDICT = 7, CGROUP_INET4_BIND = 8, CGROUP_INET6_BIND = 9, CGROUP_INET4_CONNECT = 10, CGROUP_INET6_CONNECT = 11, CGROUP_INET4_POST_BIND = 12, CGROUP_INET6_POST_BIND = 13, CGROUP_UDP4_SENDMSG = 14, CGROUP_UDP6_SENDMSG = 15, LIRC_MODE2 = 16, FLOW_DISSECTOR = 17, CGROUP_SYSCTL = 18, CGROUP_UDP4_RECVMSG = 19, CGROUP_UDP6_RECVMSG = 20, CGROUP_GETSOCKOPT = 21, CGROUP_SETSOCKOPT = 22, TRACE_RAW_TP = 23, TRACE_FENTRY = 24, TRACE_FEXIT = 25, MODIFY_RETURN = 26, LSM_MAC = 27, TRACE_ITER = 28, CGROUP_INET4_GETPEERNAME = 29, CGROUP_INET6_GETPEERNAME = 30, CGROUP_INET4_GETSOCKNAME = 31, CGROUP_INET6_GETSOCKNAME = 32, XDP_DEVMAP = 33, CGROUP_INET_SOCK_RELEASE = 34, XDP_CPUMAP = 35, SK_LOOKUP = 36, XDP = 37, SK_SKB_VERDICT = 38 } export declare enum MapType { /** [Hash](https://github.com/torvalds/linux/commit/0f8e4bd8a1fc8c4185f1630061d0a1f2d197a475) (since Linux 3.19) */ HASH = 1, /** [Array](https://github.com/torvalds/linux/commit/28fbcfa08d8ed7c5a50d41a0433aad222835e8e3) (since Linux 3.19) */ ARRAY = 2, /** [Tail call](https://github.com/torvalds/linux/commit/04fd61ab36ec065e194ab5e74ae34a5240d992bb) (since Linux 4.2) */ PROG_ARRAY = 3, /** [Perf events](https://github.com/torvalds/linux/commit/ea317b267e9d03a8241893aa176fba7661d07579) (since Linux 4.3) */ PERF_EVENT_ARRAY = 4, /** [Per-CPU hash](https://github.com/torvalds/linux/commit/824bd0ce6c7c43a9e1e210abf124958e54d88342) (since Linux 4.6) */ PERCPU_HASH = 5, /** [Per-CPU array](https://github.com/torvalds/linux/commit/a10423b87a7eae75da79ce80a8d9475047a674ee) (since Linux 4.6) */ PERCPU_ARRAY = 6, /** [Stack trace](https://github.com/torvalds/linux/commit/d5a3b1f691865be576c2bffa708549b8cdccda19) (since Linux 4.6) */ STACK_TRACE = 7, /** [cgroup array](https://github.com/torvalds/linux/commit/4ed8ec521ed57c4e207ad464ca0388776de74d4b) (since Linux 4.8) */ CGROUP_ARRAY = 8, /** [LRU hash](https://github.com/torvalds/linux/commit/3a08c2fd763450a927d1130de078d6f9e74944fb) (since Linux 4.10) */ LRU_HASH = 9, /** [LRU per-CPU hash](https://github.com/torvalds/linux/commit/961578b63474d13ad0e2f615fcc2901c5197dda6) (since Linux 4.10) */ LRU_PERCPU_HASH = 10, /** [LPM trie (longest-prefix match)](https://github.com/torvalds/linux/commit/b95a5c4db09bc7c253636cb84dc9b12c577fd5a0) (since Linux 4.11) */ LPM_TRIE = 11, /** [Array of maps](https://github.com/torvalds/linux/commit/56f668dfe00dcf086734f1c42ea999398fad6572) (since Linux 4.12) */ ARRAY_OF_MAPS = 12, /** [Hash of maps](https://github.com/torvalds/linux/commit/bcc6b1b7ebf857a9fe56202e2be3361131588c15) (since Linux 4.12) */ HASH_OF_MAPS = 13, /** [Netdevice references](https://github.com/torvalds/linux/commit/546ac1ffb70d25b56c1126940e5ec639c4dd7413) (since Linux 4.14) */ DEVMAP = 14, /** [Socket references (array)](https://github.com/torvalds/linux/commit/174a79ff9515f400b9a6115643dafd62a635b7e6) (since Linux 4.14) */ SOCKMAP = 15, /** [CPU references](https://github.com/torvalds/linux/commit/6710e1126934d8b4372b4d2f9ae1646cd3f151bf) (since Linux 4.15) */ CPUMAP = 16, /** [AF_XDP socket (XSK) references](https://github.com/torvalds/linux/commit/fbfc504a24f53f7ebe128ab55cb5dba634f4ece8) (since Linux 4.18) */ XSKMAP = 17, /** [Socket references (hashmap)](https://github.com/torvalds/linux/commit/81110384441a59cff47430f20f049e69b98c17f4) (since Linux 4.18) */ SOCKHASH = 18, /** [cgroup storage](https://github.com/torvalds/linux/commit/de9cbbaadba5adf88a19e46df61f7054000838f6) (since Linux 4.19) */ CGROUP_STORAGE = 19, /** [reuseport sockarray](https://github.com/torvalds/linux/commit/5dc4c4b7d4e8115e7cde96a030f98cb3ab2e458c) (since Linux 4.19) */ REUSEPORT_SOCKARRAY = 20, /** [precpu cgroup storage](https://github.com/torvalds/linux/commit/b741f1630346defcbc8cc60f1a2bdae8b3b0036f) (since Linux 4.20) */ PERCPU_CGROUP_STORAGE = 21, /** [queue](https://github.com/torvalds/linux/commit/f1a2e44a3aeccb3ff18d3ccc0b0203e70b95bd92) (since Linux 4.20) */ QUEUE = 22, /** [stack](https://github.com/torvalds/linux/commit/f1a2e44a3aeccb3ff18d3ccc0b0203e70b95bd92) (since Linux 4.20) */ STACK = 23, /** [socket local storage](https://github.com/torvalds/linux/commit/6ac99e8f23d4b10258406ca0dd7bffca5f31da9d) (since Linux 5.2) */ SK_STORAGE = 24, /** [Netdevice references (hashmap)](https://github.com/torvalds/linux/commit/6f9d451ab1a33728adb72d7ff66a7b374d665176) (since Linux 5.4) */ DEVMAP_HASH = 25, /** [struct ops](https://github.com/torvalds/linux/commit/85d33df357b634649ddbe0a20fd2d0fc5732c3cb) (since Linux 5.6) */ STRUCT_OPS = 26, /** [ring buffer](https://github.com/torvalds/linux/commit/457f44363a8894135c85b7a9afd2bd8196db24ab) (since Linux 5.8) */ RINGBUF = 27 } export declare enum MapFlags { /** * Don't preallocate map memory (since Linux 4.6; * memory wasn't preallocated before) */ NO_PREALLOC = 1, /** * Instead of having one common LRU list in the * BPF_MAP_TYPE_LRU_[PERCPU_]HASH map, use a percpu LRU list * which can scale and perform better. * Note, the LRU nodes (including free nodes) cannot be moved * across different LRU lists. */ NO_COMMON_LRU = 2, /** Specify NUMA node during map creation (since Linux 4.15). */ NUMA_NODE = 4, /** Flags for accessing BPF object from syscall side (since Linux 4.15). */ RDONLY = 8, /** Flags for accessing BPF object from syscall side (since Linux 4.15). */ WRONLY = 16, /** Flag for stack_map, store build_id+offset instead of pointer. */ STACK_BUILD_ID = 32, /** Zero-initialize hash function seed (since Linux 5.0). This should only be used for testing. */ ZERO_SEED = 64, /** Flags for accessing BPF object from program side (since Linux 5.2). */ RDONLY_PROG = 128, /** Flags for accessing BPF object from program side (since Linux 5.2). */ WRONLY_PROG = 256, /** Clone map from listener for newly accepted socket */ CLONE = 512, /** Enable memory-mapping BPF map (since Linux 5.5) */ MMAPABLE = 1024, /** Share perf_event among processes (since Linux 5.10) */ PRESERVE_ELEMS = 2048, /** Create a map that is suitable to be an inner map with dynamic max entries (since Linux 5.10) */ INNER_MAP = 4096 } /** Flags for `set` operation on a map */ export declare enum MapUpdateFlags { /** create new element or update existing */ ANY = 0, /** create new element if it didn't exist */ NOEXIST = 1, /** update existing element */ EXIST = 2, /** spin_lock-ed operation (since Linux 5.1) */ F_LOCK = 4 } /** Flags for `get` operation on a map */ export declare enum MapLookupFlags { /** spin_lock-ed operation (since Linux 5.1) */ F_LOCK = 4 }