udpipencaps.hh

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

HH
67
字号
#ifndef CLICK_UDPIPENCAPS_HH#define CLICK_UDPIPENCAPS_HH#include <click/element.hh>#include <click/glue.hh>#include <click/atomic.hh>#include <clicknet/udp.h>CLICK_DECLS/* * =c * UDPIPEncap(SADDR, SPORT, DADDR, DPORT [, CHECKSUM?]) * =s encapsulation, UDP * encapsulates packets in static UDP/IP headers * =d * Encapsulates each incoming packet in a UDP/IP packet with source address * SADDR, source port SPORT, destination address DADDR, and destination port * DPORT. The UDP checksum is calculated if CHECKSUM? is true; it is true by * default. * * The UDPIPEncap element adds both a UDP header and an IP header. * * The Strip element can be used by the receiver to get rid of the * encapsulation header. * =e *   UDPIPEncap(1.0.0.1, 1234, 2.0.0.2, 1234) * =a Strip, IPEncap */class UDPFlow { public:  IPAddress _src;  IPAddress _dst;  unsigned _sport;  unsigned _dport;};class UDPIPEncaps : public Element { public:  UDPIPEncaps();  ~UDPIPEncaps();    const char *class_name() const	{ return "UDPIPEncaps"; }  const char *processing() const	{ return AGNOSTIC; }    int configure(Vector<String> &, ErrorHandler *);  bool can_live_reconfigure() const     { return true; }  void add_handlers();  static int add_flow(const String &arg, Element *e, void *, ErrorHandler *errh);  Packet *simple_action(Packet *);  typedef Vector<UDPFlow*> Flows;  Flows _flows;  int _nflows;  int _flowidx;  private:  bool _cksum : 1;#if HAVE_FAST_CHECKSUM && FAST_CHECKSUM_ALIGNED  bool _aligned : 1;#endif  atomic_uint32_t _id;};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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