X-Git-Url: https://tinc-vpn.org/git/browse?p=tinc;a=blobdiff_plain;f=lib%2Fethernet.h;h=8bf2b03e52eb704c4ba1407202c50a810b98fbf2;hp=697aa44661444b3e6ce408fd90f6520a77b8bc19;hb=aa9d61b5cd0d6dd8b911cfd06f6bb50ec028d0d1;hpb=77cb10dac0abbfa4389a7588f51797152d91ac22 diff --git a/lib/ethernet.h b/lib/ethernet.h index 697aa446..8bf2b03e 100644 --- a/lib/ethernet.h +++ b/lib/ethernet.h @@ -1,7 +1,7 @@ /* ethernet.h -- missing Ethernet related definitions - Copyright (C) 2003 Ivo Timmermans - 2003 Guus Sliepen + Copyright (C) 2005 Ivo Timmermans + 2006 Guus Sliepen This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by @@ -13,11 +13,9 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. - You should have received a copy of the GNU General Public License - 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 $ + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., + 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ #ifndef __TINC_ETHERNET_H__ @@ -43,14 +41,26 @@ #define ETH_P_IPV6 0x86DD #endif +#ifndef ETH_P_8021Q +#define ETH_P_8021Q 0x8100 +#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 +78,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