aboutsummaryrefslogtreecommitdiff
path: root/include/linux/tc_ematch/tc_em_meta.h
blob: aa6b48bb4dcd0c1fbeec59278d84eb3e15244da0 (plain)
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
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#ifndef __LINUX_TC_EM_META_H
#define __LINUX_TC_EM_META_H

#include <linux/pkt_cls.h>

enum
{
	TCA_EM_META_UNSPEC,
	TCA_EM_META_HDR,
	TCA_EM_META_LVALUE,
	TCA_EM_META_RVALUE,
	__TCA_EM_META_MAX
};
#define TCA_EM_META_MAX (__TCA_EM_META_MAX - 1)

struct tcf_meta_val
{
	__u16			kind;
	__u8			shift;
	__u8			op;
};

#define TCF_META_TYPE_MASK	(0xf << 12)
#define TCF_META_TYPE(kind)	(((kind) & TCF_META_TYPE_MASK) >> 12)
#define TCF_META_ID_MASK	0x7ff
#define TCF_META_ID(kind)	((kind) & TCF_META_ID_MASK)

enum
{
	TCF_META_TYPE_VAR,
	TCF_META_TYPE_INT,
	__TCF_META_TYPE_MAX
};
#define TCF_META_TYPE_MAX (__TCF_META_TYPE_MAX - 1)

enum
{
	TCF_META_ID_VALUE,
	TCF_META_ID_RANDOM,
	TCF_META_ID_LOADAVG_0,
	TCF_META_ID_LOADAVG_1,
	TCF_META_ID_LOADAVG_2,
	TCF_META_ID_DEV,
	TCF_META_ID_INDEV,
	TCF_META_ID_REALDEV,
	TCF_META_ID_PRIORITY,
	TCF_META_ID_PROTOCOL,
	TCF_META_ID_SECURITY,
	TCF_META_ID_PKTTYPE,
	TCF_META_ID_PKTLEN,
	TCF_META_ID_DATALEN,
	TCF_META_ID_MACLEN,
	TCF_META_ID_NFMARK,
	TCF_META_ID_TCINDEX,
	TCF_META_ID_TCVERDICT,
	TCF_META_ID_TCCLASSID,
	TCF_META_ID_RTCLASSID,
	TCF_META_ID_RTIIF,
	__TCF_META_ID_MAX
};
#define TCF_META_ID_MAX (__TCF_META_ID_MAX - 1)

struct tcf_meta_hdr
{
	struct tcf_meta_val	left;
	struct tcf_meta_val	right;
};

#endif