unsigned int len;
};
+extern const struct ct_template ct_templates[__NFT_CT_MAX];
+
#define CT_TEMPLATE(__token, __dtype, __byteorder, __len) { \
.token = (__token), \
.dtype = (__dtype), \
extern void rt_symbol_table_free(struct symbol_table *tbl);
extern const struct symbol_table inet_service_tbl;
+extern struct symbol_table *mark_tbl;
extern const struct datatype invalid_type;
extern const struct datatype verdict_type;
unsigned int len;
};
+extern const struct meta_template meta_templates[];
+
#define META_TEMPLATE(__token, __dtype, __len, __byteorder) { \
.token = (__token), \
.dtype = (__dtype), \
extern const struct datatype pkttype_type;
extern const struct datatype ifname_type;
+extern struct symbol_table *devgroup_tbl;
+
#endif /* NFTABLES_META_H */
bool invalid;
};
+extern const struct rt_template rt_templates[];
+
#define RT_TEMPLATE(__token, __dtype, __len, __byteorder, __invalid) { \
.token = (__token), \
.dtype = (__dtype), \
enum table_flags {
TABLE_F_DORMANT = (1 << 0),
};
+#define TABLE_FLAGS_MAX 1
+
+extern const char *table_flags_name[TABLE_FLAGS_MAX];
/**
* struct table - nftables table
enum nft_dynset_ops op;
};
+extern const char * const set_stmt_op_names[];
+
extern struct stmt *set_stmt_alloc(const struct location *loc);
struct map_stmt {
TCPOPTHDR_TIMESTAMP,
TCPOPTHDR_ECHO,
TCPOPTHDR_ECHO_REPLY,
+ __TCPOPTHDR_MAX
};
enum tcpopt_hdr_fields {
TCPOPTHDR_FIELD_TSVAL,
TCPOPTHDR_FIELD_TSECR,
};
+
+extern const struct exthdr_desc *tcpopthdr_protocols[__TCPOPTHDR_MAX];
+
#endif /* NFTABLES_TCPOPT_H */
#define NF_CT_HELPER_NAME_LEN 16
#endif
-static const struct ct_template ct_templates[] = {
+const struct ct_template ct_templates[__NFT_CT_MAX] = {
[NFT_CT_STATE] = CT_TEMPLATE("state", &ct_state_type,
BYTEORDER_HOST_ENDIAN,
4 * BITS_PER_BYTE),
xfree(tbl);
}
-static struct symbol_table *mark_tbl;
+struct symbol_table *mark_tbl = NULL;
+
void mark_table_init(void)
{
mark_tbl = rt_symbol_table_init("/etc/iproute2/rt_marks");
.sym_tbl = &pkttype_type_tbl,
};
-static struct symbol_table *devgroup_tbl;
+struct symbol_table *devgroup_tbl = NULL;
+
void devgroup_table_init(void)
{
devgroup_tbl = rt_symbol_table_init("/etc/iproute2/group");
.basetype = &string_type,
};
-static const struct meta_template meta_templates[] = {
+const struct meta_template meta_templates[] = {
[NFT_META_LEN] = META_TEMPLATE("length", &integer_type,
4 * 8, BYTEORDER_HOST_ENDIAN),
[NFT_META_PROTOCOL] = META_TEMPLATE("protocol", ðertype_type,
.flags = DTYPE_F_PREFIX,
};
-static const struct rt_template rt_templates[] = {
+const struct rt_template rt_templates[] = {
[NFT_RT_CLASSID] = RT_TEMPLATE("classid",
&realm_type,
4 * BITS_PER_BYTE,
return NULL;
}
-#define TABLE_FLAGS_MAX 1
-
const char *table_flags_name[TABLE_FLAGS_MAX] = {
"dormant",
};
return stmt;
}
-static const char * const set_stmt_op_names[] = {
+const char * const set_stmt_op_names[] = {
[NFT_DYNSET_OP_ADD] = "add",
[NFT_DYNSET_OP_UPDATE] = "update",
};
}
}
-static const struct exthdr_desc *tcpopthdr_protocols[] = {
+const struct exthdr_desc *tcpopthdr_protocols[__TCPOPTHDR_MAX] = {
[TCPOPTHDR_EOL] = &tcpopt_eol,
[TCPOPTHDR_NOOP] = &tcpopt_nop,
[TCPOPTHDR_MAXSEG] = &tcptopt_maxseg,