aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/packet.h
diff options
context:
space:
mode:
authorAntonio Quartulli <antonio@open-mesh.com>2013-07-30 16:16:25 -0400
committerAntonio Quartulli <antonio@meshcoding.com>2013-10-19 17:25:12 -0400
commit7ea7b4a142758deaf46c1af0ca9ceca6dd55138b (patch)
tree02803d96cc171936e7c973f389ec19f7e0295a97 /net/batman-adv/packet.h
parenta70a9aa990bdf24039cb4167993bcc5a0f9cbb18 (diff)
batman-adv: make the TT CRC logic VLAN specific
This change allows nodes to handle the TT table on a per-VLAN basis. This is needed because nodes may have to store only some of the global entries advertised by another node. In this scenario such nodes would re-create only a partial global table and would not be able to compute a correct CRC anymore. This patch splits the logic and introduces one CRC per VLAN. In this way a node fetching only some entries belonging to some VLANs is still able to compute the needed CRCs and still check the table correctness. With this patch the shape of the TVLV-TT is changed too because now a node needs to advertise all the CRCs of all the VLANs that it is wired to. The debug output of the local Translation Table now shows the CRC along with each entry since there is not a common value for the entire table anymore. Signed-off-by: Antonio Quartulli <antonio@open-mesh.com> Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
Diffstat (limited to 'net/batman-adv/packet.h')
-rw-r--r--net/batman-adv/packet.h18
1 files changed, 15 insertions, 3 deletions
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index 6311642f3ee8..9fbcaacc345a 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -391,14 +391,26 @@ struct batadv_tvlv_gateway_data {
391 * struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container 391 * struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container
392 * @flags: translation table flags (see batadv_tt_data_flags) 392 * @flags: translation table flags (see batadv_tt_data_flags)
393 * @ttvn: translation table version number 393 * @ttvn: translation table version number
394 * @reserved: field reserved for future use 394 * @vlan_num: number of announced VLANs. In the TVLV this struct is followed by
395 * @crc: crc32 checksum of the local translation table 395 * one batadv_tvlv_tt_vlan_data object per announced vlan
396 */ 396 */
397struct batadv_tvlv_tt_data { 397struct batadv_tvlv_tt_data {
398 uint8_t flags; 398 uint8_t flags;
399 uint8_t ttvn; 399 uint8_t ttvn;
400 __be16 num_vlan;
401};
402
403/**
404 * struct batadv_tvlv_tt_vlan_data - vlan specific tt data propagated through
405 * the tt tvlv container
406 * @crc: crc32 checksum of the entries belonging to this vlan
407 * @vid: vlan identifier
408 * @reserved: unused, useful for alignment purposes
409 */
410struct batadv_tvlv_tt_vlan_data {
411 __be32 crc;
412 __be16 vid;
400 uint16_t reserved; 413 uint16_t reserved;
401 __be32 crc;
402}; 414};
403 415
404/** 416/**