--- batman-adv_master.packet.h 2013-05-29 00:15:01.024626631 +0200 +++ batctl_master.packet.h 2013-05-29 00:15:01.032626668 +0200 @@ -186,47 +186,29 @@
#define BATADV_OGM_HLEN sizeof(struct batadv_ogm_packet)
-/** - * batadc_icmp_header - common ICMP header - * @header: common batman header - * @msg_type: ICMP packet type - * @dst: address of the destination node - * @orig: address of the source node - * @uid: local ICMP socket identifier - */ -struct batadv_icmp_header { +struct batadv_icmp_packet { struct batadv_header header; uint8_t msg_type; /* see ICMP message types above */ uint8_t dst[ETH_ALEN]; uint8_t orig[ETH_ALEN]; + __be16 seqno; uint8_t uid; -}; - -/** - * batadv_icmp_packet - ICMP packet - * @icmph: common ICMP header - * @reserved: not used - useful for alignment - * @seqno: ICMP sequence number - */ -struct batadv_icmp_packet { - struct batadv_icmp_header icmph; uint8_t reserved; - __be16 seqno; };
#define BATADV_RR_LEN 16
-/** - * batadv_icmp_packet_rr - ICMP RouteRecord packet - * @icmph: common ICMP header - * @rr_cur: number of entries the rr array - * @seqno: ICMP sequence number - * @rr: route record array +/* icmp_packet_rr must start with all fields from imcp_packet + * as this is assumed by code that handles ICMP packets */ struct batadv_icmp_packet_rr { - struct batadv_icmp_header icmph; - uint8_t rr_cur; + struct batadv_header header; + uint8_t msg_type; /* see ICMP message types above */ + uint8_t dst[ETH_ALEN]; + uint8_t orig[ETH_ALEN]; __be16 seqno; + uint8_t uid; + uint8_t rr_cur; uint8_t rr[BATADV_RR_LEN][ETH_ALEN]; };
@@ -345,27 +327,53 @@ * @src: address of the source * @dst: address of the destination * @tvlv_len: length of tvlv data following the unicast tvlv header - * @align: 2 bytes to align the header to a 4 byte boundry */ struct batadv_unicast_tvlv_packet { struct batadv_header header; - uint8_t reserved; - uint8_t dst[ETH_ALEN]; - uint8_t src[ETH_ALEN]; - __be16 tvlv_len; - uint16_t align; + uint8_t reserved; + uint8_t dst[ETH_ALEN]; + uint8_t src[ETH_ALEN]; + __be16 tvlv_len; };
/** * struct batadv_tvlv_hdr - base tvlv header struct + * @long_tvlv: flag indicating whether this is a short tvlv container (max 256 + * bytes) or a long tvlv one (up to ETH_DATA_LEN) * @type: tvlv container type (see batadv_tvlv_type) * @version: tvlv container version - * @len: tvlv container length */ struct batadv_tvlv_hdr { - uint8_t type; +#if defined(__BIG_ENDIAN_BITFIELD) + uint8_t long_tvlv:1; + uint8_t type:7; +#elif defined(__LITTLE_ENDIAN_BITFIELD) + uint8_t type:7; + uint8_t long_tvlv:1; +#else +#error "unknown bitfield endianess" +#endif uint8_t version; - __be16 len; +}; + +/** + * struct batadv_tvlv_short - short tvlv header struct + * @tvlv_hdr: base tvlv header + * @len: tvlv container length (limited to 255 bytes) + */ +struct batadv_tvlv_short { + struct batadv_tvlv_hdr tvlv_hdr; + uint8_t len; +}; + +/** + * struct batadv_tvlv_long - long tvlv header struct + * @tvlv_hdr: base tvlv header + * @len: tvlv container length + */ +struct batadv_tvlv_long { + struct batadv_tvlv_hdr tvlv_hdr; + __be16 len; };
/** @@ -380,16 +388,14 @@ };
/** - * struct batadv_tvlv_tt_data - tt data propagated through the tt tvlv container + * struct tvlv_tt_data - tt data propagated through the tt tvlv container * @flags: translation table flags (see batadv_tt_data_flags) * @ttvn: translation table version number - * @reserved: field reserved for future use * @crc: crc32 checksum of the local translation table */ struct batadv_tvlv_tt_data { uint8_t flags; uint8_t ttvn; - uint16_t reserved; __be32 crc; };
@@ -409,11 +415,9 @@ /** * struct batadv_tvlv_roam_adv - roaming advertisement * @client: mac address of roaming client - * @reserved: field reserved for future use */ struct batadv_tvlv_roam_adv { - uint8_t client[ETH_ALEN]; - uint16_t reserved; + uint8_t client[ETH_ALEN]; };
#endif /* _NET_BATMAN_ADV_PACKET_H_ */
linux-merge@lists.open-mesh.org