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

📄 path.hh

📁 Click is a modular router toolkit. To use it you ll need to know how to compile and install the sof
💻 HH
字号:
#ifndef CLICK_PATH_HH#define CLICK_PATH_HH#include <click/straccum.hh>#include <click/hashcode.hh>CLICK_DECLStypedef Vector<IPAddress> Path;template <>inline hashcode_t hashcode(const Path &p){    hashcode_t h = 0;    for (int x = 0; x < p.size(); x++)	h ^= CLICK_NAME(hashcode)(p[x]);    return h;}inline booloperator==(const Path &p1, const Path &p2){  if (p1.size() != p2.size()) {    return false;  }  for (int x = 0; x < p1.size(); x++) {    if (p1[x] != p2[x]) {      return false;    }  }  return true;}inline booloperator!=(const Path &p1, const Path &p2){  return (!(p1 == p2));}inline String path_to_string(const Path &p){  StringAccum sa;  for(int x = 0; x < p.size(); x++) {    sa << p[x].unparse();    if (x != p.size() - 1) {      sa << " ";    }  }  return sa.take_string();}inline Path reverse_path (const Path &p){  Path rev;  for (int x = p.size() - 1; x >= 0; x--) {    rev.push_back(p[x]);  }  return rev;}inline int index_of(Path p, IPAddress ip) {  for (int x = 0;  x < p.size(); x++) {    if (p[x] == ip) {      return x;    }  }  return -1;}CLICK_ENDDECLS#endif /* CLICK_PATH_HH */

⌨️ 快捷键说明

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