This source file includes following definitions.
- ptp_classifier_init
- ptp_classify_raw
1
2
3
4
5
6
7
8
9
10 #ifndef _PTP_CLASSIFY_H_
11 #define _PTP_CLASSIFY_H_
12
13 #include <linux/ip.h>
14 #include <linux/skbuff.h>
15
16 #define PTP_CLASS_NONE 0x00
17 #define PTP_CLASS_V1 0x01
18 #define PTP_CLASS_V2 0x02
19 #define PTP_CLASS_VMASK 0x0f
20 #define PTP_CLASS_IPV4 0x10
21 #define PTP_CLASS_IPV6 0x20
22 #define PTP_CLASS_L2 0x40
23 #define PTP_CLASS_PMASK 0x70
24 #define PTP_CLASS_VLAN 0x80
25
26 #define PTP_CLASS_V1_IPV4 (PTP_CLASS_V1 | PTP_CLASS_IPV4)
27 #define PTP_CLASS_V1_IPV6 (PTP_CLASS_V1 | PTP_CLASS_IPV6)
28 #define PTP_CLASS_V2_IPV4 (PTP_CLASS_V2 | PTP_CLASS_IPV4)
29 #define PTP_CLASS_V2_IPV6 (PTP_CLASS_V2 | PTP_CLASS_IPV6)
30 #define PTP_CLASS_V2_L2 (PTP_CLASS_V2 | PTP_CLASS_L2)
31 #define PTP_CLASS_V2_VLAN (PTP_CLASS_V2 | PTP_CLASS_VLAN)
32 #define PTP_CLASS_L4 (PTP_CLASS_IPV4 | PTP_CLASS_IPV6)
33
34 #define PTP_EV_PORT 319
35 #define PTP_GEN_BIT 0x08
36
37 #define OFF_PTP_SOURCE_UUID 22
38 #define OFF_PTP_SEQUENCE_ID 30
39 #define OFF_PTP_CONTROL 32
40
41
42 #define IP6_HLEN 40
43 #define UDP_HLEN 8
44 #define OFF_IHL 14
45 #define IPV4_HLEN(data) (((struct iphdr *)(data + OFF_IHL))->ihl << 2)
46
47 #if defined(CONFIG_NET_PTP_CLASSIFY)
48
49
50
51
52
53
54
55
56
57
58 unsigned int ptp_classify_raw(const struct sk_buff *skb);
59
60 void __init ptp_classifier_init(void);
61 #else
62 static inline void ptp_classifier_init(void)
63 {
64 }
65 static inline unsigned int ptp_classify_raw(struct sk_buff *skb)
66 {
67 return PTP_CLASS_NONE;
68 }
69 #endif
70 #endif