1 .\" $FreeBSD: src/share/man/man4/tap.4,v 1.1.2.7 2002/04/16 23:59:28 trhodes Exp $
9 .Nd Ethernet tunnel software network interface
15 interface is a software loopback mechanism that can be loosely
16 described as the network interface analog of the
20 does for network interfaces what the
22 driver does for terminals.
28 driver, provides two interfaces: an interface like the usual facility
30 (an Ethernet network interface in the case of
34 and a character-special device
38 The network interfaces are named
41 etc, and each one supports the usual Ethernet network-interface
47 and thus can be used with
49 like any other Ethernet interface. When the system chooses to transmit
50 an Ethernet frame on the network interface, the frame can be read from
55 writing an Ethernet frame to the control device generates an input frame on
56 the network interface, as if the
58 hardware had just received it.
60 The Ethernet tunnel device, normally
61 .Pa /dev/tap Ns Sy N ,
63 (it cannot be opened if it is already open)
64 and is restricted to the super-user.
67 call will return an error
69 if the interface is not
71 Once the interface is ready,
73 will return an Ethernet frame if one is available; if not, it will
74 either block until one is or return
76 depending on whether non-blocking I/O has been enabled. If the frame
77 is longer than is allowed for in the buffer passed to
79 the extra data will be silently dropped.
83 call passes an Ethernet frame in to be
85 on the pseudo-interface. Each
87 call supplies exactly one frame; the frame length is taken from the
88 amount of data provided to
90 Writes will not block; if the frame cannot be accepted
91 for a transient reason
92 (e.g., no buffer space available),
93 it is silently dropped; if the reason is not transient
94 (e.g., frame too large),
100 .In net/tap/if_tap.h ) :
101 .Bl -tag -width ".Dv VMIO_SIOCSETMACADDR"
103 The argument should be a pointer to an
105 this sets the internal debugging variable to that value. What, if
106 anything, this variable controls is not documented here; see the source
109 The argument should be a pointer to an
111 this stores the internal debugging variable's value into it.
113 Turn non-blocking I/O for reads off or on, according as the argument
115 value is or isn't zero
116 (Writes are always nonblocking).
118 Turn asynchronous I/O for reads
121 when data is available to be read)
122 off or on, according as the argument
124 value is or isn't zero.
126 If any frames are queued to be read, store the size of the first one into the argument
128 otherwise, store zero.
130 Set the process group to receive
132 signals, when asynchronous I/O is enabled, to the argument
136 Retrieve the process group value for
138 signals into the argument
142 Retrieve the Media Access Control
146 side. This command is used by the VMware port and expected to be executed on
147 descriptor, associated with control device
149 .Pa /dev/vmnet Ns Sy N
151 .Pa /dev/tap Ns Sy N ) .
154 which is passed as the argument, is expected to have enough space to store
157 address. At the open time both
162 addresses are the same, so this command could be used to retrieve the
167 Set the Media Access Control
171 side. This command is used by VMware port and expected to be executed on
172 a descriptor, associated with control device
174 .Pa /dev/vmnet Ns Sy N ) .
177 The control device also supports
179 for read; selecting for write is pointless, and always succeeds, since
180 writes are always non-blocking.
182 On the last close of the data device, the interface is
185 .Dq ifconfig tap Ns Sy N No down )
186 unless the devices is a
189 All queued frames are thrown away. If the interface is up when the data
190 device is not open, output frames are thrown away rather than
191 letting them pile up.
195 device is also can be used with the
197 port as a replacement
200 device driver. The driver uses the minor number
207 minor numbers begin at
215 unit number. In this case control device is expected to be
216 .Pa /dev/vmnet Ns Sy N ,
217 and network interface will be
223 themselves down when the
224 control device is closed. Everything else is the same.
226 In addition to the above mentioned,
228 calls, there is one additional one for the VMware port.
229 .Bl -tag -width ".Dv VMIO_SIOCSETMACADDR"
230 .It Dv VMIO_SIOCSIFFLAGS