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.
91 call will return an error
93 if the interface is not
95 Once the interface is ready,
97 will return an Ethernet frame if one is available; if not, it will
98 either block until one is or return
100 depending on whether non-blocking I/O has been enabled.
102 is longer than is allowed for in the buffer passed to
104 the extra data will be silently dropped.
108 call passes an Ethernet frame in to be
110 on the pseudo-interface.
113 call supplies exactly one frame; the frame length is taken from the
114 amount of data provided to
116 Writes will not block; if the frame cannot be accepted
117 for a transient reason
118 (e.g., no buffer space available),
119 it is silently dropped; if the reason is not transient
120 (e.g., frame too large),
121 an error is returned.
127 .Bl -tag -width VMIO_SIOCSETMACADDR
129 The argument should be a pointer to an
131 this sets the internal debugging variable to that value.
133 anything, this variable controls is not documented here; see the source
136 The argument should be a pointer to an
138 this stores the internal debugging variable's value into it.
140 Turn non-blocking I/O for reads off or on, according as the argument
142 value is or isn't zero
143 (Writes are always nonblocking).
145 Turn asynchronous I/O for reads
148 when data is available to be read)
149 off or on, according as the argument
151 value is or isn't zero.
153 If any frames are queued to be read, store the size of the first one into the argument
155 otherwise, store zero.
157 Set the process group to receive
159 signals, when asynchronous I/O is enabled, to the argument
163 Retrieve the process group value for
165 signals into the argument
169 Retrieve the Media Access Control
174 This command is used by the VMware port and expected to be executed on
175 descriptor, associated with control device
177 .Pa /dev/vmnet Ns Sy N
179 .Pa /dev/tap Ns Sy N ) .
182 which is passed as the argument, is expected to have enough space to store
186 At the open time both
191 addresses are the same, so this command could be used to retrieve the
196 Set the Media Access Control
201 This command is used by VMware port and expected to be executed on
202 a descriptor, associated with control device
204 .Pa /dev/vmnet Ns Sy N ) .
207 The control device also supports
209 for read; selecting for write is pointless, and always succeeds, since
210 writes are always non-blocking.
212 On the last close of the data device, the interface is
215 .Dq ifconfig tap Ns Sy N No down )
216 unless the device is a
219 All queued frames are thrown away.
220 If the interface is up when the data
221 device is not open, output frames are thrown away rather than
222 letting them pile up.
226 device can also be used with the VMware port as a replacement
230 The driver uses the minor number
237 minor numbers begin at
246 In this case the control device is expected to be
247 .Pa /dev/vmnet Ns Sy N ,
248 and the network interface will be
254 themselves down when the
255 control device is closed.
256 Everything else is the same.
258 In addition to the above mentioned
260 calls, there is an additional one for the VMware port.
261 .Bl -tag -width VMIO_SIOCSETMACADDR
262 .It Dv VMIO_SIOCSIFFLAGS