net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 1 | #ifndef _IPTABLES_COMMON_H |
| 2 | #define _IPTABLES_COMMON_H |
| 3 | /* Shared definitions between ipv4 and ipv6. */ |
| 4 | |
| 5 | enum exittype { |
| 6 | OTHER_PROBLEM = 1, |
| 7 | PARAMETER_PROBLEM, |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 8 | VERSION_PROBLEM, |
| 9 | RESOURCE_PROBLEM |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 10 | }; |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 11 | |
| 12 | /* this is a special 64bit data type that is 8-byte aligned */ |
| 13 | #define aligned_u64 unsigned long long __attribute__((aligned(8))) |
| 14 | |
Stephen Hemminger | 6560dbb | 2007-06-20 10:55:18 -0700 | [diff] [blame] | 15 | extern void exit_printhelp(void) __attribute__((noreturn)); |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 16 | extern void exit_tryhelp(int) __attribute__((noreturn)); |
| 17 | int check_inverse(const char option[], int *invert, int *optind, int argc); |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 18 | extern int string_to_number(const char *, |
| 19 | unsigned int, |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 20 | unsigned int, |
| 21 | unsigned int *); |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 22 | extern int string_to_number_l(const char *, |
| 23 | unsigned long int, |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 24 | unsigned long int, |
| 25 | unsigned long *); |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 26 | extern int string_to_number_ll(const char *, |
| 27 | unsigned long long int, |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 28 | unsigned long long int, |
| 29 | unsigned long long *); |
| 30 | extern int iptables_insmod(const char *modname, const char *modprobe); |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 31 | extern int load_iptables_ko(const char *modprobe); |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 32 | void exit_error(enum exittype, char *, ...)__attribute__((noreturn, |
| 33 | format(printf,2,3))); |
| 34 | extern const char *program_name, *program_version; |
osdl.net!shemminger | b6d5f02 | 2005-03-30 18:43:30 +0000 | [diff] [blame] | 35 | extern char *lib_dir; |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 36 | |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 37 | #define _init __attribute__((constructor)) my_init |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 38 | #ifdef NO_SHARED_LIBS |
| 39 | # ifdef _INIT |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 40 | # undef _init |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 41 | # define _init _INIT |
| 42 | # endif |
| 43 | extern void init_extensions(void); |
| 44 | #endif |
| 45 | |
Stephen Hemminger | de539ec | 2007-03-06 13:03:19 -0800 | [diff] [blame] | 46 | #define __be32 u_int32_t |
| 47 | #define __le32 u_int32_t |
| 48 | #define __be16 u_int16_t |
| 49 | #define __le16 u_int16_t |
| 50 | |
net[shemminger]!shemminger | 1ffd7fd | 2005-01-17 23:26:23 +0000 | [diff] [blame] | 51 | #endif /*_IPTABLES_COMMON_H*/ |