From a358d924d7799f0b29a073e0dd6e38617aaf0bd5 Mon Sep 17 00:00:00 2001 From: Jeremy Lakeman Date: Fri, 23 Nov 2012 13:26:43 +1030 Subject: [PATCH] Remove type flag bits --- constants.h | 8 -------- overlay_mdp.c | 4 ++-- overlay_packetformats.c | 2 +- 3 files changed, 3 insertions(+), 11 deletions(-) diff --git a/constants.h b/constants.h index 1233f97a..a7fa3da5 100644 --- a/constants.h +++ b/constants.h @@ -101,21 +101,13 @@ Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. #define OF_TYPE_PLEASEEXPLAIN 0x60 /* Request for resolution of an abbreviated address */ #define OF_TYPE_NODEANNOUNCE 0x70 -/* Flags used to control the interpretation of the resolved type field */ -#define OF_TYPE_FLAG_BITS 0xf0000000 -#define OF_TYPE_FLAG_NORMAL 0x0 - /* Modifiers that indicate the disposition of the frame */ #define OF_MODIFIER_BITS 0x0f /* Crypto/security options */ -#define OF_CRYPTO_BITS 0x0c #define OF_CRYPTO_NONE 0x00 #define OF_CRYPTO_CIPHERED 0x04 /* Encrypted frame */ #define OF_CRYPTO_SIGNED 0x08 /* signed frame */ -/* The following was previously considered, but is not being implemented at this - time. - #define OF_CRYPTO_PARANOID 0x0c Encrypted and digitally signed frame, with final destination address also encrypted. */ /* QOS packet queue bits */ #define OF_QUEUE_BITS 0x03 diff --git a/overlay_mdp.c b/overlay_mdp.c index f7614d7b..f3e5c4b0 100644 --- a/overlay_mdp.c +++ b/overlay_mdp.c @@ -271,7 +271,7 @@ int overlay_mdp_decrypt(struct overlay_frame *f, overlay_mdp_frame *mdp) /* Indicate MDP message type */ mdp->packetTypeAndFlags=MDP_TX; - switch(f->modifiers&OF_CRYPTO_BITS) { + switch(f->modifiers&(OF_CRYPTO_CIPHERED|OF_CRYPTO_SIGNED)) { case 0: /* nothing to do, b already points to the plain text */ mdp->packetTypeAndFlags|=MDP_NOCRYPT|MDP_NOSIGN; @@ -855,7 +855,7 @@ int overlay_mdp_dispatch(overlay_mdp_frame *mdp,int userGeneratedFrameP, frame->queue = OQ_ORDINARY; /* Make sure only voice traffic gets priority */ - if ((frame->type&OF_TYPE_BITS)==OF_TYPE_DATA_VOICE) { + if (frame->type==OF_TYPE_DATA_VOICE) { frame->queue=OQ_ISOCHRONOUS_VOICE; rhizome_saw_voice_traffic(); } diff --git a/overlay_packetformats.c b/overlay_packetformats.c index 935bd795..2cf7f7f6 100644 --- a/overlay_packetformats.c +++ b/overlay_packetformats.c @@ -103,7 +103,7 @@ int overlay_forward_payload(struct overlay_frame *f){ return WHY("Could not clone frame for queuing"); /* Make sure voice traffic gets priority */ - if ((qf->type&OF_TYPE_BITS)==OF_TYPE_DATA_VOICE) { + if (qf->type==OF_TYPE_DATA_VOICE) { qf->queue=OQ_ISOCHRONOUS_VOICE; rhizome_saw_voice_traffic(); }