blob: 9099667ffa6d32a572764f3a1acab287853fd1b8 [file] [log] [blame]
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +00001#ifndef _IPTABLES_COMMON_H
2#define _IPTABLES_COMMON_H
3/* Shared definitions between ipv4 and ipv6. */
4
5enum exittype {
6 OTHER_PROBLEM = 1,
7 PARAMETER_PROBLEM,
Stephen Hemmingerde539ec2007-03-06 13:03:19 -08008 VERSION_PROBLEM,
9 RESOURCE_PROBLEM
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000010};
Stephen Hemmingerde539ec2007-03-06 13:03:19 -080011
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 Hemminger6560dbb2007-06-20 10:55:18 -070015extern void exit_printhelp(void) __attribute__((noreturn));
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000016extern void exit_tryhelp(int) __attribute__((noreturn));
17int check_inverse(const char option[], int *invert, int *optind, int argc);
Stephen Hemmingerde539ec2007-03-06 13:03:19 -080018extern int string_to_number(const char *,
19 unsigned int,
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000020 unsigned int,
21 unsigned int *);
Stephen Hemmingerde539ec2007-03-06 13:03:19 -080022extern int string_to_number_l(const char *,
23 unsigned long int,
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000024 unsigned long int,
25 unsigned long *);
Stephen Hemmingerde539ec2007-03-06 13:03:19 -080026extern int string_to_number_ll(const char *,
27 unsigned long long int,
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000028 unsigned long long int,
29 unsigned long long *);
30extern int iptables_insmod(const char *modname, const char *modprobe);
Stephen Hemmingerde539ec2007-03-06 13:03:19 -080031extern int load_iptables_ko(const char *modprobe);
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000032void exit_error(enum exittype, char *, ...)__attribute__((noreturn,
33 format(printf,2,3)));
34extern const char *program_name, *program_version;
osdl.net!shemmingerb6d5f022005-03-30 18:43:30 +000035extern char *lib_dir;
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000036
Stephen Hemmingerde539ec2007-03-06 13:03:19 -080037#define _init __attribute__((constructor)) my_init
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000038#ifdef NO_SHARED_LIBS
39# ifdef _INIT
Stephen Hemmingerde539ec2007-03-06 13:03:19 -080040# undef _init
net[shemminger]!shemminger1ffd7fd2005-01-17 23:26:23 +000041# define _init _INIT
42# endif
43 extern void init_extensions(void);
44#endif
45
Stephen Hemmingerde539ec2007-03-06 13:03:19 -080046#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]!shemminger1ffd7fd2005-01-17 23:26:23 +000051#endif /*_IPTABLES_COMMON_H*/