6#include <netlink-private/netlink.h>
7#include <netlink/netfilter/netfilter.h>
8#include <linux/netfilter.h>
10static const struct trans_tbl nfnl_verdicts[] = {
11 __ADD(NF_DROP, NF_DROP),
12 __ADD(NF_ACCEPT, NF_ACCEPT),
13 __ADD(NF_STOLEN, NF_STOLEN),
14 __ADD(NF_QUEUE, NF_QUEUE),
15 __ADD(NF_REPEAT, NF_REPEAT),
16 __ADD(NF_STOP, NF_STOP),
19char *nfnl_verdict2str(
unsigned int verdict,
char *buf,
size_t len)
21 return __type2str(verdict, buf, len, nfnl_verdicts,
22 ARRAY_SIZE(nfnl_verdicts));
25unsigned int nfnl_str2verdict(
const char *name)
27 return __str2type(name, nfnl_verdicts, ARRAY_SIZE(nfnl_verdicts));
30static const struct trans_tbl nfnl_inet_hooks[] = {
31 __ADD(NF_INET_PRE_ROUTING, NF_INET_PREROUTING),
32 __ADD(NF_INET_LOCAL_IN, NF_INET_LOCAL_IN),
33 __ADD(NF_INET_FORWARD, NF_INET_FORWARD),
34 __ADD(NF_INET_LOCAL_OUT, NF_INET_LOCAL_OUT),
35 __ADD(NF_INET_POST_ROUTING, NF_INET_POST_ROUTING),
38char *nfnl_inet_hook2str(
unsigned int hook,
char *buf,
size_t len)
40 return __type2str(hook, buf, len, nfnl_inet_hooks,
41 ARRAY_SIZE(nfnl_inet_hooks));
44unsigned int nfnl_str2inet_hook(
const char *name)
46 return __str2type(name, nfnl_inet_hooks, ARRAY_SIZE(nfnl_inet_hooks));