Warning: Attempt to read property "date" on null in /usr/local/www/websvn.planix.org/blame.php on line 247

Warning: Attempt to read property "msg" on null in /usr/local/www/websvn.planix.org/blame.php on line 247
WebSVN – planix.SVN – Blame – /os/branches/planix-v0/sys/man/3/ether – Rev 2

Subversion Repositories planix.SVN

Rev

Go to most recent revision | Details | Last modification | View Log | RSS feed

Rev Author Line No. Line
2 - 1
.TH ETHER 3 
2
.SH NAME
3
ether \- Ethernet device
4
.SH SYNOPSIS
5
.nf
6
.B bind -a #l\fIn\fP /net
7
 
8
.BI /net/ether n /clone
9
.BI /net/ether n /addr
10
.BI /net/ether n /ifstats
11
.BI /net/ether n /stats
12
.BI /net/ether n /[0-7]
13
.BI /net/ether n /[0-7]/data
14
.BI /net/ether n /[0-7]/ctl
15
.BI /net/ether n /[0-7]/ifstats
16
.BI /net/ether n /[0-7]/stats
17
.BI /net/ether n /[0-7]/type
18
.fi
19
.SH DESCRIPTION
20
The Ethernet interface,
21
.BI /net/ether n\f1,
22
is a directory
23
containing subdirectories, one for each distinct Ethernet packet type,
24
and
25
.BR clone ,
26
.BR addr ,
27
.BR ifstats ,
28
and
29
.B stats
30
files.
31
.B stats
32
and
33
.B ifstats
34
are the same as in the subdirectories (see below).
35
Reading
36
.B addr
37
returns the MAC address of this interface in hex with no punctuation
38
and no trailing newline.
39
The number
40
.I n
41
(optional in the bind)
42
is the device number of the card, permitting multiple cards to be used on a single machine.
43
.PP
44
Each directory contains files to control the associated connection,
45
receive and send data,
46
and supply statistics.
47
Incoming Ethernet packets are demultiplexed by packet type and passed up
48
the corresponding open connection.
49
Reading from the
50
.B data
51
file reads packets of that type arriving from the network.
52
A read will terminate at packet boundaries.
53
Each write to the
54
.B data
55
file causes a packet to be sent.
56
The Ethernet address of the interface is inserted into
57
the packet header as the source address.
58
.PP
59
A connection is assigned to a packet type by opening its
60
.B ctl
61
file and
62
writing 
63
.B connect
64
.I n
65
where
66
.I n
67
is a decimal integer constant identifying the Ethernet packet type.
68
A type of \-1 enables the connection to receive copies of packets of
69
all types.  A type of \-2 enables the connection to receive copies of
70
the first 64 bytes of packets of all types.
71
If multiple connections are assigned to a given packet type
72
a copy of each packet is passed up each connection.
73
.PP
74
Some interfaces also accept unique options when written to the
75
.I ctl
76
(or
77
.IR clone )
78
file; see the description of
79
.I wavelan
80
in
81
.IR plan9.ini (8).
82
The control messages described in
83
.IR ip (3)
84
under
85
.B "Configuring interfaces"
86
from
87
.L bridge
88
to
89
.L headersonly
90
are understood.
91
The additional control message
92
.L nonblocking
93
makes
94
.I write
95
systems calls to this interface non-blocking iff
96
followed by nothing or a non-zero integer;
97
a following
98
.L 0
99
makes
100
.I writes
101
block on a full output queue.
102
.PP
103
Reading the
104
.B ctl
105
file returns the decimal index of the associated connection, 0 through 7.
106
Reading the
107
.B type
108
file returns the decimal value of the assigned Ethernet packet type.
109
Reading the
110
.B stats
111
file returns status information such as the Ethernet address of the
112
card and general statistics, independent of the interface;
113
.B ifstats
114
contains device-specific data and statistics about the card.
115
.PP
116
An interface normally receives only those packets whose 
117
destination address is that of the interface or is the
118
broadcast address,
119
.BR ff:ff:ff:ff:ff:ff .
120
The interface can be made to receive all packets on the
121
network by writing the string 
122
.B promiscuous
123
to the
124
.B ctl
125
file. 
126
The interface remains promiscuous until the control file is
127
closed.
128
The extra packets are passed up connections only of types \-1
129
and \-2.
130
.SH SOURCE
131
.B /sys/src/9/*/devether.c