This source file includes following definitions.
- ptp_classify_raw
- ptp_classifier_init
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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98 #include <linux/skbuff.h>
99 #include <linux/filter.h>
100 #include <linux/ptp_classify.h>
101
102 static struct bpf_prog *ptp_insns __read_mostly;
103
104 unsigned int ptp_classify_raw(const struct sk_buff *skb)
105 {
106 return BPF_PROG_RUN(ptp_insns, skb);
107 }
108 EXPORT_SYMBOL_GPL(ptp_classify_raw);
109
110 void __init ptp_classifier_init(void)
111 {
112 static struct sock_filter ptp_filter[] __initdata = {
113 { 0x28, 0, 0, 0x0000000c },
114 { 0x15, 0, 12, 0x00000800 },
115 { 0x30, 0, 0, 0x00000017 },
116 { 0x15, 0, 9, 0x00000011 },
117 { 0x28, 0, 0, 0x00000014 },
118 { 0x45, 7, 0, 0x00001fff },
119 { 0xb1, 0, 0, 0x0000000e },
120 { 0x48, 0, 0, 0x00000010 },
121 { 0x15, 0, 4, 0x0000013f },
122 { 0x48, 0, 0, 0x00000016 },
123 { 0x54, 0, 0, 0x0000000f },
124 { 0x44, 0, 0, 0x00000010 },
125 { 0x16, 0, 0, 0x00000000 },
126 { 0x06, 0, 0, 0x00000000 },
127 { 0x15, 0, 9, 0x000086dd },
128 { 0x30, 0, 0, 0x00000014 },
129 { 0x15, 0, 6, 0x00000011 },
130 { 0x28, 0, 0, 0x00000038 },
131 { 0x15, 0, 4, 0x0000013f },
132 { 0x28, 0, 0, 0x0000003e },
133 { 0x54, 0, 0, 0x0000000f },
134 { 0x44, 0, 0, 0x00000020 },
135 { 0x16, 0, 0, 0x00000000 },
136 { 0x06, 0, 0, 0x00000000 },
137 { 0x15, 0, 32, 0x00008100 },
138 { 0x28, 0, 0, 0x00000010 },
139 { 0x15, 0, 7, 0x000088f7 },
140 { 0x30, 0, 0, 0x00000012 },
141 { 0x54, 0, 0, 0x00000008 },
142 { 0x15, 0, 35, 0x00000000 },
143 { 0x28, 0, 0, 0x00000012 },
144 { 0x54, 0, 0, 0x0000000f },
145 { 0x44, 0, 0, 0x000000c0 },
146 { 0x16, 0, 0, 0x00000000 },
147 { 0x15, 0, 12, 0x00000800 },
148 { 0x30, 0, 0, 0x0000001b },
149 { 0x15, 0, 9, 0x00000011 },
150 { 0x28, 0, 0, 0x00000018 },
151 { 0x45, 7, 0, 0x00001fff },
152 { 0xb1, 0, 0, 0x00000012 },
153 { 0x48, 0, 0, 0x00000014 },
154 { 0x15, 0, 4, 0x0000013f },
155 { 0x48, 0, 0, 0x0000001a },
156 { 0x54, 0, 0, 0x0000000f },
157 { 0x44, 0, 0, 0x00000090 },
158 { 0x16, 0, 0, 0x00000000 },
159 { 0x06, 0, 0, 0x00000000 },
160 { 0x15, 0, 8, 0x000086dd },
161 { 0x30, 0, 0, 0x00000018 },
162 { 0x15, 0, 6, 0x00000011 },
163 { 0x28, 0, 0, 0x0000003c },
164 { 0x15, 0, 4, 0x0000013f },
165 { 0x28, 0, 0, 0x00000042 },
166 { 0x54, 0, 0, 0x0000000f },
167 { 0x44, 0, 0, 0x000000a0 },
168 { 0x16, 0, 0, 0x00000000 },
169 { 0x06, 0, 0, 0x00000000 },
170 { 0x15, 0, 7, 0x000088f7 },
171 { 0x30, 0, 0, 0x0000000e },
172 { 0x54, 0, 0, 0x00000008 },
173 { 0x15, 0, 4, 0x00000000 },
174 { 0x28, 0, 0, 0x0000000e },
175 { 0x54, 0, 0, 0x0000000f },
176 { 0x44, 0, 0, 0x00000040 },
177 { 0x16, 0, 0, 0x00000000 },
178 { 0x06, 0, 0, 0x00000000 },
179 };
180 struct sock_fprog_kern ptp_prog;
181
182 ptp_prog.len = ARRAY_SIZE(ptp_filter);
183 ptp_prog.filter = ptp_filter;
184
185 BUG_ON(bpf_prog_create(&ptp_insns, &ptp_prog));
186 }