lh | 9ed821d | 2023-04-07 01:36:19 -0700 | [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, |
| 8 | VERSION_PROBLEM, |
| 9 | RESOURCE_PROBLEM |
| 10 | }; |
| 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 | |
| 15 | extern void exit_printhelp(void) __attribute__((noreturn)); |
| 16 | extern void exit_tryhelp(int) __attribute__((noreturn)); |
| 17 | int check_inverse(const char option[], int *invert, int *optind, int argc); |
| 18 | extern int string_to_number(const char *, |
| 19 | unsigned int, |
| 20 | unsigned int, |
| 21 | unsigned int *); |
| 22 | extern int string_to_number_l(const char *, |
| 23 | unsigned long int, |
| 24 | unsigned long int, |
| 25 | unsigned long *); |
| 26 | extern int string_to_number_ll(const char *, |
| 27 | unsigned long long int, |
| 28 | unsigned long long int, |
| 29 | unsigned long long *); |
| 30 | extern int iptables_insmod(const char *modname, const char *modprobe); |
| 31 | extern int load_iptables_ko(const char *modprobe); |
| 32 | void exit_error(enum exittype, char *, ...)__attribute__((noreturn, |
| 33 | format(printf,2,3))); |
| 34 | extern const char *program_name, *program_version; |
| 35 | extern char *lib_dir; |
| 36 | |
| 37 | #define _init __attribute__((constructor)) my_init |
| 38 | #ifdef NO_SHARED_LIBS |
| 39 | # ifdef _INIT |
| 40 | # undef _init |
| 41 | # define _init _INIT |
| 42 | # endif |
| 43 | extern void init_extensions(void); |
| 44 | #endif |
| 45 | |
| 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 | |
| 51 | #endif /*_IPTABLES_COMMON_H*/ |