📄 loctable.hh
字号:
#ifndef LOCTAB_HH#define LOCTAB_HH/* * =c * LocationTable(IP LAT LON ERR, ...) * =s Grid * =io * None * =d * * LAT and LON are in decimal degrees (Real). Positive is North and * East, negative is South and West. ERR is the integer error radius, * in meters. A negative rror radius means don't ever believe this * entry. There can be multiple arguments, but each argument's IP * address must be unique. * * * =h loc write * Sets a specified node's location * information, in this format: ``ip lat lon error''. * * =h table read * Returns the whole table, each line of the form ``ip lat lon error'' * * =a * FixDstLoc */#include <click/element.hh>#include "grid.hh"#include <click/bighashmap.hh>CLICK_DECLSclass LocationTable : public Element { public: LocationTable(); ~LocationTable(); const char *class_name() const { return "LocationTable"; } int configure(Vector<String> &, ErrorHandler *); bool can_live_reconfigure() const { return true; } bool get_location(IPAddress ip, grid_location &loc, int &err_radius); void add_handlers(); int read_args(const Vector<String> &conf, ErrorHandler *errh); struct entry { grid_location loc; int err; entry(grid_location l, int e) : loc(l), err(e) { } entry() : err(-1) { } }; typedef HashMap<IPAddress, entry> Table; Table _locs;private:};CLICK_ENDDECLS#endif
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -