5 #ifndef __PROTOCOL_CONSTANTS_H__
6 #define __PROTOCOL_CONSTANTS_H__
9 #include "endianness.h"
18 #if defined(BIG_ENDIAN_DETECTED)
20 #define ETH_TYPE_MPLS_UNICAST 0x8847
21 #define ETH_TYPE_MPLS_MULTICAST 0x8848
22 #define ETH_TYPE_8021Q 0x8100
23 #define ETH_TYPE_IPV4 0x0800
24 #define ETH_TYPE_IPV6 0x86DD
25 #define ETH_TYPE_PPPOE_DISCOVERY 0x8863
26 #define ETH_TYPE_PPPOE_SESSION 0x8864
27 #define ETH_TYPE_ARP 0x0806
28 #define ETH_TYPE_PBB 0x88E7
31 #define VLAN_CTAG_ETHER_TYPE 0x8100
32 #define VLAN_STAG_ETHER_TYPE 0x88a8
33 #define VLAN_ITAG_ETHER_TYPE 0x88e7
37 #define PPP_PROT_PADDING 0x0001 // 0x00 0x01 in network byte order
38 #define PPP_PROT_LCP 0xc021 // 0xc0 0x21 in network byte order
39 #define PPP_PROT_PAP 0xc023 // 0xc0 0x23 in network byte order
40 #define PPP_PROT_LQR 0xc025 // 0xc0 0x25 in network byte order
41 #define PPP_PROT_CHAP 0xc223 // 0xc2 0x23 in network byte order
42 #define PPP_PROT_EAP 0xc227 // 0xc2 0x27 in network byte order
43 #define PPP_PROT_IPCP 0x8021 // 0x80 0x21 in network byte order
44 #define PPP_PROT_IPV4 0x0021 // 0x00 0x21 in network byte order
45 #define PPP_PROT_IPV6CP 0x8057 // 0x80 0x57 in network byte order
46 #define PPP_PROT_IPV6 0x0057 // 0x00 0x57 in network byte order
47 #define PPP_PROT_CCP 0x80fd // 0x80 0xfd in network byte order
50 #define UDP_DST_PORT_GTPC 0x084B //2123
51 #define UDP_DST_PORT_GTPU 0x0868 //2152
52 #define UDP_DST_PORT_CAPWAPC 0x147e //5246
53 #define UDP_DST_PORT_CAPWAPU 0x147f //5247
55 #elif defined(LITTLE_ENDIAN_DETECTED)
57 #define ETH_TYPE_MPLS_UNICAST 0x4788
58 #define ETH_TYPE_MPLS_MULTICAST 0x4888
59 #define ETH_TYPE_8021Q 0x0081
60 #define ETH_TYPE_IPV4 0x0008
61 #define ETH_TYPE_IPV6 0xDD86
62 #define ETH_TYPE_PPPOE_DISCOVERY 0x6388
63 #define ETH_TYPE_PPPOE_SESSION 0x6488
64 #define ETH_TYPE_ARP 0x0608
65 #define ETH_TYPE_PBB 0xE788
68 #define VLAN_CTAG_ETHER_TYPE 0x0081
69 #define VLAN_STAG_ETHER_TYPE 0xa888
70 #define VLAN_ITAG_ETHER_TYPE 0xe788
74 #define PPP_PROT_PADDING 0x0100 // 0x00 0x01 in network byte order
75 #define PPP_PROT_LCP 0x21c0 // 0xc0 0x21 in network byte order
76 #define PPP_PROT_PAP 0x23c0 // 0xc0 0x23 in network byte order
77 #define PPP_PROT_LQR 0x25c0 // 0xc0 0x25 in network byte order
78 #define PPP_PROT_CHAP 0x23c2 // 0xc2 0x23 in network byte order
79 #define PPP_PROT_EAP 0x27c2 // 0xc2 0x27 in network byte order
80 #define PPP_PROT_IPCP 0x2180 // 0x80 0x21 in network byte order
81 #define PPP_PROT_IPV4 0x2100 // 0x00 0x21 in network byte order
82 #define PPP_PROT_IPV6CP 0x5780 // 0x80 0x57 in network byte order
83 #define PPP_PROT_IPV6 0x5700 // 0x00 0x57 in network byte order
84 #define PPP_PROT_CCP 0xfd80 // 0x80 0xfd in network byte order
87 #define UDP_DST_PORT_GTPC 0x4B08 //2123
88 #define UDP_DST_PORT_GTPU 0x6808 //2152
89 #define UDP_DST_PORT_CAPWAPC 0x7e14 //5246
90 #define UDP_DST_PORT_CAPWAPU 0x7f14 //5247
93 #error Unknwon endianness
102 #define LLC_DELIMITER_HBO 0x0600
105 #define IP_PROTO_TCP 6
106 #define IP_PROTO_UDP 17
107 #define IP_PROTO_SCTP 132
108 #define IP_PROTO_GRE 47
109 #define IP_PROTO_ICMPV4 1
110 #define IP_PROTO_ICMPV6 58
113 #define PPP_PROTO_IP4 0x21
114 #define PPP_PROTO_IP6 0x57
117 #endif //__PROTOCOL_CONSTANTS_H__