File: rt.h

package info (click to toggle)
nftables 1.1.6-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 15,384 kB
  • sloc: ansic: 50,901; sh: 20,277; yacc: 5,861; python: 1,746; lex: 1,367; makefile: 392
file content (37 lines) | stat: -rw-r--r-- 975 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#ifndef NFTABLES_RT_H
#define NFTABLES_RT_H

/**
 * struct rt_template - template for routing expressions
 *
 * @token:	parser token for the expression
 * @dtype:	data type of the expression
 * @len:	length of the expression
 * @byteorder:	byteorder
 * @invalid:	invalidate datatype on allocation from parser
 */
struct rt_template {
	const char		*token;
	const struct datatype	*dtype;
	unsigned int		len;
	enum byteorder		byteorder;
	bool			invalid;
};

extern const struct rt_template rt_templates[];

#define RT_TEMPLATE(__token, __dtype, __len, __byteorder, __invalid) {	\
	.token		= (__token),					\
	.dtype		= (__dtype),					\
	.len		= (__len),					\
	.byteorder	= (__byteorder),				\
	.invalid	= (__invalid),					\
}

extern struct expr *rt_expr_alloc(const struct location *loc,
				  enum nft_rt_keys key, bool invalid);
extern void rt_expr_update_type(struct proto_ctx *ctx, struct expr *expr);

extern const struct datatype realm_type;

#endif /* NFTABLES_RT_H */