X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=include%2Fulogd%2Fgre.h;fp=include%2Fulogd%2Fgre.h;h=50cc7d5472c3c89e977915e91fc147c377525e5d;hb=0be9704d6b24d09ebd55beedec52758cb88c570b;hp=0000000000000000000000000000000000000000;hpb=6747e89080a8265aa73320bd9f40a0fa6e1c161e;p=distributedratelimiting.git diff --git a/include/ulogd/gre.h b/include/ulogd/gre.h new file mode 100644 index 0000000..50cc7d5 --- /dev/null +++ b/include/ulogd/gre.h @@ -0,0 +1,34 @@ +#ifndef _ULOGD_GRE_H_ +#define _ULOGD_GRE_H_ + +#define GRE_FLAG_CKSUM htons(0x8000) /* Checksum Present */ +#define GRE_FLAG_ROUTE htons(0x4000) /* Routing Present */ +#define GRE_FLAG_KEY htons(0x2000) /* Key Present */ +#define GRE_FLAG_SEQ htons(0x1000) /* Sequence Present */ +#define GRE_FLAG_SSR htons(0x0800) /* Strict Source Route */ +#define GRE_FLAG_RECUR htons(0x0700) /* Recursion Control */ +#define GRE_FLAG_ACK htons(0x0080) /* Acknowledgement Present (PPTP only) */ +#define GRE_FLAG_FLAGS htons(0x0078) /* Additional Flags */ +#define GRE_FLAG_VER htons(0x0007) /* Version Number */ +#define GRE_VER_GRE htons(0x0000) /* GRE version 0 (RFC1701 GRE) */ +#define GRE_VER_PPTP htons(0x0001) /* Enhanced GRE (RFC2637 PPTP) */ + +struct grehdr { + u_int16_t flags_ver; /* See above */ + u_int16_t protocol; /* Ethernet protocol type */ + u_int16_t cksum; /* present if (flags_ver & GRE_FLAG_CKSUM) */ + u_int16_t reserved1; /* present if (flags_ver & GRE_FLAG_CKSUM) */ + u_int32_t key; /* present if (flags_ver & GRE_FLAG_KEY) */ + u_int32_t seq; /* present if (flags_ver & GRE_FLAG_SEQ) */ +}; + +struct pptphdr { + u_int16_t flags_ver; /* See above */ + u_int16_t protocol; /* Ethernet protocol type */ + u_int16_t payload_len; /* following payload length (not including this header) */ + u_int16_t call_id; /* peer call ID */ + u_int32_t seq; /* present if (flags_ver & GRE_FLAG_SEQ) */ + u_int32_t ack; /* present if (flags_ver & GRE_FLAG_ACK) */ +}; + +#endif /* _ULOGD_GRE_H_ */