The following commit has been merged in the next branch: commit cc5ae885b6910fe38a92863b46bf5c715f3447eb Merge: 340fc4b9bbf0b6168b3254e3a399ab070a29e999 ea3699d183fa47c3229125fc2fa150614bbfb013 Author: Marek Lindner lindner_marek@yahoo.de Date: Tue May 22 12:46:39 2012 +0800
Merge branch 'next'
diff --combined packet.h index 44eed60,0ee1af7..c90219c --- a/packet.h +++ b/packet.h @@@ -1,4 -1,5 +1,4 @@@ -/* - * Copyright (C) 2007-2012 B.A.T.M.A.N. contributors: +/* Copyright (C) 2007-2012 B.A.T.M.A.N. contributors: * * Marek Lindner, Simon Wunderlich * @@@ -15,6 -16,7 +15,6 @@@ * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA - * */
#ifndef _NET_BATMAN_ADV_PACKET_H_ @@@ -23,22 -25,14 +23,14 @@@ #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_UNICAST_4ADDR = 0x09 - }; - - enum bat_subtype { - BAT_P_DATA = 0x01, - BAT_P_DAT_DHT_GET = 0x02, - BAT_P_DAT_DHT_PUT = 0x03, - BAT_P_DAT_CACHE_REPLY = 0x04 + 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 };
/* this file is included by batctl which needs these defines */ @@@ -87,8 -81,7 +79,8 @@@ enum tt_query_flags
/* TT_CLIENT flags. * Flags from 1 to 1 << 7 are sent on the wire, while flags from 1 << 8 to - * 1 << 15 are used for local computation only */ + * 1 << 15 are used for local computation only + */ enum tt_client_flags { TT_CLIENT_DEL = 1 << 0, TT_CLIENT_ROAM = 1 << 1, @@@ -112,7 -105,7 +104,7 @@@ enum bla_claimframe struct bla_claim_dst { uint8_t magic[3]; /* FF:43:05 */ uint8_t type; /* bla_claimframe */ - uint16_t group; /* group id */ + __be16 group; /* group id */ } __packed;
struct batman_header { @@@ -124,14 -117,14 +116,14 @@@ struct batman_ogm_packet { struct batman_header header; uint8_t flags; /* 0x40: DIRECTLINK flag, 0x20 VIS_SERVER flag... */ - uint32_t seqno; + __be32 seqno; uint8_t orig[ETH_ALEN]; uint8_t prev_sender[ETH_ALEN]; uint8_t gw_flags; /* flags related to gateway class */ uint8_t tq; uint8_t tt_num_changes; uint8_t ttvn; /* translation table version number */ - uint16_t tt_crc; + __be16 tt_crc; } __packed;
#define BATMAN_OGM_HLEN sizeof(struct batman_ogm_packet) @@@ -141,7 -134,7 +133,7 @@@ struct icmp_packet uint8_t msg_type; /* see ICMP message types above */ uint8_t dst[ETH_ALEN]; uint8_t orig[ETH_ALEN]; - uint16_t seqno; + __be16 seqno; uint8_t uid; uint8_t reserved; } __packed; @@@ -149,14 -142,13 +141,14 @@@ #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 */ + * as this is assumed by code that handles ICMP packets + */ struct icmp_packet_rr { struct batman_header header; uint8_t msg_type; /* see ICMP message types above */ uint8_t dst[ETH_ALEN]; uint8_t orig[ETH_ALEN]; - uint16_t seqno; + __be16 seqno; uint8_t uid; uint8_t rr_cur; uint8_t rr[BAT_RR_LEN][ETH_ALEN]; @@@ -168,12 -160,6 +160,6 @@@ 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 */ @@@ -181,20 -167,20 +167,20 @@@ uint8_t flags; uint8_t align; uint8_t orig[ETH_ALEN]; - uint16_t seqno; + __be16 seqno; } __packed;
struct bcast_packet { struct batman_header header; uint8_t reserved; - uint32_t seqno; + __be32 seqno; uint8_t orig[ETH_ALEN]; } __packed;
struct vis_packet { struct batman_header header; uint8_t vis_type; /* which type of vis-participant sent this? */ - uint32_t seqno; /* sequence number */ + __be32 seqno; /* sequence number */ uint8_t entries; /* number of entries behind this struct */ uint8_t reserved; uint8_t vis_orig[ETH_ALEN]; /* originator reporting its neighbors */ @@@ -206,8 -192,7 +192,8 @@@ struct tt_query_packet struct batman_header header; /* the flag field is a combination of: * - TT_REQUEST or TT_RESPONSE - * - TT_FULL_TABLE */ + * - TT_FULL_TABLE + */ uint8_t flags; uint8_t dst[ETH_ALEN]; uint8_t src[ETH_ALEN]; @@@ -215,15 -200,13 +201,15 @@@ * if TT_REQUEST: ttvn that triggered the * request * if TT_RESPONSE: new ttvn for the src - * orig_node */ + * orig_node + */ uint8_t ttvn; /* tt_data field is: * if TT_REQUEST: crc associated with the * ttvn - * if TT_RESPONSE: table_size */ - uint16_t tt_data; + * if TT_RESPONSE: table_size + */ + __be16 tt_data; } __packed;
struct roam_adv_packet {