This is automatically generated documentation. Edit after the "COMMENTS" heading; changes to the main body will be lost.
FromHost -- Click element; reads packets from Linux
FromHost(DEVNAME [, PREFIX, KEYWORDS])
Ports: no inputs, 1-2 outputs
Processing: push
Drivers: linuxmodule
Package: linuxmodule (core)
Captures packets orginating from the Linux kernel and pushes them on output 0. The type of packet depends on the TYPE keyword argument. For TYPE ETHER, output packets have Ethernet headers; only the protocol field is interesting. For TYPE IP, output packets are IP packets. TYPE ETHER is the default, although TYPE IP is probably more useful. Installs a fake interface called DEVNAME. If PREFIX is given, changes the routing table so that every packet destined for PREFIX = ADDR/MASK is sent through that interface. The packet then leaves on output 0. The device's native address is ADDR. After the fake device is created, the effect of bringing up the interface and changing the routing table is analogous to:
% /sbin/ifconfig DEVNAME up % /sbin/route add -net ADDR netmask MASK DEVNAME
This element is only available in the Linux kernel module. Keyword arguments are:
ETHER and IP. Currently defaults to ETHER with a warning.If TYPE is IP, FromHost will set the packet's IP header and destination IP address annotations. Packets with bad IP version or header length are dropped or emitted on output 1 if it exists. Note that FromHost doesn't check IP checksums or full packet lengths. If TYPE is ETHER, Linux will send ARP queries to the fake device. You must respond to these queries in order to receive any IP packets, but you can obviously respond with any Ethernet address you'd like. Here is one common idiom:
FromHost(fake0, 192.0.0.1/8, TYPE ETHER)
-> fromhost_cl :: Classifier(12/0806, 12/0800);
fromhost_cl[0] -> ARPResponder(0.0.0.0/0 1-1-1-1-1-1) -> ToHost;
fromhost_cl[1] -> ... // IP packets
FromHost(fake0, 192.0.0.1/8) -> ...;
ToHost, FromDevice, PollDevice, ToDevice
Generated by 'click-elem2man' from '../elements/linuxmodule/fromhost.hh' on 7/Mar/2009.