Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 1 | #include <stdio.h> |
| 2 | #include <sys/socket.h> |
| 3 | #include "../include/ebtables_u.h" |
| 4 | |
| 5 | #define NAT_VALID_HOOKS ((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT) | \ |
| 6 | (1 << NF_BR_POST_ROUTING)) |
| 7 | |
| 8 | static void print_help(char **hn) |
| 9 | { |
| 10 | int i; |
| 11 | |
| 12 | printf("Supported chains for the nat table:\n"); |
| 13 | for (i = 0; i < NF_BR_NUMHOOKS; i++) |
| 14 | if (NAT_VALID_HOOKS & (1 << i)) |
| 15 | printf("%s ", hn[i]); |
| 16 | printf("\n"); |
| 17 | } |
| 18 | |
| 19 | static struct |
| 20 | ebt_u_table table = |
| 21 | { |
| 22 | "nat", |
| 23 | NULL, |
| 24 | print_help, |
| 25 | NULL |
| 26 | }; |
| 27 | |
| 28 | static void _init(void) __attribute__ ((constructor)); |
| 29 | static void _init(void) |
| 30 | { |
| 31 | register_table(&table); |
| 32 | } |