1 /* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */ 2 #ifndef _NFNL_HOOK_H_ 3 #define _NFNL_HOOK_H_ 4 5 enum nfnl_hook_msg_types { 6 NFNL_MSG_HOOK_GET, 7 NFNL_MSG_HOOK_MAX, 8 }; 9 10 /** 11 * enum nfnl_hook_attributes - netfilter hook netlink attributes 12 * 13 * @NFNLA_HOOK_HOOKNUM: netfilter hook number (NLA_U32) 14 * @NFNLA_HOOK_PRIORITY: netfilter hook priority (NLA_U32) 15 * @NFNLA_HOOK_DEV: netdevice name (NLA_STRING) 16 * @NFNLA_HOOK_FUNCTION_NAME: hook function name (NLA_STRING) 17 * @NFNLA_HOOK_MODULE_NAME: kernel module that registered this hook (NLA_STRING) 18 * @NFNLA_HOOK_CHAIN_INFO: basechain hook metadata (NLA_NESTED) 19 */ 20 enum nfnl_hook_attributes { 21 NFNLA_HOOK_UNSPEC, 22 NFNLA_HOOK_HOOKNUM, 23 NFNLA_HOOK_PRIORITY, 24 NFNLA_HOOK_DEV, 25 NFNLA_HOOK_FUNCTION_NAME, 26 NFNLA_HOOK_MODULE_NAME, 27 NFNLA_HOOK_CHAIN_INFO, 28 __NFNLA_HOOK_MAX 29 }; 30 #define NFNLA_HOOK_MAX (__NFNLA_HOOK_MAX - 1) 31 32 /** 33 * enum nfnl_hook_chain_info_attributes - chain description 34 * 35 * @NFNLA_HOOK_INFO_DESC: nft chain and table name (NLA_NESTED) 36 * @NFNLA_HOOK_INFO_TYPE: chain type (enum nfnl_hook_chaintype) (NLA_U32) 37 * 38 * NFNLA_HOOK_INFO_DESC depends on NFNLA_HOOK_INFO_TYPE value: 39 * NFNL_HOOK_TYPE_NFTABLES: enum nft_table_attributes 40 * NFNL_HOOK_TYPE_BPF: enum nfnl_hook_bpf_attributes 41 */ 42 enum nfnl_hook_chain_info_attributes { 43 NFNLA_HOOK_INFO_UNSPEC, 44 NFNLA_HOOK_INFO_DESC, 45 NFNLA_HOOK_INFO_TYPE, 46 __NFNLA_HOOK_INFO_MAX, 47 }; 48 #define NFNLA_HOOK_INFO_MAX (__NFNLA_HOOK_INFO_MAX - 1) 49 50 enum nfnl_hook_chain_desc_attributes { 51 NFNLA_CHAIN_UNSPEC, 52 NFNLA_CHAIN_TABLE, 53 NFNLA_CHAIN_FAMILY, 54 NFNLA_CHAIN_NAME, 55 __NFNLA_CHAIN_MAX, 56 }; 57 #define NFNLA_CHAIN_MAX (__NFNLA_CHAIN_MAX - 1) 58 59 /** 60 * enum nfnl_hook_chaintype - chain type 61 * 62 * @NFNL_HOOK_TYPE_NFTABLES: nf_tables base chain 63 * @NFNL_HOOK_TYPE_BPF: bpf program 64 */ 65 enum nfnl_hook_chaintype { 66 NFNL_HOOK_TYPE_NFTABLES = 0x1, 67 NFNL_HOOK_TYPE_BPF, 68 }; 69 70 /** 71 * enum nfnl_hook_bpf_attributes - bpf prog description 72 * 73 * @NFNLA_HOOK_BPF_ID: bpf program id (NLA_U32) 74 */ 75 enum nfnl_hook_bpf_attributes { 76 NFNLA_HOOK_BPF_UNSPEC, 77 NFNLA_HOOK_BPF_ID, 78 __NFNLA_HOOK_BPF_MAX, 79 }; 80 #define NFNLA_HOOK_BPF_MAX (__NFNLA_HOOK_BPF_MAX - 1) 81 82 #endif /* _NFNL_HOOK_H */ 83