aboutsummaryrefslogtreecommitdiffstats
path: root/net/batman-adv/packet.h
diff options
context:
space:
mode:
authorAntonio Quartulli <ordex@autistici.org>2012-10-01 03:57:35 -0400
committerAntonio Quartulli <ordex@autistici.org>2012-11-07 14:00:18 -0500
commit7cdcf6dddc428c90ac867267a8d301e9e8b25612 (patch)
tree7cdbf95a57239352f9203b96dc915649bc0be253 /net/batman-adv/packet.h
parentf6c57a460913f3c83b0e8eb51f4021fcf1c83cdc (diff)
batman-adv: add UNICAST_4ADDR packet type
The current unicast packet type does not contain the orig source address. This patches add a new unicast packet (called UNICAST_4ADDR) which provides two new fields: the originator source address and the subtype (the type of the data contained in the packet payload). The former is useful to identify the node which injected the packet into the network and the latter is useful to avoid creating new unicast packet types in the future: a macro defining a new subtype will be enough. Signed-off-by: Antonio Quartulli <ordex@autistici.org>
Diffstat (limited to 'net/batman-adv/packet.h')
-rw-r--r--net/batman-adv/packet.h41
1 files changed, 33 insertions, 8 deletions
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h
index b5f67a2687b..0f8dcf337df 100644
--- a/net/batman-adv/packet.h
+++ b/net/batman-adv/packet.h
@@ -23,14 +23,23 @@
23#define BATADV_ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */ 23#define BATADV_ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */
24 24
25enum batadv_packettype { 25enum batadv_packettype {
26 BATADV_IV_OGM = 0x01, 26 BATADV_IV_OGM = 0x01,
27 BATADV_ICMP = 0x02, 27 BATADV_ICMP = 0x02,
28 BATADV_UNICAST = 0x03, 28 BATADV_UNICAST = 0x03,
29 BATADV_BCAST = 0x04, 29 BATADV_BCAST = 0x04,
30 BATADV_VIS = 0x05, 30 BATADV_VIS = 0x05,
31 BATADV_UNICAST_FRAG = 0x06, 31 BATADV_UNICAST_FRAG = 0x06,
32 BATADV_TT_QUERY = 0x07, 32 BATADV_TT_QUERY = 0x07,
33 BATADV_ROAM_ADV = 0x08, 33 BATADV_ROAM_ADV = 0x08,
34 BATADV_UNICAST_4ADDR = 0x09,
35};
36
37/**
38 * enum batadv_subtype - packet subtype for unicast4addr
39 * @BATADV_P_DATA: user payload
40 */
41enum batadv_subtype {
42 BATADV_P_DATA = 0x01,
34}; 43};
35 44
36/* this file is included by batctl which needs these defines */ 45/* this file is included by batctl which needs these defines */
@@ -167,6 +176,22 @@ struct batadv_unicast_packet {
167 */ 176 */
168}; 177};
169 178
179/**
180 * struct batadv_unicast_4addr_packet - extended unicast packet
181 * @u: common unicast packet header
182 * @src: address of the source
183 * @subtype: packet subtype
184 */
185struct batadv_unicast_4addr_packet {
186 struct batadv_unicast_packet u;
187 uint8_t src[ETH_ALEN];
188 uint8_t subtype;
189 uint8_t reserved;
190 /* "4 bytes boundary + 2 bytes" long to make the payload after the
191 * following ethernet header again 4 bytes boundary aligned
192 */
193};
194
170struct batadv_unicast_frag_packet { 195struct batadv_unicast_frag_packet {
171 struct batadv_header header; 196 struct batadv_header header;
172 uint8_t ttvn; /* destination translation table version number */ 197 uint8_t ttvn; /* destination translation table version number */