Repository : ssh://git@open-mesh.org/batctl
On branch : master
commit 79e8fee2a497bd14a9af1b44d76b6fedf4e2c227 Author: Marek Lindner lindner_marek@yahoo.de Date: Tue Apr 23 21:39:58 2013 +0800
batctl: tvlv - gateway download/upload bandwidth container
Prior to this patch batman-adv read the advertised uplink bandwidth from userspace and compressed this information into a single byte called "gateway class". Now the download & upload bandwidth information is sent as-is. No userspace change is necessary since the sysfs API always allowed to specify a bandwidth.
Signed-off-by: Marek Lindner lindner_marek@yahoo.de Signed-off-by: Spyros Gasteratos morfeas3000@gmail.com
79e8fee2a497bd14a9af1b44d76b6fedf4e2c227 packet.h | 21 ++++++++++++++++++++- tcpdump.c | 3 +-- 2 files changed, 21 insertions(+), 3 deletions(-)
diff --git a/packet.h b/packet.h index f990531..a7c5475 100644 --- a/packet.h +++ b/packet.h @@ -118,6 +118,14 @@ enum batadv_bla_claimframe { BATADV_CLAIM_TYPE_REQUEST = 0x03, };
+/** + * enum batadv_tvlv_type - tvlv type definitions + * @BATADV_TVLV_GW: gateway tvlv + */ +enum batadv_tvlv_type { + BATADV_TVLV_GW = 0x01, +}; + /* the destination hardware field in the ARP frame is used to * transport the claim type and the group id */ @@ -147,7 +155,7 @@ struct batadv_ogm_packet { __be32 seqno; uint8_t orig[ETH_ALEN]; uint8_t prev_sender[ETH_ALEN]; - uint8_t gw_flags; /* flags related to gateway class */ + uint8_t reserved; uint8_t tq; uint8_t tt_num_changes; uint8_t ttvn; /* translation table version number */ @@ -378,4 +386,15 @@ struct batadv_tvlv_long { __be16 len; };
+/** + * struct batadv_tvlv_gateway_data - gateway data propagated through gw tvlv + * container + * @bandwidth_down: advertised uplink download bandwidth + * @bandwidth_up: advertised uplink upload bandwidth + */ +struct batadv_tvlv_gateway_data { + uint32_t bandwidth_down; + uint32_t bandwidth_up; +}; + #endif /* _NET_BATMAN_ADV_PACKET_H_ */ diff --git a/tcpdump.c b/tcpdump.c index b4cfec9..0bf21d3 100644 --- a/tcpdump.c +++ b/tcpdump.c @@ -405,7 +405,7 @@ static void dump_batman_iv_ogm(unsigned char *packet_buff, ssize_t buff_len, int printf("BAT %s: ", get_name_by_macaddr((struct ether_addr *)batman_ogm_packet->orig, read_opt));
- printf("OGM IV via neigh %s, seq %u, tq %3d, ttvn %d, ttcrc %hu, ttl %2d, v %d, flags [%c%c%c%c%c], length %zu\n", + printf("OGM IV via neigh %s, seq %u, tq %3d, ttvn %d, ttcrc %hu, ttl %2d, v %d, flags [%c%c%c%c], length %zu\n", get_name_by_macaddr((struct ether_addr *)ether_header->ether_shost, read_opt), ntohl(batman_ogm_packet->seqno), batman_ogm_packet->tq, batman_ogm_packet->ttvn, ntohs(batman_ogm_packet->tt_crc), batman_ogm_packet->header.ttl, batman_ogm_packet->header.version, @@ -413,7 +413,6 @@ static void dump_batman_iv_ogm(unsigned char *packet_buff, ssize_t buff_len, int (batman_ogm_packet->flags & BATADV_DIRECTLINK ? 'D' : '.'), (batman_ogm_packet->flags & BATADV_VIS_SERVER ? 'V' : '.'), (batman_ogm_packet->flags & BATADV_PRIMARIES_FIRST_HOP ? 'F' : '.'), - (batman_ogm_packet->gw_flags ? 'G' : '.'), (size_t)buff_len - sizeof(struct ether_header)); }