From d891e9e5bc309d5aeb2ab774c76b34a92085b3e7 Mon Sep 17 00:00:00 2001 From: Bart De Schuymer Date: Sat, 1 Jun 2002 19:23:47 +0000 Subject: Initial revision --- userspace/ebtables2/extensions/ebtable_filter.c | 32 +++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 userspace/ebtables2/extensions/ebtable_filter.c (limited to 'userspace/ebtables2/extensions/ebtable_filter.c') diff --git a/userspace/ebtables2/extensions/ebtable_filter.c b/userspace/ebtables2/extensions/ebtable_filter.c new file mode 100644 index 0000000..cf26983 --- /dev/null +++ b/userspace/ebtables2/extensions/ebtable_filter.c @@ -0,0 +1,32 @@ +#include +#include +#include +#include "../include/ebtables_u.h" + +#define FILTER_VALID_HOOKS ((1 << NF_BR_LOCAL_IN) | (1 << NF_BR_FORWARD) | \ + (1 << NF_BR_LOCAL_OUT)) + +static void print_help(char **hn) +{ + int i; + + printf("Supported chains for the filter table:\n"); + for (i = 0; i < NF_BR_NUMHOOKS; i++) + if (FILTER_VALID_HOOKS & (1 << i)) + printf("%s ", hn[i]); + printf("\n"); +} + +static struct ebt_u_table table = +{ + "filter", + NULL, + print_help, + NULL +}; + +static void _init(void) __attribute__ ((constructor)); +static void _init(void) +{ + register_table(&table); +} -- cgit v1.2.3