tohost.hh

来自「COPE the first practical network coding 」· HH 代码 · 共 72 行

HH
72
字号
// -*- c-basic-offset: 4 -*-#ifndef CLICK_TOHOST_HH#define CLICK_TOHOST_HH#include <click/element.hh>#include <click/ipaddress.hh>#include <click/etheraddress.hh>#include "fromhost.hh"CLICK_DECLS/* * =title ToHost.u * * =c * * ToHost([DEVNAME]) * * =s sinks * * sends packets to Linux via Universal TUN/TAP device. * * =d * * Hands packets to the ordinary Linux protocol stack. * Expects packets with Ethernet headers. *  * You should probably give Linux IP packets addressed to * the local machine (including broadcasts), and a copy * of each ARP reply. * * ToHost requires an initialized FromHost with the same DEVNAME. * * IPv4 packets should have a destination IP address corresponding * to DEVNAME, and a routable source address. Otherwise Linux will silently * drop the packets. * * =h drops read-only * * Reports the number of packets ToHost has dropped because they had a null * device annotation. * * =a * * FromHost.u, FromHost *  */class ToHost : public Element { public:      ToHost();    ~ToHost();      const char *class_name() const	{ return "ToHost"; }    const char *processing() const	{ return PUSH; }    int configure_phase() const		{ return FromHost::CONFIGURE_PHASE_TOHOST; }    int configure(Vector<String> &, ErrorHandler *);    int initialize(ErrorHandler *);    void add_handlers();    void push(int port, Packet *);    String dev_name() { return _dev_name; }  private:    int _fd;    String _dev_name;    };CLICK_ENDDECLS#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?