5 #ifndef _FWCHAINS_KERNEL_HEADERS_H
6 #define _FWCHAINS_KERNEL_HEADERS_H
10 #if defined(__GLIBC__) && __GLIBC__ == 2
11 #include <netinet/in.h>
12 #include <netinet/tcp.h>
13 #include <netinet/udp.h>
15 #include <sys/types.h>
17 #include <sys/socket.h>
21 #include <linux/icmp.h>
22 #include <linux/tcp.h>
23 #include <linux/udp.h>
24 #include <linux/types.h>
25 #include <linux/in6.h>
28 #include <linux/netfilter_ipv4/ip_tables.h>
38 #define IPT_MIN_ALIGN (__alignof__(struct ipt_entry))
41 #define IPT_ALIGN(s) (((s) + ((IPT_MIN_ALIGN)-1)) & ~((IPT_MIN_ALIGN)-1))
45 #define IPTC_LABEL_ACCEPT "ACCEPT"
46 #define IPTC_LABEL_DROP "DROP"
47 #define IPTC_LABEL_QUEUE "QUEUE"
48 #define IPTC_LABEL_RETURN "RETURN"
54 int iptc_is_chain(
const char *chain,
const iptc_handle_t handle);
57 iptc_handle_t
iptc_init(
const char *tablename);
68 iptc_handle_t *handle);
71 const struct ipt_entry *
iptc_next_rule(
const struct ipt_entry *prev,
72 iptc_handle_t *handle);
76 iptc_handle_t *handle);
79 int iptc_builtin(
const char *chain,
const iptc_handle_t handle);
83 struct ipt_counters *counter,
84 iptc_handle_t *handle);
92 const struct ipt_entry *e,
94 iptc_handle_t *handle);
98 const struct ipt_entry *e,
100 iptc_handle_t *handle);
105 const struct ipt_entry *e,
106 iptc_handle_t *handle);
111 const struct ipt_entry *origfw,
112 unsigned char *matchmask,
113 iptc_handle_t *handle);
117 unsigned int rulenum,
118 iptc_handle_t *handle);
123 struct ipt_entry *entry,
124 iptc_handle_t *handle);
128 iptc_handle_t *handle);
132 iptc_handle_t *handle);
136 iptc_handle_t *handle);
140 iptc_handle_t *handle);
144 const ipt_chainlabel newname,
145 iptc_handle_t *handle);
149 const ipt_chainlabel policy,
150 struct ipt_counters *counters,
151 iptc_handle_t *handle);
155 const ipt_chainlabel chain,
156 iptc_handle_t *handle);
160 unsigned int rulenum,
161 iptc_handle_t *handle);
165 unsigned int rulenum,
166 iptc_handle_t *handle);
170 unsigned int rulenum,
171 struct ipt_counters *counters,
172 iptc_handle_t *handle);
iptc_handle_t iptc_init(const char *tablename)
int iptc_zero_counter(const ipt_chainlabel chain, unsigned int rulenum, iptc_handle_t *handle)
int iptc_commit(iptc_handle_t *handle)
int iptc_get_raw_socket()
int iptc_flush_entries(const ipt_chainlabel chain, iptc_handle_t *handle)
int iptc_set_policy(const ipt_chainlabel chain, const ipt_chainlabel policy, struct ipt_counters *counters, iptc_handle_t *handle)
const char * iptc_first_chain(iptc_handle_t *handle)
int iptc_builtin(const char *chain, const iptc_handle_t handle)
int iptc_zero_entries(const ipt_chainlabel chain, iptc_handle_t *handle)
const char * iptc_check_packet(const ipt_chainlabel chain, struct ipt_entry *entry, iptc_handle_t *handle)
int iptc_insert_entry(const ipt_chainlabel chain, const struct ipt_entry *e, unsigned int rulenum, iptc_handle_t *handle)
int iptc_get_references(unsigned int *ref, const ipt_chainlabel chain, iptc_handle_t *handle)
struct ipt_counters * iptc_read_counter(const ipt_chainlabel chain, unsigned int rulenum, iptc_handle_t *handle)
void iptc_free(iptc_handle_t *h)
struct iptc_handle * iptc_handle_t
Definition: libiptc.h:51
int iptc_append_entry(const ipt_chainlabel chain, const struct ipt_entry *e, iptc_handle_t *handle)
const char * iptc_get_target(const struct ipt_entry *e, iptc_handle_t *handle)
int iptc_set_counter(const ipt_chainlabel chain, unsigned int rulenum, struct ipt_counters *counters, iptc_handle_t *handle)
const struct ipt_entry * iptc_next_rule(const struct ipt_entry *prev, iptc_handle_t *handle)
const char * iptc_get_policy(const char *chain, struct ipt_counters *counter, iptc_handle_t *handle)
int iptc_replace_entry(const ipt_chainlabel chain, const struct ipt_entry *e, unsigned int rulenum, iptc_handle_t *handle)
const char * iptc_strerror(int err)
const struct ipt_entry * iptc_first_rule(const char *chain, iptc_handle_t *handle)
const char * iptc_next_chain(iptc_handle_t *handle)
int iptc_delete_num_entry(const ipt_chainlabel chain, unsigned int rulenum, iptc_handle_t *handle)
int iptc_is_chain(const char *chain, const iptc_handle_t handle)
int iptc_delete_entry(const ipt_chainlabel chain, const struct ipt_entry *origfw, unsigned char *matchmask, iptc_handle_t *handle)
int iptc_delete_chain(const ipt_chainlabel chain, iptc_handle_t *handle)
int iptc_rename_chain(const ipt_chainlabel oldname, const ipt_chainlabel newname, iptc_handle_t *handle)
int iptc_create_chain(const ipt_chainlabel chain, iptc_handle_t *handle)
char ipt_chainlabel[32]
Definition: libiptc.h:43