The following commit has been merged in the master branch: commit 6229a68792c0ae1522b2aff999f72243d8689445 Author: Antonio Quartulli ordex@autistici.org Date: Wed Apr 27 14:27:44 2011 +0200
batctl: improved client announcement mechanism
The old HNA mechanism has been totally rewritten from scratch. The new mechanism consists in announcing local translation-table changes only, reducing the protocol overhead.
For details, please visit: http://www.open-mesh.org/wiki/batman-adv/Client-announcement
Moreover: - COMPAT_VERSION has been increased to 14 - batman-adv now depends on module "crc16" for tt crc computation
Signed-off-by: Antonio Quartulli ordex@autistici.org Acked-by: Simon Wunderlich siwu@hrz.tu-chemnitz.de Signed-off-by: Sven Eckelmann sven@narfation.org
diff --git a/packet.h b/packet.h index f4052f2..49500a9 100644 --- a/packet.h +++ b/packet.h @@ -30,6 +30,7 @@ #define BAT_BCAST 0x04 #define BAT_VIS 0x05 #define BAT_UNICAST_FRAG 0x06 +#define BAT_TT_QUERY 0x07
/* this file is included by batctl which needs these defines */ #define COMPAT_VERSION 14 @@ -52,6 +53,11 @@ #define UNI_FRAG_HEAD 0x01 #define UNI_FRAG_LARGETAIL 0x02
+/* TT flags */ +#define TT_RESPONSE 0x01 +#define TT_REQUEST 0x02 +#define TT_FULL_TABLE 0x04 + struct batman_packet { uint8_t packet_type; uint8_t version; /* batman version field */ @@ -62,8 +68,9 @@ struct batman_packet { uint8_t prev_sender[6]; uint8_t gw_flags; /* flags related to gateway class */ uint8_t tq; - uint8_t num_tt; - uint8_t reserved; + uint8_t tt_num_changes; + uint8_t ttvn; /* translation table version number */ + uint16_t tt_crc; } __packed;
#define BAT_PACKET_LEN sizeof(struct batman_packet) @@ -101,7 +108,7 @@ struct unicast_packet { uint8_t packet_type; uint8_t version; /* batman version field */ uint8_t ttl; - uint8_t reserved; + uint8_t ttvn; /* destination translation table version number */ uint8_t dest[6]; } __packed;
@@ -109,7 +116,7 @@ struct unicast_frag_packet { uint8_t packet_type; uint8_t version; /* batman version field */ uint8_t ttl; - uint8_t reserved; + uint8_t ttvn; /* destination translation table version number */ uint8_t dest[6]; uint8_t flags; uint8_t align; @@ -139,4 +146,27 @@ struct vis_packet { uint8_t sender_orig[6]; /* who sent or rebroadcasted this packet */ } __packed;
+struct tt_query_packet { + uint8_t packet_type; + uint8_t version; /* batman version field */ + uint8_t ttl; + /* the flag field is a combination of: + * - TT_REQUEST or TT_RESPONSE + * - TT_FULL_TABLE */ + uint8_t flags; + uint8_t dst[ETH_ALEN]; + uint8_t src[ETH_ALEN]; + /* the ttvn field is: + * if TT_REQUEST: ttvn that triggered the + * request + * if TT_RESPONSE: new ttvn for the src + * orig_node */ + uint8_t ttvn; + /* tt_data field is: + * if TT_REQUEST: crc associated with the + * ttvn + * if TT_RESPONSE: table_size */ + uint16_t tt_data; +} __packed; + #endif /* _NET_BATMAN_ADV_PACKET_H_ */