diff options
author | Daniel Seither <post@tiwoc.de> | 2010-06-22 01:25:54 +0200 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2010-06-22 14:05:06 -0700 |
commit | e4cb3720bfcf8b57b4c5a2adbbb6b5967af53432 (patch) | |
tree | 491b8589349073bad72aa1d2dddce33d82b33977 /drivers/staging/batman-adv/packet.h | |
parent | 11f79decfd4e33e29694075a859f529e6d4321ad (diff) | |
download | op-kernel-dev-e4cb3720bfcf8b57b4c5a2adbbb6b5967af53432.zip op-kernel-dev-e4cb3720bfcf8b57b4c5a2adbbb6b5967af53432.tar.gz |
Staging: batman-adv: record route for ICMP messages
The standard layer 3 ping utility can use the record route (RR) option
of IP to collect route data for sent ping messages (ping -R). This
patch introduces comparable functionality for batman-adv ICMP messages.
The patch adds a second batman ICMP packet format (icmp_packet_rr) such
that up to 17 MAC addresses can be recorded (sufficient for up to 8
hops per direction). When no RR is wanted, the old icmp_packet without
the RR overhead can be sent.
Signed-off-by: Daniel Seither <post@tiwoc.de>
Signed-off-by: Marek Lindner <lindner_marek@yahoo.de>
[sven.eckelmann@gmx.de: Rework on top of current version]
Signed-off-by: Sven Eckelmann <sven.eckelmann@gmx.de>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/staging/batman-adv/packet.h')
-rw-r--r-- | drivers/staging/batman-adv/packet.h | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/drivers/staging/batman-adv/packet.h b/drivers/staging/batman-adv/packet.h index d0d35ea..8a04418 100644 --- a/drivers/staging/batman-adv/packet.h +++ b/drivers/staging/batman-adv/packet.h @@ -69,6 +69,23 @@ struct icmp_packet { uint8_t uid; } __attribute__((packed)); +#define BAT_RR_LEN 16 + +/* icmp_packet_rr must start with all fields from imcp_packet + as this is assumed by code that handles ICMP packets */ +struct icmp_packet_rr { + uint8_t packet_type; + uint8_t version; /* batman version field */ + uint8_t msg_type; /* see ICMP message types above */ + uint8_t ttl; + uint8_t dst[6]; + uint8_t orig[6]; + uint16_t seqno; + uint8_t uid; + uint8_t rr_cur; + uint8_t rr[BAT_RR_LEN][ETH_ALEN]; +} __attribute__((packed)); + struct unicast_packet { uint8_t packet_type; uint8_t version; /* batman version field */ |