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., one for each control device that has been opened.
42 These Ethernet network interfaces persist until
44 module is unloaded (if
46 is built into your kernel, the network interfaces cannot be removed).
51 permits opens on the special control device
53 When this device is opened,
55 will return a handle for the lowest unused
60 Control devices (once successfully opened) persist until
62 is unloaded in the same way that network interfaces persist (see above).
64 Each interface supports the usual Ethernet network interface
70 and thus can be used with
72 like any other Ethernet interface.
73 When the system chooses to transmit
74 an Ethernet frame on the network interface, the frame can be read from
79 writing an Ethernet frame to the control device generates an input frame on
80 the network interface, as if the
82 hardware had just received it.
84 The Ethernet tunnel device, normally
85 .Pa /dev/tap Ns Sy N ,
87 (it cannot be opened if it is already open)
88 and is restricted to the super-user, unless the
91 .Va net.link.tap.user_open
95 call will return an error
97 if the interface is not
99 Once the interface is ready,
101 will return an Ethernet frame if one is available; if not, it will
102 either block until one is or return
104 depending on whether non-blocking I/O has been enabled.
106 is longer than is allowed for in the buffer passed to
108 the extra data will be silently dropped.
112 call passes an Ethernet frame in to be
114 on the pseudo-interface.
117 call supplies exactly one frame; the frame length is taken from the
118 amount of data provided to
120 Writes will not block; if the frame cannot be accepted
121 for a transient reason
122 (e.g., no buffer space available),
123 it is silently dropped; if the reason is not transient
124 (e.g., frame too large),
125 an error is returned.
131 .Bl -tag -width VMIO_SIOCSETMACADDR
133 The argument should be a pointer to an
135 this sets the internal debugging variable to that value.
137 anything, this variable controls is not documented here; see the source
140 The argument should be a pointer to an
142 this stores the internal debugging variable's value into it.
144 Turn non-blocking I/O for reads off or on, according as the argument
146 value is or is not zero
147 (Writes are always nonblocking).
149 Turn asynchronous I/O for reads
152 when data is available to be read)
153 off or on, according as the argument
155 value is or is not zero.
157 If any frames are queued to be read, store the size of the first one into the argument
159 otherwise, store zero.
161 Set the process group to receive
163 signals, when asynchronous I/O is enabled, to the argument
167 Retrieve the process group value for
169 signals into the argument
173 Retrieve the Media Access Control
178 This command is used by the VMware port and expected to be executed on
179 descriptor, associated with control device
181 .Pa /dev/vmnet Ns Sy N
183 .Pa /dev/tap Ns Sy N ) .
186 which is passed as the argument, is expected to have enough space to store
190 At the open time both
195 addresses are the same, so this command could be used to retrieve the
200 Set the Media Access Control
205 This command is used by VMware port and expected to be executed on
206 a descriptor, associated with control device
208 .Pa /dev/vmnet Ns Sy N ) .
211 The control device also supports
213 for read; selecting for write is pointless, and always succeeds, since
214 writes are always non-blocking.
216 On the last close of the data device, the interface is
219 .Dq ifconfig tap Ns Sy N No down )
220 unless the device is a
223 All queued frames are thrown away.
224 If the interface is up when the data
225 device is not open, output frames are thrown away rather than
226 letting them pile up.
230 device can also be used with the VMware port as a replacement
234 The driver uses the minor number
241 minor numbers begin at
250 In this case the control device is expected to be
251 .Pa /dev/vmnet Ns Sy N ,
252 and the network interface will be
258 themselves down when the
259 control device is closed.
260 Everything else is the same.
262 In addition to the above mentioned
264 calls, there is an additional one for the VMware port.
265 .Bl -tag -width VMIO_SIOCSETMACADDR
266 .It Dv VMIO_SIOCSIFFLAGS