| Harald Welte | e920f29 | 2002-03-24 20:57:26 +0000 | [diff] [blame] | 1 | /* Shared library add-on to ip6tables to add EUI64 address checking support. */ |
| András Kis-Szabó | 81adae9 | 2001-04-12 15:35:32 +0000 | [diff] [blame] | 2 | #include <stdio.h> |
| 3 | #include <netdb.h> |
| 4 | #include <string.h> |
| 5 | #include <stdlib.h> |
| 6 | #include <getopt.h> |
| 7 | #if defined(__GLIBC__) && __GLIBC__ == 2 |
| 8 | #include <net/ethernet.h> |
| 9 | #else |
| 10 | #include <linux/if_ether.h> |
| 11 | #endif |
| 12 | #include <ip6tables.h> |
| 13 | |
| Jan Engelhardt | 997045f | 2007-10-04 16:29:21 +0000 | [diff] [blame] | 14 | static void eui64_help(void) |
| András Kis-Szabó | 81adae9 | 2001-04-12 15:35:32 +0000 | [diff] [blame] | 15 | { |
| 16 | printf( |
| Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 17 | "eui64 match options:\n" |
| András Kis-Szabó | 81adae9 | 2001-04-12 15:35:32 +0000 | [diff] [blame] | 18 | " This module hasn't got any option\n" |
| Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 19 | " This module checks for EUI64 IPv6 addresses\n"); |
| András Kis-Szabó | 81adae9 | 2001-04-12 15:35:32 +0000 | [diff] [blame] | 20 | } |
| 21 | |
| Jan Engelhardt | 997045f | 2007-10-04 16:29:21 +0000 | [diff] [blame] | 22 | static int eui64_parse(int c, char **argv, int invert, unsigned int *flags, |
| 23 | const void *entry, struct xt_entry_match **match) |
| András Kis-Szabó | 81adae9 | 2001-04-12 15:35:32 +0000 | [diff] [blame] | 24 | { |
| 25 | return 0; |
| 26 | } |
| 27 | |
| Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 28 | static struct xtables_match eui64_mt6_reg = { |
| Harald Welte | 02aa733 | 2005-02-01 15:38:20 +0000 | [diff] [blame] | 29 | .name = "eui64", |
| Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 30 | .version = XTABLES_VERSION, |
| 31 | .family = PF_INET6, |
| 32 | .size = XT_ALIGN(sizeof(int)), |
| 33 | .userspacesize = XT_ALIGN(sizeof(int)), |
| Jan Engelhardt | 997045f | 2007-10-04 16:29:21 +0000 | [diff] [blame] | 34 | .help = eui64_help, |
| 35 | .parse = eui64_parse, |
| András Kis-Szabó | 81adae9 | 2001-04-12 15:35:32 +0000 | [diff] [blame] | 36 | }; |
| 37 | |
| 38 | void _init(void) |
| 39 | { |
| Jan Engelhardt | 8b7c64d | 2008-04-15 11:48:25 +0200 | [diff] [blame] | 40 | xtables_register_match(&eui64_mt6_reg); |
| András Kis-Szabó | 81adae9 | 2001-04-12 15:35:32 +0000 | [diff] [blame] | 41 | } |