📄 setsourceroute.hh
字号:
#ifndef CLICK_SETSOURCEROUTE_HH#define CLICK_SETSOURCEROUTE_HH#include <click/element.hh>#include <click/glue.hh>#include <click/timer.hh>#include <click/ipaddress.hh>#include <click/etheraddress.hh>#include <click/vector.hh>#include <click/hashmap.hh>#include <click/dequeue.hh>#include "path.hh"CLICK_DECLS/*=cSetSourceRoute(IP, SRForwarder element)=s Wifi, Wireless RoutingSet the Source Route for packet's destination inside the source routeheader based on the destination ip annotation. If no source route isfound for a given packet, the unmodified packet is sent to output 1 ifthe output is present.Regular Arguments:=over 8=item IPIPAddress=item SRForwarder Element=back 8=h clear writeRemoves all routes from this element=h routes readPrints routes =h set_route writeWriting "5.0.0.1 5.0.0.2 5.0.0.3" to this element will makeall packets destined for 5.0.0.3 from 5.0.0.1 to use a two-hoproute through 5.0.0.2.=a SRForwarder */class SetSourceRoute : public Element { public: SetSourceRoute(); ~SetSourceRoute(); const char *class_name() const { return "SetSourceRoute"; } const char *processing() const { return AGNOSTIC; } void notify_noutputs(int); int initialize(ErrorHandler *); int configure(Vector<String> &conf, ErrorHandler *errh); Packet *simple_action(Packet *); /* handler stuff */ void add_handlers(); static int static_clear(const String &arg, Element *e, void *, ErrorHandler *errh); void clear(); static int static_set_route(const String &arg, Element *e, void *, ErrorHandler *errh); void set_route(Path p); static String static_print_routes(Element *e, void *); String print_routes();private: typedef HashMap<IPAddress, Path> RouteTable; RouteTable _routes; IPAddress _ip; // My IP address. class SRForwarder *_sr_forwarder;};CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -