⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 icmprewriter.hh

📁 Click is a modular router toolkit. To use it you ll need to know how to compile and install the sof
💻 HH
字号:
/* -*- c-basic-offset: 2 -*- */#ifndef CLICK_ICMPREWRITER_HH#define CLICK_ICMPREWRITER_HH#include <click/element.hh>#include <clicknet/udp.h>#include <clicknet/icmp.h>#include "elements/ip/iprw.hh"#include "elements/icmp/icmppingrewriter.hh"CLICK_DECLS/*=cICMPRewriter(MAPS, I<keywords> DST_ANNO)=s natrewrites ICMP packets based on IP rewriter mappings=dRewrites ICMP error packets by changing their source and/or destinationaddresses and some of their payloads. It checks MAPS, a space-separated listof IPRewriter-like elements, to see how to rewrite. This lets source quenches,redirects, TTL-expired messages, and so forth pass through a NAT gateway.ICMP error packets are sent in response to normal IP packets, and include asmall portion of the relevant IP packet data. If the IP packet had been sentthrough IPRewriter, ICMPPingRewriter, or a similar element, then the ICMPpacket will be in response to the rewritten address. ICMPRewriter takes suchICMP error packets and checks a list of IPRewriters for a relevant mapping. Ifa mapping is found, ICMPRewriter will rewrite the ICMP packet so it appearslike a response to the original packet and emit the result on output 0.ICMPRewriter may have one or two outputs. If it has one, then anynon-rewritten ICMP error packets, and any ICMP packets that are not errors,are dropped. If it has two, then these kinds of packets are emitted on output1.Keyword arguments are:=over 8=item DST_ANNOBoolean. If true, then set the destination IP address annotation on passingpackets to the rewritten destination address. Default is true.=back=nICMPRewriter supports the following ICMP types: destination unreachable, timeexceeded, parameter problem, source quench, and redirect.MAPS elements may have element class IPAddrRewriter, IPRewriter, TCPRewriter,ICMPPingRewriter, or other related classes.=aIPAddrRewriter, IPRewriter, ICMPPingRewriter, TCPRewriter */class ICMPRewriter : public Element { public:  ICMPRewriter();  ~ICMPRewriter();  const char *class_name() const	{ return "ICMPRewriter"; }  const char *port_count() const	{ return PORTS_1_1X2; }  const char *processing() const	{ return PROCESSING_A_AH; }  int configure(Vector<String> &, ErrorHandler *);  Packet *simple_action(Packet *); protected:  Vector<IPRw *> _maps;  Vector<ICMPPingRewriter *> _ping_maps;  bool _dst_anno;  void rewrite_packet(WritablePacket *, click_ip *, click_udp *,		      const IPFlowID &, IPRw::Mapping *);  void rewrite_ping_packet(WritablePacket *, click_ip *, click_icmp_echo *,			   const IPFlowID &, ICMPPingRewriter::Mapping *);};CLICK_ENDDECLS#endif

⌨️ 快捷键说明

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