diff options
author | Marek Lindner <lindner_marek@yahoo.de> | 2013-04-23 09:40:01 -0400 |
---|---|---|
committer | Antonio Quartulli <antonio@meshcoding.com> | 2013-10-09 15:22:29 -0400 |
commit | e1bf0c14096f9dc09c7695f42051d178b23d0670 (patch) | |
tree | e20f3c396c9506c9e042276ca93a3175959dffd6 /net/batman-adv/packet.h | |
parent | 3f4841ffb336075f74b05fe4a205e877bb22848d (diff) |
batman-adv: tvlv - convert tt data sent within OGMs
The translation table meta data (version number, crc checksum, etc)
as well as the translation table diff propgated within OGMs now uses
the newly introduced tvlv infrastructure.
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Signed-off-by: Antonio Quartulli <antonio@meshcoding.com>
Diffstat (limited to 'net/batman-adv/packet.h')
-rw-r--r-- | net/batman-adv/packet.h | 51 |
1 files changed, 41 insertions, 10 deletions
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index 55deb4dea842..cd59fcc9b79a 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h | |||
@@ -86,14 +86,21 @@ enum batadv_unicast_frag_flags { | |||
86 | /* TT_QUERY subtypes */ | 86 | /* TT_QUERY subtypes */ |
87 | #define BATADV_TT_QUERY_TYPE_MASK 0x3 | 87 | #define BATADV_TT_QUERY_TYPE_MASK 0x3 |
88 | 88 | ||
89 | enum batadv_tt_query_packettype { | 89 | /* tt data subtypes */ |
90 | BATADV_TT_REQUEST = 0, | 90 | #define BATADV_TT_DATA_TYPE_MASK 0x0F |
91 | BATADV_TT_RESPONSE = 1, | ||
92 | }; | ||
93 | 91 | ||
94 | /* TT_QUERY flags */ | 92 | /** |
95 | enum batadv_tt_query_flags { | 93 | * enum batadv_tt_data_flags - flags for tt data tvlv |
96 | BATADV_TT_FULL_TABLE = BIT(2), | 94 | * @BATADV_TT_OGM_DIFF: TT diff propagated through OGM |
95 | * @BATADV_TT_REQUEST: TT request message | ||
96 | * @BATADV_TT_RESPONSE: TT response message | ||
97 | * @BATADV_TT_FULL_TABLE: contains full table to replace existing table | ||
98 | */ | ||
99 | enum batadv_tt_data_flags { | ||
100 | BATADV_TT_OGM_DIFF = BIT(0), | ||
101 | BATADV_TT_REQUEST = BIT(1), | ||
102 | BATADV_TT_RESPONSE = BIT(2), | ||
103 | BATADV_TT_FULL_TABLE = BIT(4), | ||
97 | }; | 104 | }; |
98 | 105 | ||
99 | /* BATADV_TT_CLIENT flags. | 106 | /* BATADV_TT_CLIENT flags. |
@@ -123,11 +130,13 @@ enum batadv_bla_claimframe { | |||
123 | * @BATADV_TVLV_GW: gateway tvlv | 130 | * @BATADV_TVLV_GW: gateway tvlv |
124 | * @BATADV_TVLV_DAT: distributed arp table tvlv | 131 | * @BATADV_TVLV_DAT: distributed arp table tvlv |
125 | * @BATADV_TVLV_NC: network coding tvlv | 132 | * @BATADV_TVLV_NC: network coding tvlv |
133 | * @BATADV_TVLV_TT: translation table tvlv | ||
126 | */ | 134 | */ |
127 | enum batadv_tvlv_type { | 135 | enum batadv_tvlv_type { |
128 | BATADV_TVLV_GW = 0x01, | 136 | BATADV_TVLV_GW = 0x01, |
129 | BATADV_TVLV_DAT = 0x02, | 137 | BATADV_TVLV_DAT = 0x02, |
130 | BATADV_TVLV_NC = 0x03, | 138 | BATADV_TVLV_NC = 0x03, |
139 | BATADV_TVLV_TT = 0x04, | ||
131 | }; | 140 | }; |
132 | 141 | ||
133 | /* the destination hardware field in the ARP frame is used to | 142 | /* the destination hardware field in the ARP frame is used to |
@@ -161,9 +170,6 @@ struct batadv_ogm_packet { | |||
161 | uint8_t prev_sender[ETH_ALEN]; | 170 | uint8_t prev_sender[ETH_ALEN]; |
162 | uint8_t reserved; | 171 | uint8_t reserved; |
163 | uint8_t tq; | 172 | uint8_t tq; |
164 | uint8_t tt_num_changes; | ||
165 | uint8_t ttvn; /* translation table version number */ | ||
166 | __be16 tt_crc; | ||
167 | __be16 tvlv_len; | 173 | __be16 tvlv_len; |
168 | } __packed; | 174 | } __packed; |
169 | 175 | ||
@@ -375,4 +381,29 @@ struct batadv_tvlv_gateway_data { | |||
375 | __be32 bandwidth_up; | 381 | __be32 bandwidth_up; |
376 | }; | 382 | }; |
377 | 383 | ||
384 | /** | ||
385 | * struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container | ||
386 | * @flags: translation table flags (see batadv_tt_data_flags) | ||
387 | * @ttvn: translation table version number | ||
388 | * @crc: crc16 checksum of the local translation table | ||
389 | */ | ||
390 | struct batadv_tvlv_tt_data { | ||
391 | uint8_t flags; | ||
392 | uint8_t ttvn; | ||
393 | __be16 crc; | ||
394 | }; | ||
395 | |||
396 | /** | ||
397 | * struct batadv_tvlv_tt_change - translation table diff data | ||
398 | * @flags: status indicators concerning the non-mesh client (see | ||
399 | * batadv_tt_client_flags) | ||
400 | * @reserved: reserved field | ||
401 | * @addr: mac address of non-mesh client that triggered this tt change | ||
402 | */ | ||
403 | struct batadv_tvlv_tt_change { | ||
404 | uint8_t flags; | ||
405 | uint8_t reserved; | ||
406 | uint8_t addr[ETH_ALEN]; | ||
407 | }; | ||
408 | |||
378 | #endif /* _NET_BATMAN_ADV_PACKET_H_ */ | 409 | #endif /* _NET_BATMAN_ADV_PACKET_H_ */ |