The following commit has been merged in the next branch: commit 40336a78e16b0cf77ba622ede81c405ca5f30ec4 Author: Antonio Quartulli ordex@autistici.org Date: Thu Jun 2 12:54:20 2011 +0200
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
diff --git a/packet.h b/packet.h index 7971a69..f704c51 100644 --- a/packet.h +++ b/packet.h @@ -25,14 +25,19 @@ #define ETH_P_BATMAN 0x4305 /* unofficial/not registered Ethertype */
enum bat_packettype { - BAT_IV_OGM = 0x01, - BAT_ICMP = 0x02, - BAT_UNICAST = 0x03, - BAT_BCAST = 0x04, - BAT_VIS = 0x05, - BAT_UNICAST_FRAG = 0x06, - BAT_TT_QUERY = 0x07, - BAT_ROAM_ADV = 0x08 + BAT_IV_OGM = 0x01, + BAT_ICMP = 0x02, + BAT_UNICAST = 0x03, + BAT_BCAST = 0x04, + BAT_VIS = 0x05, + BAT_UNICAST_FRAG = 0x06, + BAT_TT_QUERY = 0x07, + BAT_ROAM_ADV = 0x08, + BAT_UNICAST_4ADDR = 0x09 +}; + +enum bat_subtype { + BAT_P_DATA = 0x01 };
/* this file is included by batctl which needs these defines */ @@ -158,6 +163,12 @@ struct unicast_packet { uint8_t dest[ETH_ALEN]; } __packed;
+struct unicast_4addr_packet { + struct unicast_packet u; + uint8_t src[ETH_ALEN]; + uint8_t subtype; +} __packed; + struct unicast_frag_packet { struct batman_header header; uint8_t ttvn; /* destination translation table version number */