Charles.Forsyth20060303-partialeea662d19 years agoHistory
134 lines · 3.2 KB · Text
RawDownload
.TH ETHER 3.SH NAMEether \- Ethernet device.SH SYNOPSIS.nf.BI "bind -a #l" n " /net" .BI /net/ether n /clone.BI /net/ether n /[0-7].BI /net/ether n /[0-7]/data.BI /net/ether n /[0-7]/ctl.BI /net/ether n /[0-7]/stats.BI /net/ether n /[0-7]/type.BI /net/ether n /[0-7]/ifstats.fi.SH DESCRIPTIONThe Ethernet device.BI #l nserves a three-level directory representing a physical Ethernet interface:AMD LANCE, 3Com 3C509, 3Com 3C905, Intel 82557, and others.If.I nis not given it is taken to be 0..PPThe top level directoryhas a single directory named.BI ether n,where.I nis the interface number, starting from 0,assigned in some platform-dependent way.That directory contains a conversation directory for each of 8 Ethernet packet types,and a.B clonefile..PPOpening the.B clonefile returns a file descriptor open on the.B ctlfile of an unused conversation directory.Reading the.B ctlfile returns a textstring representing the number of theconnection.The connection is controlled by writing textual commands to the associated.B ctlfile:.TP.BI connect " type"Set the.I typeof Ethernet packets received on the connection; the type isexpressedas an integer constant(in hexadecimal if it has a leading.BR 0x ,octal if it has a leading.BR 0 ,and otherwise decimal).For instance, Ethernet packets carrying IP version 4 use type.BR 0x800 .The value.B \-1stands for all types.The value.B \-2causes at most the first 64 bytes of all types of packets to be copiedto the conversation.If several conversations are assigned the same packet type,a copy of the packet is given to each..TP.B promiscuousSet the interface to capture all packets regardless of destination address.An interface normally receives only packets whose destination address is that of the interface or is thebroadcast address,.BR ffffffffffff .The interface remains promiscuous until the control file isclosed.The extra packets are received only by conversations of the same typeas the incoming packet (or of type -1)..TP.BI addmulti " address"Add the given MAC multicast.I addressto the set of multicast addresses accepted by the interface..I Addressis a twelve digit MAC address in hexadecimal..TP.BI remmulti " address"Remove.I addressfrom the set of multicast addresses accepted by the interface..PPIncoming Ethernet packets are demultiplexed by destination address andpacket type and queuedfor reading by the corresponding open connection(s).Each read of the.B datafile returns each packet in turn, including the Ethernet header.A read will terminate at packet boundaries.Each write to the.B datafile causes a packet to be sent.The Ethernet address of the interface is inserted intothe packet header as the source address..PPReading the.B typefile returns the decimal value of the assigned Ethernet packet type..PPReading the.B statsfile returns status information, the valueof counters, the `promiscuous' state,and the Ethernet MAC address of theinterface..PPReading the.B ifstatsfile returns statistics and status information specific to a givenhardware interface..SH SOURCE.B /os/port/devlance.c.br.B /os/port/netif.c.br.B /os/*/devether.c.br.B /os/*/ether*.c.SH SEE ALSO.IR ip (3)