libip6t_eui64.c revision d01454062d0265f118c1b721740997cb93ef8cdb
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      unsigned int *nfcache,
31      struct xt_entry_match **match)
32{
33	return 0;
34}
35
36/* Final check */
37static void final_check(unsigned int flags)
38{
39}
40
41/* Prints out the matchinfo. */
42static void
43print(const void *ip,
44      const struct xt_entry_match *match,
45      int numeric)
46{
47	printf("eui64 ");
48}
49
50/* Saves the union ip6t_matchinfo in parsable form to stdout. */
51static void save(const void *ip, const struct xt_entry_match *match)
52{
53
54}
55
56static struct ip6tables_match eui64 = {
57	.name 		= "eui64",
58	.version	= IPTABLES_VERSION,
59	.size		= IP6T_ALIGN(sizeof(int)),
60	.userspacesize	= IP6T_ALIGN(sizeof(int)),
61	.help		= &help,
62	.parse		= &parse,
63	.final_check	= &final_check,
64	.print		= &print,
65	.save		= &save,
66};
67
68void _init(void)
69{
70	register_match6(&eui64);
71}
72