libip6t_eui64.c revision 830132ac9c0d270bf9dcfe85c2464e3fe8c73fb9
1/* Shared library add-on to ip6tables to add EUI64 address checking support. */
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
14/* Function which prints out usage message. */
15static void
16help(void)
17{
18	printf(
19"eui64 v%s options:\n"
20" This module hasn't got any option\n"
21" This module checks for EUI64 IPv6 addresses\n"
22"\n", IPTABLES_VERSION);
23}
24
25/* Function which parses command options; returns true if it
26   ate an option */
27static int
28parse(int c, char **argv, int invert, unsigned int *flags,
29      const void *entry,
30      struct xt_entry_match **match)
31{
32	return 0;
33}
34
35/* Prints out the matchinfo. */
36static void
37print(const void *ip,
38      const struct xt_entry_match *match,
39      int numeric)
40{
41	printf("eui64 ");
42}
43
44/* Saves the union ip6t_matchinfo in parsable form to stdout. */
45static void save(const void *ip, const struct xt_entry_match *match)
46{
47
48}
49
50static struct ip6tables_match eui64 = {
51	.name 		= "eui64",
52	.version	= IPTABLES_VERSION,
53	.size		= IP6T_ALIGN(sizeof(int)),
54	.userspacesize	= IP6T_ALIGN(sizeof(int)),
55	.help		= &help,
56	.parse		= &parse,
57	.print		= &print,
58	.save		= &save,
59};
60
61void _init(void)
62{
63	register_match6(&eui64);
64}
65