Blame include/xt-internal.h

Packit Service 3880ab
/* SPDX-License-Identifier: GPL-2.0 */
Packit Service 3880ab
#ifndef _XTABLES_INTERNAL_H
Packit Service 3880ab
#define _XTABLES_INTERNAL_H 1
Packit Service 3880ab
Packit Service 3880ab
#ifndef XT_LIB_DIR
Packit Service 3880ab
#	define XT_LIB_DIR "/lib/xtables"
Packit Service 3880ab
#endif
Packit Service 3880ab
Packit Service 3880ab
/* protocol family dependent informations */
Packit Service 3880ab
struct afinfo {
Packit Service 3880ab
	/* protocol family */
Packit Service 3880ab
	int family;
Packit Service 3880ab
Packit Service 3880ab
	/* prefix of library name (ex "libipt_" */
Packit Service 3880ab
	char *libprefix;
Packit Service 3880ab
Packit Service 3880ab
	/* used by setsockopt (ex IPPROTO_IP */
Packit Service 3880ab
	int ipproto;
Packit Service 3880ab
Packit Service 3880ab
	/* kernel module (ex "ip_tables" */
Packit Service 3880ab
	char *kmod;
Packit Service 3880ab
Packit Service 3880ab
	/* optname to check revision support of match */
Packit Service 3880ab
	int so_rev_match;
Packit Service 3880ab
Packit Service 3880ab
	/* optname to check revision support of match */
Packit Service 3880ab
	int so_rev_target;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
enum xt_tryload {
Packit Service 3880ab
	DONT_LOAD,
Packit Service 3880ab
	DURING_LOAD,
Packit Service 3880ab
	TRY_LOAD,
Packit Service 3880ab
	LOAD_MUST_SUCCEED
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
struct xtables_rule_match {
Packit Service 3880ab
	struct xtables_rule_match *next;
Packit Service 3880ab
	struct xtables_match *match;
Packit Service 3880ab
	/* Multiple matches of the same type: the ones before
Packit Service 3880ab
	   the current one are completed from parsing point of view */
Packit Service 3880ab
	unsigned int completed;
Packit Service 3880ab
};
Packit Service 3880ab
Packit Service 3880ab
extern char *lib_dir;
Packit Service 3880ab
Packit Service 3880ab
extern void *fw_calloc(size_t count, size_t size);
Packit Service 3880ab
extern void *fw_malloc(size_t size);
Packit Service 3880ab
Packit Service 3880ab
extern const char *modprobe_program;
Packit Service 3880ab
extern int xtables_insmod(const char *modname, const char *modprobe, int quiet);
Packit Service 3880ab
extern int load_xtables_ko(const char *modprobe, int quiet);
Packit Service 3880ab
Packit Service 3880ab
/* This is decleared in ip[6]tables.c */
Packit Service 3880ab
extern struct afinfo afinfo;
Packit Service 3880ab
Packit Service 3880ab
/* Keeping track of external matches and targets: linked lists.  */
Packit Service 3880ab
extern struct xtables_match *xtables_matches;
Packit Service 3880ab
extern struct xtables_target *xtables_targets;
Packit Service 3880ab
Packit Service 3880ab
extern struct xtables_match *find_match(const char *name, enum xt_tryload,
Packit Service 3880ab
					struct xtables_rule_match **match);
Packit Service 3880ab
extern struct xtables_target *find_target(const char *name, enum xt_tryload);
Packit Service 3880ab
Packit Service 3880ab
extern void _init(void);
Packit Service 3880ab
Packit Service 3880ab
#endif /* _XTABLES_INTERNAL_H */