This is automatically generated documentation. Edit after the "COMMENTS" heading; changes to the main body will be lost.

ToDevice Element Documentation


ToDevice -- Click element; sends packets to network device (Linux kernel)



Ports: 1 input, no outputs
Processing: pull
Drivers: linuxmodule
Package: linuxmodule (core)


This manual page describes the Linux kernel module version of the ToDevice element. For the user-level element, read the ToDevice.u manual page. Pulls packets from its single input and sends them out the Linux network interface named DEVNAME. DEVNAME may also be an Ethernet address, in which case ToDevice searches for a device with that address. Sends up to BURST packets each time it is scheduled. By default, BURST is 16. For good performance, you should set BURST to be 8 times the number of elements that could generate packets for this device. Packets must have a link header. For Ethernet, ToDevice makes sure every packet is at least 60 bytes long (but see NO_PAD). Keyword arguments are:

Unsigned integer. Same as the BURST argument.
Boolean. If true, then suppress device up/down messages. Default is false.
Integer. The transmit queue to send to. Default is 0.
Allow nonexistent devices. If true, and no device named DEVNAME exists when the router is initialized, then ToDevice will report a warning (rather than an error). Later, while the router is running, if a device named DEVNAME appears, ToDevice will seamlessly begin sending packets to it. Default is false.
Boolean. If true, don't force packets to be at least 60 bytes (the minimum Ethernet packet size). This is useful because some 802.11 cards can send shorter Ethernet format packets. Defaults false.
Write handler. If supplied, this handler is called when the device or link comes up.
Write handler. If supplied, this handler is called when the device or link goes down.


The Linux networking code may also send packets out the device. If the device is in polling mode, Click will try to ensure that Linux eventually sends its packets. Linux may cause the device to be busy when a ToDevice wants to send a packet. Click is not clever enough to re-queue such packets, and discards them. In Linux 2.2, whether or not the device is running in polling mode, ToDevice depends on the device driver's send operation for synchronization (e.g. tulip send operation uses a bit lock). In Linux 2.4, we use the device's "xmit_lock" to synchronize. Packets sent via ToDevice will not be received by any packet sniffers on the machine. Use Tee and ToHostSniffers to send packets to sniffers explicitly.


count (read-only)
Returns the number of packets ToDevice has pulled.
calls (read-only)
Returns a summary of ToDevice statistics.
drops (read-only)
Returns the number of packets ToDevice has dropped. ToDevice will drop packets because they are too short for the device, or because the device explicitly rejected them.
reset_counts (write-only)
Resets counters to zero when written.


FromDevice, PollDevice, FromHost, ToHost, ToDevice.u, Tee, ToHostSniffers

Generated by 'click-elem2man' from '../elements/linuxmodule/todevice.hh' on 28/Feb/2010.


elements/todevice.txt · Last modified: 2010/02/28 13:58 (external edit)
Recent changes RSS feed Driven by DokuWiki