From d6a4f8d77bf1d31bb623c25150479ff8c0daacd7 Mon Sep 17 00:00:00 2001 From: Adam Ierymenko Date: Thu, 12 Jun 2014 11:40:30 -0700 Subject: [PATCH] Add flags to EXT_FRAME for better future proofness. --- node/Packet.hpp | 7 +++++-- node/PacketDecoder.cpp | 2 +- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/node/Packet.hpp b/node/Packet.hpp index 833e95f18..95243426b 100644 --- a/node/Packet.hpp +++ b/node/Packet.hpp @@ -178,13 +178,15 @@ #define ZT_PROTO_VERB_EXT_FRAME_IDX_NETWORK_ID (ZT_PACKET_IDX_PAYLOAD) #define ZT_PROTO_VERB_EXT_FRAME_LEN_NETWORK_ID 8 -#define ZT_PROTO_VERB_EXT_FRAME_IDX_TO (ZT_PROTO_VERB_FRAME_IDX_NETWORK_ID + ZT_PROTO_VERB_EXT_FRAME_LEN_NETWORK_ID) +#define ZT_PROTO_VERB_EXT_FRAME_IDX_FLAGS (ZT_PROTO_VERB_EXT_FRAME_IDX_NETWORK_ID + ZT_PROTO_VERB_EXT_FRAME_LEN_NETWORK_ID) +#define ZT_PROTO_VERB_EXT_FRAME_LEN_FLAGS 1 +#define ZT_PROTO_VERB_EXT_FRAME_IDX_TO (ZT_PROTO_VERB_EXT_FRAME_IDX_FLAGS + ZT_PROTO_VERB_EXT_FRAME_LEN_FLAGS) #define ZT_PROTO_VERB_EXT_FRAME_LEN_TO 6 #define ZT_PROTO_VERB_EXT_FRAME_IDX_FROM (ZT_PROTO_VERB_EXT_FRAME_IDX_TO + ZT_PROTO_VERB_EXT_FRAME_LEN_TO) #define ZT_PROTO_VERB_EXT_FRAME_LEN_FROM 6 #define ZT_PROTO_VERB_EXT_FRAME_IDX_ETHERTYPE (ZT_PROTO_VERB_EXT_FRAME_IDX_FROM + ZT_PROTO_VERB_EXT_FRAME_LEN_FROM) #define ZT_PROTO_VERB_EXT_FRAME_LEN_ETHERTYPE 2 -#define ZT_PROTO_VERB_EXT_FRAME_IDX_PAYLOAD (ZT_PROTO_VERB_FRAME_IDX_ETHERTYPE + 2) +#define ZT_PROTO_VERB_EXT_FRAME_IDX_PAYLOAD (ZT_PROTO_VERB_FRAME_IDX_ETHERTYPE + ZT_PROTO_VERB_EXT_FRAME_LEN_ETHERTYPE) #define ZT_PROTO_VERB_MULTICAST_FRAME_IDX_PROPAGATION_DEPTH (ZT_PACKET_IDX_PAYLOAD) #define ZT_PROTO_VERB_MULTICAST_FRAME_LEN_PROPAGATION_DEPTH 2 @@ -510,6 +512,7 @@ public: /* * An ethernet frame to or from specified MAC addresses: * <[8] 64-bit network ID> + * <[1] flags (currently unused, must be 0)> * <[6] destination MAC or all zero for destination node> * <[6] source MAC or all zero for node of origin> * <[2] 16-bit ethertype> diff --git a/node/PacketDecoder.cpp b/node/PacketDecoder.cpp index c94caa3eb..2b9d034a4 100644 --- a/node/PacketDecoder.cpp +++ b/node/PacketDecoder.cpp @@ -486,7 +486,7 @@ bool PacketDecoder::_doEXT_FRAME(const RuntimeEnvironment *_r,const SharedPtr(ZT_PROTO_VERB_FRAME_IDX_NETWORK_ID)); }