1 .\" $FreeBSD: src/share/man/man4/tap.4,v 1.1.2.7 2002/04/16 23:59:28 trhodes Exp $
2 .\" $DragonFly: src/share/man/man4/tap.4,v 1.6 2006/10/14 23:46:23 swildner Exp $
10 .Nd Ethernet tunnel software network interface
16 interface is a software loopback mechanism that can be loosely
17 described as the network interface analog of the
21 does for network interfaces what the
23 driver does for terminals.
29 driver, provides two interfaces: an interface like the usual facility
31 (an Ethernet network interface in the case of
35 and a character-special device
39 The network interfaces are named
42 etc, as many as were made by
44 Each one supports the usual Ethernet network-interface
50 and thus can be used with
52 like any other Ethernet interface. When the system chooses to transmit
53 an Ethernet frame on the network interface, the frame can be read from
58 writing an Ethernet frame to the control device generates an input frame on
59 the network interface, as if the
61 hardware had just received it.
63 The Ethernet tunnel device, normally
64 .Pa /dev/tap Ns Sy N ,
66 (it cannot be opened if it is already open)
67 and is restricted to the super-user.
70 call will return an error
72 if the interface is not
74 Once the interface is ready,
76 will return an Ethernet frame if one is available; if not, it will
77 either block until one is or return
79 depending on whether non-blocking I/O has been enabled. If the frame
80 is longer than is allowed for in the buffer passed to
82 the extra data will be silently dropped.
86 call passes an Ethernet frame in to be
88 on the pseudo-interface. Each
90 call supplies exactly one frame; the frame length is taken from the
91 amount of data provided to
93 Writes will not block; if the frame cannot be accepted
94 for a transient reason
95 (e.g., no buffer space available),
96 it is silently dropped; if the reason is not transient
97 (e.g., frame too large),
103 .In net/tap/if_tap.h ) :
104 .Bl -tag -width ".Dv VMIO_SIOCSETMACADDR"
106 The argument should be a pointer to an
108 this sets the internal debugging variable to that value. What, if
109 anything, this variable controls is not documented here; see the source
112 The argument should be a pointer to an
114 this stores the internal debugging variable's value into it.
116 Turn non-blocking I/O for reads off or on, according as the argument
118 value is or isn't zero
119 (Writes are always nonblocking).
121 Turn asynchronous I/O for reads
124 when data is available to be read)
125 off or on, according as the argument
127 value is or isn't zero.
129 If any frames are queued to be read, store the size of the first one into the argument
131 otherwise, store zero.
133 Set the process group to receive
135 signals, when asynchronous I/O is enabled, to the argument
139 Retrieve the process group value for
141 signals into the argument
145 Retrieve the Media Access Control
149 side. This command is used by the VMware port and expected to be executed on
150 descriptor, associated with control device
152 .Pa /dev/vmnet Ns Sy N
154 .Pa /dev/tap Ns Sy N ) .
157 which is passed as the argument, is expected to have enough space to store
160 address. At the open time both
165 addresses are the same, so this command could be used to retrieve the
170 Set the Media Access Control
174 side. This command is used by VMware port and expected to be executed on
175 a descriptor, associated with control device
177 .Pa /dev/vmnet Ns Sy N ) .
180 The control device also supports
182 for read; selecting for write is pointless, and always succeeds, since
183 writes are always non-blocking.
185 On the last close of the data device, the interface is
188 .Dq ifconfig tap Ns Sy N No down )
189 unless the devices is a
192 All queued frames are thrown away. If the interface is up when the data
193 device is not open, output frames are thrown away rather than
194 letting them pile up.
198 device is also can be used with the
200 port as a replacement
203 device driver. The driver uses the minor number
210 minor numbers begin at
218 unit number. In this case control device is expected to be
219 .Pa /dev/vmnet Ns Sy N ,
220 and network interface will be
226 themselves down when the
227 control device is closed. Everything else is the same.
229 In addition to the above mentioned,
231 calls, there is one additional one for the VMware port.
232 .Bl -tag -width ".Dv VMIO_SIOCSETMACADDR"
233 .It Dv VMIO_SIOCSIFFLAGS