]>
Commit | Line | Data |
---|---|---|
6054c1eb | 1 | /* SPDX-License-Identifier: GPL-2.0 */ |
63c7d26f JHS |
2 | #ifndef _XTABLES_INTERNAL_H |
3 | #define _XTABLES_INTERNAL_H 1 | |
4 | ||
5 | #ifndef XT_LIB_DIR | |
6 | # define XT_LIB_DIR "/lib/xtables" | |
7 | #endif | |
8 | ||
9 | /* protocol family dependent informations */ | |
10 | struct afinfo { | |
11 | /* protocol family */ | |
12 | int family; | |
13 | ||
14 | /* prefix of library name (ex "libipt_" */ | |
15 | char *libprefix; | |
16 | ||
17 | /* used by setsockopt (ex IPPROTO_IP */ | |
18 | int ipproto; | |
19 | ||
20 | /* kernel module (ex "ip_tables" */ | |
21 | char *kmod; | |
22 | ||
23 | /* optname to check revision support of match */ | |
24 | int so_rev_match; | |
25 | ||
26 | /* optname to check revision support of match */ | |
27 | int so_rev_target; | |
28 | }; | |
29 | ||
30 | enum xt_tryload { | |
31 | DONT_LOAD, | |
32 | DURING_LOAD, | |
33 | TRY_LOAD, | |
34 | LOAD_MUST_SUCCEED | |
35 | }; | |
36 | ||
37 | struct xtables_rule_match { | |
38 | struct xtables_rule_match *next; | |
39 | struct xtables_match *match; | |
40 | /* Multiple matches of the same type: the ones before | |
41 | the current one are completed from parsing point of view */ | |
42 | unsigned int completed; | |
43 | }; | |
44 | ||
45 | extern char *lib_dir; | |
46 | ||
47 | extern void *fw_calloc(size_t count, size_t size); | |
48 | extern void *fw_malloc(size_t size); | |
49 | ||
50 | extern const char *modprobe_program; | |
51 | extern int xtables_insmod(const char *modname, const char *modprobe, int quiet); | |
52 | extern int load_xtables_ko(const char *modprobe, int quiet); | |
53 | ||
54 | /* This is decleared in ip[6]tables.c */ | |
55 | extern struct afinfo afinfo; | |
56 | ||
57 | /* Keeping track of external matches and targets: linked lists. */ | |
58 | extern struct xtables_match *xtables_matches; | |
59 | extern struct xtables_target *xtables_targets; | |
60 | ||
61 | extern struct xtables_match *find_match(const char *name, enum xt_tryload, | |
62 | struct xtables_rule_match **match); | |
63 | extern struct xtables_target *find_target(const char *name, enum xt_tryload); | |
64 | ||
65 | extern void _init(void); | |
66 | ||
67 | #endif /* _XTABLES_INTERNAL_H */ |