History

netfilter: nf_tables: add NFT_LOGLEVEL_* enumeration and use it

This is internal, not exposed through uapi, and although it maps with userspace LOG_*, with the introduction of LOGLEVEL_AUDIT we are incurring in namespace pollution. This patch adds the NFT_LOGLEVEL_ enumeration and use it from nft_log.

Pablo Neira Ayuso committed 8 years ago

Commit 7eced5a1 parent 3036bc42 files · +30 −8Browse files

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

Unified · Split

include/uapi/linux/netfilter/nf_tables.h+25−3
@@ -1099,9 +1099,31 @@ enum nft_log_attributes { · 1098 unmodified lines
10991099 #define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1)
11001100
11011101 /**
1102− * LOGLEVEL_AUDIT - a pseudo log level enabling audit logging
1103− */
1104−#define LOGLEVEL_AUDIT 8
1102+ * enum nft_log_level - nf_tables log levels
1103+ *
1104+ * @NFT_LOGLEVEL_EMERG: system is unusable
1105+ * @NFT_LOGLEVEL_ALERT: action must be taken immediately
1106+ * @NFT_LOGLEVEL_CRIT: critical conditions
1107+ * @NFT_LOGLEVEL_ERR: error conditions
1108+ * @NFT_LOGLEVEL_WARNING: warning conditions
1109+ * @NFT_LOGLEVEL_NOTICE: normal but significant condition
1110+ * @NFT_LOGLEVEL_INFO: informational
1111+ * @NFT_LOGLEVEL_DEBUG: debug-level messages
1112+ * @NFT_LOGLEVEL_AUDIT: enabling audit logging
1113+ */
1114+enum nft_log_level {
1115+ NFT_LOGLEVEL_EMERG,
1116+ NFT_LOGLEVEL_ALERT,
1117+ NFT_LOGLEVEL_CRIT,
1118+ NFT_LOGLEVEL_ERR,
1119+ NFT_LOGLEVEL_WARNING,
1120+ NFT_LOGLEVEL_NOTICE,
1121+ NFT_LOGLEVEL_INFO,
1122+ NFT_LOGLEVEL_DEBUG,
1123+ NFT_LOGLEVEL_AUDIT,
1124+ __NFT_LOGLEVEL_MAX
1125+};
1126+#define NFT_LOGLEVEL_MAX (__NFT_LOGLEVEL_MAX + 1)
11051127
11061128 /**
11071129 * enum nft_queue_attributes - nf_tables queue expression netlink attributes