Linux Kernel  3.7.1
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Macros
ptp_classify.h File Reference
#include <linux/if_ether.h>
#include <linux/if_vlan.h>
#include <linux/ip.h>
#include <linux/filter.h>
#include <netinet/in.h>

Go to the source code of this file.

Macros

#define PTP_CLASS_NONE   0x00 /* not a PTP event message */
 
#define PTP_CLASS_V1   0x01 /* protocol version 1 */
 
#define PTP_CLASS_V2   0x02 /* protocol version 2 */
 
#define PTP_CLASS_VMASK   0x0f /* max protocol version is 15 */
 
#define PTP_CLASS_IPV4   0x10 /* event in an IPV4 UDP packet */
 
#define PTP_CLASS_IPV6   0x20 /* event in an IPV6 UDP packet */
 
#define PTP_CLASS_L2   0x30 /* event in a L2 packet */
 
#define PTP_CLASS_VLAN   0x40 /* event in a VLAN tagged L2 packet */
 
#define PTP_CLASS_PMASK   0xf0 /* mask for the packet type field */
 
#define PTP_CLASS_V1_IPV4   (PTP_CLASS_V1 | PTP_CLASS_IPV4)
 
#define PTP_CLASS_V1_IPV6   (PTP_CLASS_V1 | PTP_CLASS_IPV6) /*probably DNE*/
 
#define PTP_CLASS_V2_IPV4   (PTP_CLASS_V2 | PTP_CLASS_IPV4)
 
#define PTP_CLASS_V2_IPV6   (PTP_CLASS_V2 | PTP_CLASS_IPV6)
 
#define PTP_CLASS_V2_L2   (PTP_CLASS_V2 | PTP_CLASS_L2)
 
#define PTP_CLASS_V2_VLAN   (PTP_CLASS_V2 | PTP_CLASS_VLAN)
 
#define PTP_EV_PORT   319
 
#define PTP_GEN_BIT   0x08 /* indicates general message, if set in message type */
 
#define OFF_ETYPE   12
 
#define OFF_IHL   14
 
#define OFF_FRAG   20
 
#define OFF_PROTO4   23
 
#define OFF_NEXT   6
 
#define OFF_UDP_DST   2
 
#define OFF_PTP_SOURCE_UUID   22 /* PTPv1 only */
 
#define OFF_PTP_SEQUENCE_ID   30
 
#define OFF_PTP_CONTROL   32 /* PTPv1 only */
 
#define IPV4_HLEN(data)   (((struct iphdr *)(data + OFF_IHL))->ihl << 2)
 
#define IP6_HLEN   40
 
#define UDP_HLEN   8
 
#define RELOFF_DST4   (ETH_HLEN + OFF_UDP_DST)
 
#define OFF_DST6   (ETH_HLEN + IP6_HLEN + OFF_UDP_DST)
 
#define OFF_PTP6   (ETH_HLEN + IP6_HLEN + UDP_HLEN)
 
#define OP_AND   (BPF_ALU | BPF_AND | BPF_K)
 
#define OP_JEQ   (BPF_JMP | BPF_JEQ | BPF_K)
 
#define OP_JSET   (BPF_JMP | BPF_JSET | BPF_K)
 
#define OP_LDB   (BPF_LD | BPF_B | BPF_ABS)
 
#define OP_LDH   (BPF_LD | BPF_H | BPF_ABS)
 
#define OP_LDHI   (BPF_LD | BPF_H | BPF_IND)
 
#define OP_LDX   (BPF_LDX | BPF_B | BPF_MSH)
 
#define OP_OR   (BPF_ALU | BPF_OR | BPF_K)
 
#define OP_RETA   (BPF_RET | BPF_A)
 
#define OP_RETK   (BPF_RET | BPF_K)
 
#define PTP_FILTER
 

Macro Definition Documentation

#define IP6_HLEN   40

Definition at line 69 of file ptp_classify.h.

#define IPV4_HLEN (   data)    (((struct iphdr *)(data + OFF_IHL))->ihl << 2)

Definition at line 67 of file ptp_classify.h.

#define OFF_DST6   (ETH_HLEN + IP6_HLEN + OFF_UDP_DST)

Definition at line 73 of file ptp_classify.h.

#define OFF_ETYPE   12

Definition at line 56 of file ptp_classify.h.

#define OFF_FRAG   20

Definition at line 58 of file ptp_classify.h.

#define OFF_IHL   14

Definition at line 57 of file ptp_classify.h.

#define OFF_NEXT   6

Definition at line 60 of file ptp_classify.h.

#define OFF_PROTO4   23

Definition at line 59 of file ptp_classify.h.

