summaryrefslogtreecommitdiff
path: root/polux/application/ebtables/extensions/ebtable_nat.c
diff options
context:
space:
mode:
Diffstat (limited to 'polux/application/ebtables/extensions/ebtable_nat.c')
-rwxr-xr-xpolux/application/ebtables/extensions/ebtable_nat.c29
1 files changed, 29 insertions, 0 deletions
diff --git a/polux/application/ebtables/extensions/ebtable_nat.c b/polux/application/ebtables/extensions/ebtable_nat.c
new file mode 100755
index 0000000000..fc85899bf3
--- /dev/null
+++ b/polux/application/ebtables/extensions/ebtable_nat.c
@@ -0,0 +1,29 @@
+#include <stdio.h>
+#include "../include/ebtables_u.h"
+
+#define NAT_VALID_HOOKS ((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT) | \
+ (1 << NF_BR_POST_ROUTING))
+
+static void print_help(char **hn)
+{
+ int i;
+
+ printf("Supported chains for the nat table:\n");
+ for (i = 0; i < NF_BR_NUMHOOKS; i++)
+ if (NAT_VALID_HOOKS & (1 << i))
+ printf("%s ", hn[i]);
+ printf("\n");
+}
+
+static struct
+ebt_u_table table =
+{
+ .name = "nat",
+ .help = print_help,
+};
+
+//static void _init(void) __attribute__ ((constructor));
+void ebtable_nat_init(void)
+{
+ register_table(&table);
+}