The following commit has been merged in the master branch: commit f706dcec516d213ffeea336d9c2c8bb575a7c532 Author: Antonio Quartulli ordex@autistici.org Date: Mon Jun 13 22:51:40 2011 +0200
batman-adv: clean up the tt_query flags field
The tt_query subtype is represented by the two leading bits (lsb) of the tt_query->flags field. Therefore it cannot be handled by simple "flags" but by two bits wide integer. The TT_QUERY_TYPE_MASK is used to extract the relevant bits that can be compared to the related enum values (TT_RESPONSE, TT_REQUEST)
Signed-off-by: Antonio Quartulli ordex@autistici.org Signed-off-by: Sven Eckelmann sven@narfation.org
diff --git a/packet.h b/packet.h index ef7476f..c5f081d 100644 --- a/packet.h +++ b/packet.h @@ -65,10 +65,16 @@ enum unicast_frag_flags { UNI_FRAG_LARGETAIL = 1 << 1 };
+/* TT_QUERY subtypes */ +#define TT_QUERY_TYPE_MASK 0x3 + +enum tt_query_packettype { + TT_REQUEST = 0, + TT_RESPONSE = 1 +}; + /* TT_QUERY flags */ enum tt_query_flags { - TT_RESPONSE = 1 << 0, - TT_REQUEST = 1 << 1, TT_FULL_TABLE = 1 << 2 };