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
1099#define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1)1099#define NFTA_LOG_MAX (__NFTA_LOG_MAX - 1)
1100 1100
1101/**1101/**
1102 * LOGLEVEL_AUDIT - a pseudo log level enabling audit logging1102 * enum nft_log_level - nf_tables log levels
1103 */1103 *
1104#define LOGLEVEL_AUDIT 81104 * @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 */
1114enum 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)
1105 1127
1106/**1128/**
1107 * enum nft_queue_attributes - nf_tables queue expression netlink attributes1129 * enum nft_queue_attributes - nf_tables queue expression netlink attributes