ETHERNET(4) ETHERNET(4) NAME ethernet - Ethernet interface SYNOPSIS #include <sys/enio.h> #include <sys/ethernet.h> DESCRIPTION There are drivers for several hardware interfaces to Ether- net. All have the same programming interface. There are eight software channels for each hardware device. A channel sends and receives packets for a single Ethernet interface; hence eight protocols may be used independently on the same device. If a channel is open, it may not be opened again. Read and write deal in Ethernet packets, consisting of a header followed by no less than 46 but no more than 1500 bytes of data. The header, defined in <sys/ethernet.h>, is as follows: #define ETHERALEN 6 /* bytes in an ethernet address */ struct etherpup { unsigned char dhost[ETHERALEN]; /* destination address */ unsigned char shost[ETHERALEN]; /* source address */ unsigned short type; /* protocol type */ }; The protocol type is in the network's byte order, most sig- nificant byte first. Read on a channel returns at most one complete packet. If only part of a packet fits in the read buffer, successive reads return the remainder. Write should be given a single complete packet; dhost and type must be filled in. The sys- tem supplies shost. There are a few ioctl calls, defined in <sys/enio.h>: ENIOTYPE The third argument points to a short integer; use that as the protocol type for this channel. ENIOADDR The third argument points to a six-character buffer; copy the hardware address of this interface there. Minor device numbers 0-7 are the eight channels of the first hardware device of a given type; 8-15 are the second device, ETHERNET(4) ETHERNET(4) and so on. File names usually end in two digits, like /dev/il13 for the fourth channel of the second Interlan device. FILES Interlan NI1010A devices DEQNA devices DEBNA devices SEE ALSO internet(3), ipconfig(8) BUGS The DEQNA driver fills in the protocol type field in trans- mitted packets; other drivers don't.