1 #ifndef _IP6TABLES_USER_H
2 #define _IP6TABLES_USER_H
4 #include "iptables_common.h"
5 #include "libiptc/libip6tc.h"
8 #define IP6T_LIB_DIR "/usr/local/lib/iptables"
11 struct ip6tables_rule_match
13 struct ip6tables_rule_match *next;
15 struct ip6tables_match *match;
18 /* Include file for additions: new matches and targets. */
19 struct ip6tables_match
21 struct ip6tables_match *next;
27 /* Size of match data. */
30 /* Size of match data relevent for userspace comparison purposes */
33 /* Function which prints out usage message. */
36 /* Initialize the match. */
37 void (*init)(struct ip6t_entry_match *m, unsigned int *nfcache);
39 /* Function which parses command options; returns true if it
41 int (*parse)(int c, char **argv, int invert, unsigned int *flags,
42 const struct ip6t_entry *entry,
43 unsigned int *nfcache,
44 struct ip6t_entry_match **match);
46 /* Final check; exit if not ok. */
47 void (*final_check)(unsigned int flags);
49 /* Prints out the match iff non-NULL: put space at end */
50 void (*print)(const struct ip6t_ip6 *ip,
51 const struct ip6t_entry_match *match, int numeric);
53 /* Saves the union ipt_matchinfo in parsable form to stdout. */
54 void (*save)(const struct ip6t_ip6 *ip,
55 const struct ip6t_entry_match *match);
57 /* Pointer to list of extra command-line options */
58 const struct option *extra_opts;
60 /* Ignore these men behind the curtain: */
61 unsigned int option_offset;
62 struct ip6t_entry_match *m;
65 unsigned int loaded; /* simulate loading so options are merged properly */
69 struct ip6tables_target
71 struct ip6tables_target *next;
77 /* Size of target data. */
80 /* Size of target data relevent for userspace comparison purposes */
83 /* Function which prints out usage message. */
86 /* Initialize the target. */
87 void (*init)(struct ip6t_entry_target *t, unsigned int *nfcache);
89 /* Function which parses command options; returns true if it
91 int (*parse)(int c, char **argv, int invert, unsigned int *flags,
92 const struct ip6t_entry *entry,
93 struct ip6t_entry_target **target);
95 /* Final check; exit if not ok. */
96 void (*final_check)(unsigned int flags);
98 /* Prints out the target iff non-NULL: put space at end */
99 void (*print)(const struct ip6t_ip6 *ip,
100 const struct ip6t_entry_target *target, int numeric);
102 /* Saves the targinfo in parsable form to stdout. */
103 void (*save)(const struct ip6t_ip6 *ip,
104 const struct ip6t_entry_target *target);
106 /* Pointer to list of extra command-line options */
107 struct option *extra_opts;
109 /* Ignore these men behind the curtain: */
110 unsigned int option_offset;
111 struct ip6t_entry_target *t;
114 #ifdef NO_SHARED_LIBS
115 unsigned int loaded; /* simulate loading so options are merged properly */
121 /* Your shared library should call one of these. */
122 extern void register_match6(struct ip6tables_match *me);
123 extern void register_target6(struct ip6tables_target *me);
125 extern int do_command6(int argc, char *argv[], char **table,
126 ip6tc_handle_t *handle);
127 /* Keeping track of external matches and targets: linked lists. */
128 extern struct ip6tables_match *ip6tables_matches;
129 extern struct ip6tables_target *ip6tables_targets;
138 extern struct ip6tables_target *find_target(const char *name, enum ip6t_tryload);
139 extern struct ip6tables_match *find_match(const char *name, enum ip6t_tryload, struct ip6tables_rule_match **match);
141 extern void parse_interface(const char *arg, char *vianame, unsigned char *mask);
143 extern int for_each_chain(int (*fn)(const ip6t_chainlabel, int, ip6tc_handle_t *), int verbose, int builtinstoo, ip6tc_handle_t *handle);
144 extern int flush_entries(const ip6t_chainlabel chain, int verbose, ip6tc_handle_t *handle);
145 extern int delete_chain(const ip6t_chainlabel chain, int verbose, ip6tc_handle_t *handle);
146 extern int ip6tables_insmod(const char *modname, const char *modprobe);
148 #endif /*_IP6TABLES_USER_H*/