if_ether.h revision 5d54f3d8999eac1762fe0a8c7177d20f1f201fae
/*
* Copyright (c) 1982, 1986 Regents of the University of California.
* All rights reserved.
*
* Redistribution and use in source and binary forms are permitted
* provided that this notice is preserved and that due credit is given
* to the University of California at Berkeley. The name of the University
* may not be used to endorse or promote products derived from this
* software without specific prior written permission. This software
* is provided ``as is'' without express or implied warranty.
*/
#ifndef _netinet_if_ether_h
#define _netinet_if_ether_h
#pragma ident "%Z%%M% %I% %E% SMI"
/*
* The following include is for compatibility with SunOS 3.x and
* 4.3bsd. Newly written programs should include it separately.
*/
/*
* Ethernet address - 6 octets
*/
struct ether_addr {
};
/*
* Structure of a 10Mb/s Ethernet header.
*/
struct ether_header {
struct ether_addr ether_dhost;
struct ether_addr ether_shost;
};
/*
* The ETHERTYPE_NTRAILER packet types starting at ETHERTYPE_TRAIL have
* (type-ETHERTYPE_TRAIL)*512 bytes of data followed
* by an ETHER type (as given above) and then the (variable-length) header.
*/
#define ETHERTYPE_NTRAILER 16
#define ETHERMTU 1500
/*
* Ethernet Address Resolution Protocol.
*
* See RFC 826 for protocol description. Structure below is adapted
* to resolving internet addresses. Field names used correspond to
* RFC 826.
*/
struct ether_arp {
};
/*
* multicast address structure
*
* Keep a reference count for each multicast address so
* addresses loaded into chip are unique.
*/
struct mcaddr {
};
/*
* Structure shared between the ethernet driver modules and
* the address resolution code. For example, each ec_softc or il_softc
* begins with this structure.
*
* The structure contains a pointer to an array of multicast addresses.
* This pointer is NULL until the first successful SIOCADDMULTI ioctl
* is issued for the interface.
*/
struct arpcom {
};
/*
* Internet to ethernet address resolution table.
*/
struct arptab {
union {
long atu_tvsec; /* timestamp if incomplete */
} at_union;
};
/*
* Compare two Ethernet addresses - assumes that the two given
* pointers can be referenced as shorts. On architectures
* where this is not the case, use bcmp instead. Note that like
* bcmp, we return zero if they are the SAME.
*/
((short *)b)[1] != ((short *)a)[1] || ((short *)b)[0] != ((short *)a)[0] )
/*
* Copy Ethernet addresses from a to b - assumes that the two given
* pointers can be referenced as shorts. On architectures
* where this is not the case, use bcopy instead.
*/
#define ether_copy(a,b) { ((short *)b)[0]=((short *)a)[0]; \
((short *)b)[1]=((short *)a)[1]; ((short *)b)[2]=((short *)a)[2]; }
/*
* Copy IP addresses from a to b - assumes that the two given
* pointers can be referenced as shorts. On architectures
* where this is not the case, use bcopy instead.
*/
#define ip_copy(a,b) { ((short *)b)[0]=((short *)a)[0]; \
((short *)b)[1]=((short *)a)[1]; }
#endif /* !_netinet_if_ether_h */