#define OFF_PTP6   (ETH_HLEN + IP6_HLEN + UDP_HLEN)

Definition at line 74 of file ptp_classify.h.

#define OFF_PTP_CONTROL   32 /* PTPv1 only */

Definition at line 65 of file ptp_classify.h.

#define OFF_PTP_SEQUENCE_ID   30

Definition at line 64 of file ptp_classify.h.

#define OFF_PTP_SOURCE_UUID   22 /* PTPv1 only */

Definition at line 63 of file ptp_classify.h.

#define OFF_UDP_DST   2

Definition at line 61 of file ptp_classify.h.

#define OP_AND   (BPF_ALU | BPF_AND | BPF_K)

Definition at line 76 of file ptp_classify.h.

#define OP_JEQ   (BPF_JMP | BPF_JEQ | BPF_K)

Definition at line 77 of file ptp_classify.h.

#define OP_JSET   (BPF_JMP | BPF_JSET | BPF_K)

Definition at line 78 of file ptp_classify.h.

#define OP_LDB   (BPF_LD | BPF_B | BPF_ABS)

Definition at line 79 of file ptp_classify.h.

#define OP_LDH   (BPF_LD | BPF_H | BPF_ABS)

Definition at line 80 of file ptp_classify.h.

#define OP_LDHI   (BPF_LD | BPF_H | BPF_IND)

Definition at line 81 of file ptp_classify.h.

#define OP_LDX   (BPF_LDX | BPF_B | BPF_MSH)

Definition at line 82 of file ptp_classify.h.

#define OP_OR   (BPF_ALU | BPF_OR | BPF_K)

Definition at line 83 of file ptp_classify.h.

#define OP_RETA   (BPF_RET | BPF_A)

Definition at line 84 of file ptp_classify.h.

#define OP_RETK   (BPF_RET | BPF_K)

Definition at line 85 of file ptp_classify.h.

#define PTP_CLASS_IPV4   0x10 /* event in an IPV4 UDP packet */

Definition at line 40 of file ptp_classify.h.

#define PTP_CLASS_IPV6   0x20 /* event in an IPV6 UDP packet */

Definition at line 41 of file ptp_classify.h.

#define PTP_CLASS_L2   0x30 /* event in a L2 packet */

Definition at line 42 of file ptp_classify.h.

#define PTP_CLASS_NONE   0x00 /* not a PTP event message */

Definition at line 36 of file ptp_classify.h.

#define PTP_CLASS_PMASK   0xf0 /* mask for the packet type field */

Definition at line 44 of file ptp_classify.h.

#define PTP_CLASS_V1   0x01 /* protocol version 1 */

Definition at line 37 of file ptp_classify.h.

#define PTP_CLASS_V1_IPV4   (PTP_CLASS_V1 | PTP_CLASS_IPV4)

Definition at line 46 of file ptp_classify.h.

#define PTP_CLASS_V1_IPV6   (PTP_CLASS_V1 | PTP_CLASS_IPV6) /*probably DNE*/

Definition at line 47 of file ptp_classify.h.

#define PTP_CLASS_V2   0x02 /* protocol version 2 */

Definition at line 38 of file ptp_classify.h.

#define PTP_CLASS_V2_IPV4   (PTP_CLASS_V2 | PTP_CLASS_IPV4)

Definition at line 48 of file ptp_classify.h.

#define PTP_CLASS_V2_IPV6   (PTP_CLASS_V2 | PTP_CLASS_IPV6)

Definition at line 49 of file ptp_classify.h.

#define PTP_CLASS_V2_L2   (PTP_CLASS_V2 | PTP_CLASS_L2)

Definition at line 50 of file ptp_classify.h.

#define PTP_CLASS_V2_VLAN   (PTP_CLASS_V2 | PTP_CLASS_VLAN)

Definition at line 51 of file ptp_classify.h.

#define PTP_CLASS_VLAN   0x40 /* event in a VLAN tagged L2 packet */

Definition at line 43 of file ptp_classify.h.

#define PTP_CLASS_VMASK   0x0f /* max protocol version is 15 */

Definition at line 39 of file ptp_classify.h.

#define PTP_EV_PORT   319

Definition at line 53 of file ptp_classify.h.

#define PTP_FILTER

Definition at line 95 of file ptp_classify.h.

#define PTP_GEN_BIT   0x08 /* indicates general message, if set in message type */

Definition at line 54 of file ptp_classify.h.

#define RELOFF_DST4   (ETH_HLEN + OFF_UDP_DST)

Definition at line 72 of file ptp_classify.h.

#define UDP_HLEN   8

Definition at line 70 of file ptp_classify.h.