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, as many as were made by
43 Each one supports the usual Ethernet network-interface
49 and thus can be used with
51 like any other Ethernet interface. When the system chooses to transmit
52 an Ethernet frame on the network interface, the frame can be read from
57 writing an Ethernet frame to the control device generates an input frame on
58 the network interface, as if the
60 hardware had just received it.
62 The Ethernet tunnel device, normally
63 .Pa /dev/tap Ns Sy N ,
65 (it cannot be opened if it is already open)
66 and is restricted to the super-user.
69 call will return an error
71 if the interface is not
73 Once the interface is ready,
75 will return an Ethernet frame if one is available; if not, it will
76 either block until one is or return
78 depending on whether non-blocking I/O has been enabled. If the frame
79 is longer than is allowed for in the buffer passed to
81 the extra data will be silently dropped.
85 call passes an Ethernet frame in to be
87 on the pseudo-interface. Each
89 call supplies exactly one frame; the frame length is taken from the
90 amount of data provided to
92 Writes will not block; if the frame cannot be accepted
93 for a transient reason
94 (e.g., no buffer space available),
95 it is silently dropped; if the reason is not transient
96 (e.g., frame too large),
102 .Aq Pa net/if_tap.h ) :
103 .Bl -tag -width VMIO_SIOCSETMACADDR
105 The argument should be a pointer to an
107 this sets the internal debugging variable to that value. What, if
108 anything, this variable controls is not documented here; see the source
111 The argument should be a pointer to an
113 this stores the internal debugging variable's value into it.
115 Turn non-blocking I/O for reads off or on, according as the argument
117 value is or isn't zero
118 (Writes are always nonblocking).
120 Turn asynchronous I/O for reads
123 when data is available to be read)
124 off or on, according as the argument
126 value is or isn't zero.
128 If any frames are queued to be read, store the size of the first one into the argument
130 otherwise, store zero.
132 Set the process group to receive
134 signals, when asynchronous I/O is enabled, to the argument
138 Retrieve the process group value for
140 signals into the argument
144 Retrieve the Media Access Control
148 side. This command is used by the VMware port and expected to be executed on
149 descriptor, associated with control device
151 .Pa /dev/vmnet Ns Sy N
153 .Pa /dev/tap Ns Sy N ) .
156 which is passed as the argument, is expected to have enough space to store
159 address. At the open time both
164 addresses are the same, so this command could be used to retrieve the
169 Set the Media Access Control
173 side. This command is used by VMware port and expected to be executed on
174 a descriptor, associated with control device
176 .Pa /dev/vmnet Ns Sy N ) .
179 The control device also supports
181 for read; selecting for write is pointless, and always succeeds, since
182 writes are always non-blocking.
184 On the last close of the data device, the interface is
187 .Dq ifconfig tap Ns Sy N No down )
188 unless the devices is a
191 All queued frames are thrown away. If the interface is up when the data
192 device is not open, output frames are thrown away rather than
193 letting them pile up.
197 device is also can be used with the
199 port as a replacement
202 VMnet device driver. The driver uses the minor number
209 minor numbers begin at
217 unit number. In this case control device is expected to be
218 .Pa /dev/vmnet Ns Sy N ,
219 and network interface will be
225 themselves down when the
226 control device is closed. Everything else is the same.
228 In addition to the above mentioned,
230 calls, there is one additional one for the VMware port.
231 .Bl -tag -width VMIO_SIOCSETMACADDR
232 .It Dv VMIO_SIOCSIFFLAGS