26 #ifndef __DECODE_GRE_H__ 27 #define __DECODE_GRE_H__ 30 #define IPPROTO_GRE 47 54 #define GRE_VERSION_0 0x0000 55 #define GRE_VERSION_1 0x0001 58 #define GRE_CHKSUM_LEN 2 59 #define GRE_OFFSET_LEN 2 62 #define GRE_SRE_HDR_LEN 4 63 #define GRE_PROTO_PPP 0x880b 65 #define GRE_FLAG_ISSET_CHKSUM(r) (r->flags & 0x80) 66 #define GRE_FLAG_ISSET_ROUTE(r) (r->flags & 0x40) 67 #define GRE_FLAG_ISSET_KY(r) (r->flags & 0x20) 68 #define GRE_FLAG_ISSET_SQ(r) (r->flags & 0x10) 69 #define GRE_FLAG_ISSET_SSR(r) (r->flags & 0x08) 70 #define GRE_FLAG_ISSET_RECUR(r) (r->flags & 0x07) 71 #define GRE_GET_VERSION(r) (r->version & 0x07) 72 #define GRE_GET_FLAGS(r) (r->version & 0xF8) 73 #define GRE_GET_PROTO(r) SCNtohs(r->ether_type) 75 #define GREV1_HDR_LEN 8 76 #define GREV1_ACK_LEN 4 77 #define GREV1_FLAG_ISSET_FLAGS(r) (r->version & 0x78) 78 #define GREV1_FLAG_ISSET_ACK(r) (r->version & 0x80)
void DecodeGRERegisterTests(void)
this function registers unit tests for GRE decoder
struct GREHdr_ __attribute__((__packed__)) GREHdr
DNP3 link header.