summaryrefslogtreecommitdiffstats
path: root/net/batman-adv/packet.h
diff options
context:
space:
mode:
Diffstat (limited to 'net/batman-adv/packet.h')
-rw-r--r--net/batman-adv/packet.h51
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
89enum 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/**
95enum 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 */
99enum 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 */
127enum batadv_tvlv_type { 135enum 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 */
390struct 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 */
403struct 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_ */