Bart De Schuymer | ff58720 | 2005-02-08 20:02:28 +0000 | [diff] [blame] | 1 | /* ebtable_nat |
| 2 | * |
| 3 | * Authors: |
| 4 | * Bart De Schuymer <bdschuym@pandora.be> |
| 5 | * |
| 6 | * April, 2002 |
| 7 | */ |
| 8 | |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 9 | #include <stdio.h> |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 10 | #include "../include/ebtables_u.h" |
| 11 | |
| 12 | #define NAT_VALID_HOOKS ((1 << NF_BR_PRE_ROUTING) | (1 << NF_BR_LOCAL_OUT) | \ |
| 13 | (1 << NF_BR_POST_ROUTING)) |
| 14 | |
Bart De Schuymer | 8339ff1 | 2004-01-14 20:05:27 +0000 | [diff] [blame] | 15 | static void print_help(const char **hn) |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 16 | { |
| 17 | int i; |
| 18 | |
| 19 | printf("Supported chains for the nat table:\n"); |
| 20 | for (i = 0; i < NF_BR_NUMHOOKS; i++) |
| 21 | if (NAT_VALID_HOOKS & (1 << i)) |
| 22 | printf("%s ", hn[i]); |
| 23 | printf("\n"); |
| 24 | } |
| 25 | |
| 26 | static struct |
| 27 | ebt_u_table table = |
| 28 | { |
Bart De Schuymer | 7cf1cca | 2003-08-30 16:20:19 +0000 | [diff] [blame] | 29 | .name = "nat", |
| 30 | .help = print_help, |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 31 | }; |
| 32 | |
Bart De Schuymer | 64182a3 | 2004-01-21 20:39:54 +0000 | [diff] [blame] | 33 | void _init(void) |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 34 | { |
Bart De Schuymer | 8339ff1 | 2004-01-14 20:05:27 +0000 | [diff] [blame] | 35 | ebt_register_table(&table); |
Bart De Schuymer | 1abc55d | 2002-06-01 19:23:47 +0000 | [diff] [blame] | 36 | } |