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

📄 filtertx.cc

📁 Click is a modular router toolkit. To use it you ll need to know how to compile and install the sof
💻 CC
字号:
#include <click/config.h>#include <click/error.hh>#include <click/confparse.hh>#include <click/standard/scheduleinfo.hh>#include <clicknet/wifi.h>#include <click/straccum.hh>#include <click/packet_anno.hh>#include "filtertx.hh"CLICK_DECLSFilterTX::FilterTX()  : _drops(0){}FilterTX::~FilterTX(){}Packet *FilterTX::simple_action(Packet *p){    struct click_wifi_extra *ceha = WIFI_EXTRA_ANNO(p);    struct click_wifi_extra *cehp = (struct click_wifi_extra *) p->data();  if ((ceha->magic == WIFI_EXTRA_MAGIC && ceha->flags & WIFI_EXTRA_TX) ||      (cehp->magic == WIFI_EXTRA_MAGIC && cehp->flags & WIFI_EXTRA_TX)) {    if (noutputs() == 2) {      output(1).push(p);    } else {      p->kill();    }    return 0;  }  return p;}enum {H_DROPS };static StringFilterTX_read_param(Element *e, void *thunk){  FilterTX *td = (FilterTX *)e;  switch ((uintptr_t) thunk) {  case H_DROPS:    return String(td->_drops) + "\n";  default:    return String();  }}voidFilterTX::add_handlers(){  add_read_handler("drops", FilterTX_read_param, (void *) H_DROPS);}CLICK_ENDDECLSEXPORT_ELEMENT(FilterTX)

⌨️ 快捷键说明

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