Remove type flag bits

This commit is contained in:
Jeremy Lakeman 2012-11-23 13:26:43 +10:30
parent 46158fea7e
commit a358d924d7
3 changed files with 3 additions and 11 deletions

View File

@ -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

View File

@ -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();
}

View File

@ -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();
}