arpfaker.hh

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

HH
66
字号
#ifndef CLICK_ARPFAKER_HH#define CLICK_ARPFAKER_HH#include <click/element.hh>#include <click/timer.hh>#include <click/etheraddress.hh>#include <click/ipaddress.hh>#include <click/hashmap.hh>CLICK_DECLS/* * =c * ARPFaker(IP1, ETH1, IP2, ETH2) * =s Ethernet, sources * periodically generates an ARP reply * =d * Every 10 seconds, * sends an ARP "reply" packet to IP1/ETH1 claiming that IP2 has ethernet * address ETH2. Generates the ethernet header as well as the * ARP header. *  * =e * Sends ARP packets to 18.26.4.1 (with ether addr 0:e0:2b:b:1a:0) * claiming that 18.26.4.99's ethernet address is 00:a0:c9:9c:fd:9c. * *   ARPFaker(18.26.4.1, 0:e0:2b:b:1a:0, 18.26.4.99, 00:a0:c9:9c:fd:9c) *      -> ToDevice(eth0); *  * =n * You probably want to use ARPResponder rather than ARPFaker. * * =a * ARPQuerier, ARPResponder */class ARPFaker : public Element {  public:    ARPFaker();  ~ARPFaker();    const char *class_name() const		{ return "ARPFaker"; }  const char *processing() const		{ return PUSH; }    int configure(Vector<String> &, ErrorHandler *);  int initialize(ErrorHandler *);    Packet *make_response(unsigned char tha[6], unsigned char tpa[4],                        unsigned char sha[6], unsigned char spa[4]);    void run_timer();  private:    IPAddress _ip1;  EtherAddress _eth1;  IPAddress _ip2;  EtherAddress _eth2;  Timer _timer;  };CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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