summaryrefslogtreecommitdiffstats
path: root/src/statement.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2019-05-12 20:52:43 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2019-05-12 20:54:19 +0200
commit0f31d8258e7ead5bd3944080e6cec7d4074149e7 (patch)
tree57247981c948e9073a9df656afeaeb4ed92b0179 /src/statement.c
parent47ffae232aeaadca37293861d52a11f907d6b768 (diff)
src: use definitions in include/linux/netfilter/nf_tables.h
Use NFT_LOGLEVEL_* definitions in UAPI. Make an internal definition of NFT_OSF_F_VERSION, this was originally defined in the UAPI header in the initial patch version, however, this is not available anymore. Add a bison rule to deal with the timeout case. Otherwise, compilation breaks. Fixes: d3869cae9d62 ("include: refresh nf_tables.h cached copy") Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'src/statement.c')
-rw-r--r--src/statement.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/src/statement.c b/src/statement.c
index 7f9c10b3..a9e8b3ae 100644
--- a/src/statement.c
+++ b/src/statement.c
@@ -256,21 +256,21 @@ struct stmt *objref_stmt_alloc(const struct location *loc)
return stmt;
}
-static const char *syslog_level[LOGLEVEL_AUDIT + 1] = {
- [LOG_EMERG] = "emerg",
- [LOG_ALERT] = "alert",
- [LOG_CRIT] = "crit",
- [LOG_ERR] = "err",
- [LOG_WARNING] = "warn",
- [LOG_NOTICE] = "notice",
- [LOG_INFO] = "info",
- [LOG_DEBUG] = "debug",
- [LOGLEVEL_AUDIT] = "audit"
+static const char *syslog_level[NFT_LOGLEVEL_MAX + 1] = {
+ [NFT_LOGLEVEL_EMERG] = "emerg",
+ [NFT_LOGLEVEL_ALERT] = "alert",
+ [NFT_LOGLEVEL_CRIT] = "crit",
+ [NFT_LOGLEVEL_ERR] = "err",
+ [NFT_LOGLEVEL_WARNING] = "warn",
+ [NFT_LOGLEVEL_NOTICE] = "notice",
+ [NFT_LOGLEVEL_INFO] = "info",
+ [NFT_LOGLEVEL_DEBUG] = "debug",
+ [NFT_LOGLEVEL_AUDIT] = "audit"
};
const char *log_level(uint32_t level)
{
- if (level > LOGLEVEL_AUDIT)
+ if (level > NFT_LOGLEVEL_MAX)
return "unknown";
return syslog_level[level];
@@ -280,7 +280,7 @@ int log_level_parse(const char *level)
{
int i;
- for (i = 0; i <= LOGLEVEL_AUDIT; i++) {
+ for (i = 0; i <= NFT_LOGLEVEL_MAX; i++) {
if (syslog_level[i] &&
!strcmp(level, syslog_level[i]))
return i;