diff options
author | Antonio Quartulli <ordex@autistici.org> | 2012-10-01 09:57:35 +0200 |
---|---|---|
committer | Antonio Quartulli <ordex@autistici.org> | 2012-11-07 20:00:18 +0100 |
commit | 7cdcf6dddc428c90ac867267a8d301e9e8b25612 (patch) | |
tree | 7cdbf95a57239352f9203b96dc915649bc0be253 /net/batman-adv/packet.h | |
parent | f6c57a460913f3c83b0e8eb51f4021fcf1c83cdc (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.h | 41 |
1 files changed, 33 insertions, 8 deletions
diff --git a/net/batman-adv/packet.h b/net/batman-adv/packet.h index b5f67a2687b1..0f8dcf337df2 100644 --- a/net/batman-adv/packet.h +++ b/net/batman-adv/packet.h @@ -23,14 +23,23 @@ #define BATADV_ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */ enum batadv_packettype { - BATADV_IV_OGM = 0x01, - BATADV_ICMP = 0x02, - BATADV_UNICAST = 0x03, - BATADV_BCAST = 0x04, - BATADV_VIS = 0x05, - BATADV_UNICAST_FRAG = 0x06, - BATADV_TT_QUERY = 0x07, - BATADV_ROAM_ADV = 0x08, + BATADV_IV_OGM = 0x01, + BATADV_ICMP = 0x02, + BATADV_UNICAST = 0x03, + BATADV_BCAST = 0x04, + BATADV_VIS = 0x05, + BATADV_UNICAST_FRAG = 0x06, + BATADV_TT_QUERY = 0x07, + BATADV_ROAM_ADV = 0x08, + BATADV_UNICAST_4ADDR = 0x09, +}; + +/** + * enum batadv_subtype - packet subtype for unicast4addr + * @BATADV_P_DATA: user payload + */ +enum batadv_subtype { + BATADV_P_DATA = 0x01, }; /* this file is included by batctl which needs these defines */ @@ -167,6 +176,22 @@ struct batadv_unicast_packet { */ }; +/** + * struct batadv_unicast_4addr_packet - extended unicast packet + * @u: common unicast packet header + * @src: address of the source + * @subtype: packet subtype + */ +struct batadv_unicast_4addr_packet { + struct batadv_unicast_packet u; + uint8_t src[ETH_ALEN]; + uint8_t subtype; + uint8_t reserved; + /* "4 bytes boundary + 2 bytes" long to make the payload after the + * following ethernet header again 4 bytes boundary aligned + */ +}; + struct batadv_unicast_frag_packet { struct batadv_header header; uint8_t ttvn; /* destination translation table version number */ |