Update missing definitions, structs describing headers get __packed__ attribute.

This commit is contained in:
Guus Sliepen 2003-10-08 11:34:55 +00:00
parent 5b556c0971
commit 1d7706a850
4 changed files with 28 additions and 20 deletions

View file

@ -17,7 +17,7 @@
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
$Id: ethernet.h,v 1.1.2.4 2003/10/06 14:16:51 guus Exp $
$Id: ethernet.h,v 1.1.2.5 2003/10/08 11:34:55 guus Exp $
*/
#ifndef __TINC_ETHERNET_H__
@ -43,14 +43,22 @@
#define ETH_P_IPV6 0x86DD
#endif
#ifndef HAVE_STRUCT_ETHER_HEADER
struct ether_header {
uint8_t ether_dhost[ETH_ALEN];
uint8_t ether_shost[ETH_ALEN];
uint16_t ether_type;
} __attribute__ ((__packed__));
#endif
#ifndef HAVE_STRUCT_ARPHDR
struct arphdr {
unsigned short int ar_hrd;
unsigned short int ar_pro;
unsigned char ar_hln;
unsigned char ar_pln;
unsigned short int ar_op;
};
uint16_t ar_hrd;
uint16_t ar_pro;
uint8_t ar_hln;
uint8_t ar_pln;
uint16_t ar_op;
} __attribute__ ((__packed__));
#define ARPOP_REQUEST 1
#define ARPOP_REPLY 2
@ -68,7 +76,7 @@ struct ether_arp {
uint8_t arp_spa[4];
uint8_t arp_tha[ETH_ALEN];
uint8_t arp_tpa[4];
};
} __attribute__ ((__packed__));
#define arp_hrd ea_hdr.ar_hrd
#define arp_pro ea_hdr.ar_pro
#define arp_hln ea_hdr.ar_hln