1 #ifndef _IP6TABLES_USER_H
2 #define _IP6TABLES_USER_H
4 #include "iptables_common.h"
5 #include "libiptc/libip6tc.h"
7 struct ip6tables_rule_match
9 struct ip6tables_rule_match *next;
11 struct ip6tables_match *match;
14 /* Include file for additions: new matches and targets. */
15 struct ip6tables_match
17 struct ip6tables_match *next;
23 /* Size of match data. */
26 /* Size of match data relevent for userspace comparison purposes */
29 /* Function which prints out usage message. */
32 /* Initialize the match. */
33 void (*init)(struct ip6t_entry_match *m, unsigned int *nfcache);
35 /* Function which parses command options; returns true if it
37 int (*parse)(int c, char **argv, int invert, unsigned int *flags,
38 const struct ip6t_entry *entry,
39 unsigned int *nfcache,
40 struct ip6t_entry_match **match);
42 /* Final check; exit if not ok. */
43 void (*final_check)(unsigned int flags);
45 /* Prints out the match iff non-NULL: put space at end */
46 void (*print)(const struct ip6t_ip6 *ip,
47 const struct ip6t_entry_match *match, int numeric);
49 /* Saves the union ipt_matchinfo in parsable form to stdout. */
50 void (*save)(const struct ip6t_ip6 *ip,
51 const struct ip6t_entry_match *match);
53 /* Pointer to list of extra command-line options */
54 const struct option *extra_opts;
56 /* Ignore these men behind the curtain: */
57 unsigned int option_offset;
58 struct ip6t_entry_match *m;
61 unsigned int loaded; /* simulate loading so options are merged properly */
65 struct ip6tables_target
67 struct ip6tables_target *next;
73 /* Size of target data. */
76 /* Size of target data relevent for userspace comparison purposes */
79 /* Function which prints out usage message. */
82 /* Initialize the target. */
83 void (*init)(struct ip6t_entry_target *t, unsigned int *nfcache);
85 /* Function which parses command options; returns true if it
87 int (*parse)(int c, char **argv, int invert, unsigned int *flags,
88 const struct ip6t_entry *entry,
89 struct ip6t_entry_target **target);
91 /* Final check; exit if not ok. */
92 void (*final_check)(unsigned int flags);
94 /* Prints out the target iff non-NULL: put space at end */
95 void (*print)(const struct ip6t_ip6 *ip,
96 const struct ip6t_entry_target *target, int numeric);
98 /* Saves the targinfo in parsable form to stdout. */
99 void (*save)(const struct ip6t_ip6 *ip,
100 const struct ip6t_entry_target *target);
102 /* Pointer to list of extra command-line options */
103 struct option *extra_opts;
105 /* Ignore these men behind the curtain: */
106 unsigned int option_offset;
107 struct ip6t_entry_target *t;
110 #ifdef NO_SHARED_LIBS
111 unsigned int loaded; /* simulate loading so options are merged properly */
117 /* Your shared library should call one of these. */
118 extern void register_match6(struct ip6tables_match *me);
119 extern void register_target6(struct ip6tables_target *me);
121 extern int do_command6(int argc, char *argv[], char **table,
122 ip6tc_handle_t *handle);
123 /* Keeping track of external matches and targets: linked lists. */
124 extern struct ip6tables_match *ip6tables_matches;
125 extern struct ip6tables_target *ip6tables_targets;
133 extern struct ip6tables_target *find_target(const char *name, enum ip6t_tryload);
134 extern struct ip6tables_match *find_match(const char *name, enum ip6t_tryload, struct ip6tables_rule_match **match);
136 extern int for_each_chain(int (*fn)(const ip6t_chainlabel, int, ip6tc_handle_t *), int verbose, int builtinstoo, ip6tc_handle_t *handle);
137 extern int flush_entries(const ip6t_chainlabel chain, int verbose, ip6tc_handle_t *handle);
138 extern int delete_chain(const ip6t_chainlabel chain, int verbose, ip6tc_handle_t *handle);
139 extern int ip6tables_insmod(const char *modname, const char *modprobe);
141 #endif /*_IP6TABLES_USER_H*/