blob: dc922dca37a1f88955eba2a2ba66830aa3ca412e [file] [log] [blame]
Bart De Schuymer1abc55d2002-06-01 19:23:47 +00001/*
2 * $Id: ebtables.c,v 1.03 2002/01/19
3 *
4 * Copyright (C) 2001-2002 Bart De Schuymer
5 *
6 * This code is stongly inspired on the iptables code which is
7 * Copyright (C) 1999 Paul `Rusty' Russell & Michael J. Neuling
8 *
9 * This program is free software; you can redistribute it and/or
10 * modify it under the terms of the GNU General Public License as
11 * published by the Free Software Foundation; either version 2 of the
12 * License, or (at your option) any later version.
13 *
14 * This program is distributed in the hope that it will be useful, but
15 * WITHOUT ANY WARRANTY; without even the implied warranty of
16 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
17 * General Public License for more details.
18 *
19 * You should have received a copy of the GNU General Public License
20 * along with this program; if not, write to the Free Software
21 * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
22 */
23
24#ifndef EBTABLES_U_H
25#define EBTABLES_U_H
Bart De Schuymerdb017742010-12-18 16:14:35 +000026#define __EXPORTED_HEADERS__
Bart De Schuymer9cfd6542002-08-13 16:08:08 +000027#include <netinet/in.h>
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000028#include <linux/netfilter_bridge/ebtables.h>
Bart De Schuymer872a6742009-06-21 12:23:36 +000029#include <linux/netfilter/x_tables.h>
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000030
Bart De Schuymer639bbe92006-01-23 18:08:07 +000031#ifndef IPPROTO_SCTP
32#define IPPROTO_SCTP 132
33#endif
34#ifndef IPPROTO_DCCP
35#define IPPROTO_DCCP 33
36#endif
37
Bart De Schuymer6622a012005-01-19 21:09:05 +000038#define EXEC_STYLE_PRG 0
39#define EXEC_STYLE_DAEMON 1
40
Bart De Schuymerf81c2702003-07-23 21:07:04 +000041#ifndef EBT_MIN_ALIGN
Bart De Schuymer872a6742009-06-21 12:23:36 +000042#define EBT_MIN_ALIGN (__alignof__(struct _xt_align))
Bart De Schuymerf81c2702003-07-23 21:07:04 +000043#endif
44#define EBT_ALIGN(s) (((s) + (EBT_MIN_ALIGN-1)) & ~(EBT_MIN_ALIGN-1))
Bart De Schuymer8339ff12004-01-14 20:05:27 +000045#define ERRORMSG_MAXLEN 128
Bart De Schuymerf81c2702003-07-23 21:07:04 +000046
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000047struct ebt_u_entries
48{
Bart De Schuymer09765902002-06-23 08:15:51 +000049 int policy;
Bart De Schuymer376ccfb2002-07-23 20:52:18 +000050 unsigned int nentries;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000051 /* counter offset for this chain */
Bart De Schuymer09765902002-06-23 08:15:51 +000052 unsigned int counter_offset;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000053 /* used for udc */
Bart De Schuymer09765902002-06-23 08:15:51 +000054 unsigned int hook_mask;
Bart De Schuymer9bfcfd82005-08-27 16:52:19 +000055 char *kernel_start;
Bart De Schuymer09765902002-06-23 08:15:51 +000056 char name[EBT_CHAIN_MAXNAMELEN];
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000057 struct ebt_u_entry *entries;
58};
59
Bart De Schuymer8339ff12004-01-14 20:05:27 +000060struct ebt_cntchanges
61{
62 unsigned short type;
Bart De Schuymer9d14e842005-05-24 20:49:27 +000063 unsigned short change; /* determines incremental/decremental/change */
Bart De Schuymer482fbaf2005-08-28 13:16:25 +000064 struct ebt_cntchanges *prev;
Bart De Schuymer8339ff12004-01-14 20:05:27 +000065 struct ebt_cntchanges *next;
66};
67
Bart De Schuymer9bfcfd82005-08-27 16:52:19 +000068#define EBT_ORI_MAX_CHAINS 10
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000069struct ebt_u_replace
70{
71 char name[EBT_TABLE_MAXNAMELEN];
72 unsigned int valid_hooks;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000073 /* nr of rules in the table */
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000074 unsigned int nentries;
Bart De Schuymer9bfcfd82005-08-27 16:52:19 +000075 unsigned int num_chains;
76 unsigned int max_chains;
77 struct ebt_u_entries **chains;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000078 /* nr of counters userspace expects back */
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000079 unsigned int num_counters;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000080 /* where the kernel will put the old counters */
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000081 struct ebt_counter *counters;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000082 /*
83 * can be used e.g. to know if a standard option
84 * has been specified twice
85 */
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000086 unsigned int flags;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000087 /* we stick the specified command (e.g. -A) in here */
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000088 char command;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000089 /*
Bart De Schuymer8339ff12004-01-14 20:05:27 +000090 * here we stick the chain to do our thing on (can be -1 if unspecified)
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000091 */
Bart De Schuymer8339ff12004-01-14 20:05:27 +000092 int selected_chain;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +000093 /* used for the atomic option */
Bart De Schuymer8330e892002-07-14 19:06:47 +000094 char *filename;
Bart De Schuymer482fbaf2005-08-28 13:16:25 +000095 /* tells what happened to the old rules (counter changes) */
96 struct ebt_cntchanges *cc;
Bart De Schuymer1abc55d2002-06-01 19:23:47 +000097};
98
99struct ebt_u_table
100{
101 char name[EBT_TABLE_MAXNAMELEN];
Bart De Schuymerf57f50f2002-08-29 16:52:36 +0000102 void (*check)(struct ebt_u_replace *repl);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000103 void (*help)(const char **);
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000104 struct ebt_u_table *next;
105};
106
107struct ebt_u_match_list
108{
109 struct ebt_u_match_list *next;
110 struct ebt_entry_match *m;
111};
112
113struct ebt_u_watcher_list
114{
115 struct ebt_u_watcher_list *next;
116 struct ebt_entry_watcher *w;
117};
118
119struct ebt_u_entry
120{
Bart De Schuymer376ccfb2002-07-23 20:52:18 +0000121 unsigned int bitmask;
122 unsigned int invflags;
Bart De Schuymer9cfd6542002-08-13 16:08:08 +0000123 uint16_t ethproto;
Bart De Schuymer376ccfb2002-07-23 20:52:18 +0000124 char in[IFNAMSIZ];
125 char logical_in[IFNAMSIZ];
126 char out[IFNAMSIZ];
127 char logical_out[IFNAMSIZ];
Bart De Schuymere3cceb72002-07-26 12:47:33 +0000128 unsigned char sourcemac[ETH_ALEN];
129 unsigned char sourcemsk[ETH_ALEN];
130 unsigned char destmac[ETH_ALEN];
131 unsigned char destmsk[ETH_ALEN];
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000132 struct ebt_u_match_list *m_list;
133 struct ebt_u_watcher_list *w_list;
134 struct ebt_entry_target *t;
Bart De Schuymere94eaf72005-08-28 16:06:22 +0000135 struct ebt_u_entry *prev;
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000136 struct ebt_u_entry *next;
Bart De Schuymerd2ced822005-01-23 19:19:00 +0000137 struct ebt_counter cnt;
Bart De Schuymerab611e22005-02-14 20:20:03 +0000138 struct ebt_counter cnt_surplus; /* for increasing/decreasing a counter and for option 'C' */
Bart De Schuymer482fbaf2005-08-28 13:16:25 +0000139 struct ebt_cntchanges *cc;
Bart De Schuymer64182a32004-01-21 20:39:54 +0000140 /* the standard target needs this to know the name of a udc when
141 * printing out rules. */
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000142 struct ebt_u_replace *replace;
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000143};
144
145struct ebt_u_match
146{
147 char name[EBT_FUNCTION_MAXNAMELEN];
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000148 /* size of the real match data */
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000149 unsigned int size;
150 void (*help)(void);
151 void (*init)(struct ebt_entry_match *m);
152 int (*parse)(int c, char **argv, int argc,
153 const struct ebt_u_entry *entry, unsigned int *flags,
154 struct ebt_entry_match **match);
155 void (*final_check)(const struct ebt_u_entry *entry,
156 const struct ebt_entry_match *match,
Bart De Schuymer76712df2002-08-25 21:54:06 +0000157 const char *name, unsigned int hookmask, unsigned int time);
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000158 void (*print)(const struct ebt_u_entry *entry,
159 const struct ebt_entry_match *match);
160 int (*compare)(const struct ebt_entry_match *m1,
161 const struct ebt_entry_match *m2);
162 const struct option *extra_ops;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000163 /*
164 * can be used e.g. to check for multiple occurance of the same option
165 */
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000166 unsigned int flags;
167 unsigned int option_offset;
168 struct ebt_entry_match *m;
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000169 /*
170 * if used == 1 we no longer have to add it to
171 * the match chain of the new entry
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000172 * be sure to put it back on 0 when finished
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000173 */
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000174 unsigned int used;
175 struct ebt_u_match *next;
176};
177
178struct ebt_u_watcher
179{
180 char name[EBT_FUNCTION_MAXNAMELEN];
181 unsigned int size;
182 void (*help)(void);
183 void (*init)(struct ebt_entry_watcher *w);
184 int (*parse)(int c, char **argv, int argc,
185 const struct ebt_u_entry *entry, unsigned int *flags,
186 struct ebt_entry_watcher **watcher);
187 void (*final_check)(const struct ebt_u_entry *entry,
188 const struct ebt_entry_watcher *watch, const char *name,
Bart De Schuymer76712df2002-08-25 21:54:06 +0000189 unsigned int hookmask, unsigned int time);
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000190 void (*print)(const struct ebt_u_entry *entry,
191 const struct ebt_entry_watcher *watcher);
192 int (*compare)(const struct ebt_entry_watcher *w1,
193 const struct ebt_entry_watcher *w2);
194 const struct option *extra_ops;
195 unsigned int flags;
196 unsigned int option_offset;
197 struct ebt_entry_watcher *w;
198 unsigned int used;
199 struct ebt_u_watcher *next;
200};
201
202struct ebt_u_target
203{
204 char name[EBT_FUNCTION_MAXNAMELEN];
205 unsigned int size;
206 void (*help)(void);
207 void (*init)(struct ebt_entry_target *t);
208 int (*parse)(int c, char **argv, int argc,
209 const struct ebt_u_entry *entry, unsigned int *flags,
210 struct ebt_entry_target **target);
211 void (*final_check)(const struct ebt_u_entry *entry,
212 const struct ebt_entry_target *target, const char *name,
Bart De Schuymer76712df2002-08-25 21:54:06 +0000213 unsigned int hookmask, unsigned int time);
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000214 void (*print)(const struct ebt_u_entry *entry,
215 const struct ebt_entry_target *target);
216 int (*compare)(const struct ebt_entry_target *t1,
217 const struct ebt_entry_target *t2);
218 const struct option *extra_ops;
219 unsigned int option_offset;
220 unsigned int flags;
221 struct ebt_entry_target *t;
222 unsigned int used;
223 struct ebt_u_target *next;
224};
225
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000226/* libebtc.c */
227
228extern struct ebt_u_table *ebt_tables;
229extern struct ebt_u_match *ebt_matches;
230extern struct ebt_u_watcher *ebt_watchers;
231extern struct ebt_u_target *ebt_targets;
232
233void ebt_register_table(struct ebt_u_table *);
234void ebt_register_match(struct ebt_u_match *);
235void ebt_register_watcher(struct ebt_u_watcher *);
236void ebt_register_target(struct ebt_u_target *t);
Bart De Schuymer6622a012005-01-19 21:09:05 +0000237int ebt_get_kernel_table(struct ebt_u_replace *replace, int init);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000238struct ebt_u_target *ebt_find_target(const char *name);
239struct ebt_u_match *ebt_find_match(const char *name);
240struct ebt_u_watcher *ebt_find_watcher(const char *name);
241struct ebt_u_table *ebt_find_table(const char *name);
Bart De Schuymer0cb01792003-05-04 16:52:04 +0000242int ebtables_insmod(const char *modname);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000243void ebt_list_extensions();
244void ebt_initialize_entry(struct ebt_u_entry *e);
Bart De Schuymer6622a012005-01-19 21:09:05 +0000245void ebt_cleanup_replace(struct ebt_u_replace *replace);
246void ebt_reinit_extensions();
Bart De Schuymer9bfcfd82005-08-27 16:52:19 +0000247void ebt_double_chains(struct ebt_u_replace *replace);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000248void ebt_free_u_entry(struct ebt_u_entry *e);
249struct ebt_u_entries *ebt_name_to_chain(const struct ebt_u_replace *replace,
250 const char* arg);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000251struct ebt_u_entries *ebt_name_to_chain(const struct ebt_u_replace *replace,
252 const char* arg);
253int ebt_get_chainnr(const struct ebt_u_replace *replace, const char* arg);
254/**/
255void ebt_change_policy(struct ebt_u_replace *replace, int policy);
256void ebt_flush_chains(struct ebt_u_replace *replace);
257int ebt_check_rule_exists(struct ebt_u_replace *replace,
258 struct ebt_u_entry *new_entry);
259void ebt_add_rule(struct ebt_u_replace *replace, struct ebt_u_entry *new_entry,
260 int rule_nr);
261void ebt_delete_rule(struct ebt_u_replace *replace,
262 struct ebt_u_entry *new_entry, int begin, int end);
263void ebt_zero_counters(struct ebt_u_replace *replace);
Bart De Schuymerff587202005-02-08 20:02:28 +0000264void ebt_change_counters(struct ebt_u_replace *replace,
265 struct ebt_u_entry *new_entry, int begin, int end,
Bart De Schuymer9d14e842005-05-24 20:49:27 +0000266 struct ebt_counter *cnt, int mask);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000267void ebt_new_chain(struct ebt_u_replace *replace, const char *name, int policy);
268void ebt_delete_chain(struct ebt_u_replace *replace);
269void ebt_rename_chain(struct ebt_u_replace *replace, const char *name);
270/**/
271void ebt_do_final_checks(struct ebt_u_replace *replace, struct ebt_u_entry *e,
272 struct ebt_u_entries *entries);
Bart De Schuymer6622a012005-01-19 21:09:05 +0000273int ebt_check_for_references(struct ebt_u_replace *replace, int print_err);
274int ebt_check_for_references2(struct ebt_u_replace *replace, int chain_nr,
275 int print_err);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000276void ebt_check_for_loops(struct ebt_u_replace *replace);
277void ebt_add_match(struct ebt_u_entry *new_entry, struct ebt_u_match *m);
278void ebt_add_watcher(struct ebt_u_entry *new_entry, struct ebt_u_watcher *w);
279void ebt_iterate_matches(void (*f)(struct ebt_u_match *));
280void ebt_iterate_watchers(void (*f)(struct ebt_u_watcher *));
281void ebt_iterate_targets(void (*f)(struct ebt_u_target *));
Bart De Schuymer64182a32004-01-21 20:39:54 +0000282void __ebt_print_bug(char *file, int line, char *format, ...);
283void __ebt_print_error(char *format, ...);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000284
285/* communication.c */
286
Bart De Schuymer64182a32004-01-21 20:39:54 +0000287int ebt_get_table(struct ebt_u_replace *repl, int init);
Bart De Schuymer83a1b0f2005-09-28 19:36:17 +0000288void ebt_deliver_counters(struct ebt_u_replace *repl);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000289void ebt_deliver_table(struct ebt_u_replace *repl);
290
291/* useful_functions.c */
292
293extern int ebt_invert;
294void ebt_check_option(unsigned int *flags, unsigned int mask);
Bart De Schuymerff587202005-02-08 20:02:28 +0000295#define ebt_check_inverse(arg) _ebt_check_inverse(arg, argc, argv)
296int _ebt_check_inverse(const char option[], int argc, char **argv);
Bart De Schuymer510c9ce2006-01-23 18:50:54 +0000297void ebt_print_mac(const unsigned char *mac);
298void ebt_print_mac_and_mask(const unsigned char *mac, const unsigned char *mask);
299int ebt_get_mac_and_mask(const char *from, unsigned char *to, unsigned char *mask);
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000300void ebt_parse_ip_address(char *address, uint32_t *addr, uint32_t *msk);
301char *ebt_mask_to_dotted(uint32_t mask);
Bart De Schuymer005837e2008-02-21 21:32:25 +0000302void ebt_parse_ip6_address(char *address, struct in6_addr *addr,
303 struct in6_addr *msk);
304char *ebt_ip6_to_numeric(const struct in6_addr *addrp);
305
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000306
Bart De Schuymer6622a012005-01-19 21:09:05 +0000307int do_command(int argc, char *argv[], int exec_style,
308 struct ebt_u_replace *replace_);
309
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000310struct ethertypeent *parseethertypebynumber(int type);
311
Bart De Schuymer482fbaf2005-08-28 13:16:25 +0000312#define ebt_to_chain(repl) \
313({struct ebt_u_entries *_ch = NULL; \
Bart De Schuymercdc2cd02005-10-01 20:12:50 +0000314if (repl->selected_chain != -1) \
Bart De Schuymer482fbaf2005-08-28 13:16:25 +0000315 _ch = repl->chains[repl->selected_chain]; \
316_ch;})
Bart De Schuymer64182a32004-01-21 20:39:54 +0000317#define ebt_print_bug(format, args...) \
318 __ebt_print_bug(__FILE__, __LINE__, format, ##args)
319#define ebt_print_error(format,args...) __ebt_print_error(format, ##args);
Bart De Schuymercdc2cd02005-10-01 20:12:50 +0000320#define ebt_print_error2(format, args...) do {__ebt_print_error(format, ##args); \
321 return -1;} while (0)
Bart De Schuymerff587202005-02-08 20:02:28 +0000322#define ebt_check_option2(flags,mask) \
323({ebt_check_option(flags,mask); \
324 if (ebt_errormsg[0] != '\0') \
325 return -1;})
326#define ebt_check_inverse2(option) \
327({int __ret = ebt_check_inverse(option); \
328if (ebt_errormsg[0] != '\0') \
329 return -1; \
330if (!optarg) { \
331 __ebt_print_error("Option without (mandatory) argument"); \
332 return -1; \
333} \
334__ret;})
Bart De Schuymer02619f42005-10-02 12:10:07 +0000335#define ebt_print_memory() do {printf("Ebtables: " __FILE__ \
336 " %s %d :Out of memory.\n", __FUNCTION__, __LINE__); exit(-1);} while (0)
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000337
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000338/* used for keeping the rule counters right during rule adds or deletes */
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000339#define CNT_NORM 0
340#define CNT_DEL 1
341#define CNT_ADD 2
Bart De Schuymer482fbaf2005-08-28 13:16:25 +0000342#define CNT_CHANGE 3
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000343
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000344extern const char *ebt_hooknames[NF_BR_NUMHOOKS];
345extern const char *ebt_standard_targets[NUM_STANDARD_TARGETS];
346extern char ebt_errormsg[ERRORMSG_MAXLEN];
347extern char *ebt_modprobe;
348extern int ebt_silent;
349extern int ebt_printstyle_mac;
350
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000351/*
352 * Transforms a target string into the right integer,
353 * returns 0 on success.
354 */
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000355#define FILL_TARGET(_str, _pos) ({ \
356 int _i, _ret = 0; \
357 for (_i = 0; _i < NUM_STANDARD_TARGETS; _i++) \
358 if (!strcmp(_str, ebt_standard_targets[_i])) {\
359 _pos = -_i - 1; \
360 break; \
361 } \
362 if (_i == NUM_STANDARD_TARGETS) \
363 _ret = 1; \
364 _ret; \
Bart De Schuymer9cfd6542002-08-13 16:08:08 +0000365})
366
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000367/* Transforms the target value to an index into standard_targets[] */
Bart De Schuymer9cfd6542002-08-13 16:08:08 +0000368#define TARGET_INDEX(_value) (-_value - 1)
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000369/* Returns a target string corresponding to the value */
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000370#define TARGET_NAME(_value) (ebt_standard_targets[TARGET_INDEX(_value)])
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000371/* True if the hook mask denotes that the rule is in a base chain */
Bart De Schuymer76712df2002-08-25 21:54:06 +0000372#define BASE_CHAIN (hookmask & (1 << NF_BR_NUMHOOKS))
Bart De Schuymer9895a8e2003-01-11 10:14:24 +0000373/* Clear the bit in the hook_mask that tells if the rule is on a base chain */
Bart De Schuymer76712df2002-08-25 21:54:06 +0000374#define CLEAR_BASE_CHAIN_BIT (hookmask &= ~(1 << NF_BR_NUMHOOKS))
Bart De Schuymer8339ff12004-01-14 20:05:27 +0000375#define PRINT_VERSION printf(PROGNAME" v"PROGVERSION" ("PROGDATE")\n")
376#ifndef PROC_SYS_MODPROBE
377#define PROC_SYS_MODPROBE "/proc/sys/kernel/modprobe"
378#endif
379#define ATOMIC_ENV_VARIABLE "EBTABLES_ATOMIC_FILE"
Bart De Schuymer6f7130a2011-01-18 20:08:34 +0000380
381#ifndef ARRAY_SIZE
382# define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0]))
383#endif
Bart De Schuymer1abc55d2002-06-01 19:23:47 +0000384#endif /* EBTABLES_U_H */