亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? fromdagdump.cc

?? Click is a modular router toolkit. To use it you ll need to know how to compile and install the sof
?? CC
字號:
// -*- mode: c++; c-basic-offset: 4 -*-/* * fromdagdump.{cc,hh} -- element reads packets from DAG (Waikato) file * Eddie Kohler * * Copyright (c) 2002 International Computer Science Institute * * Permission is hereby granted, free of charge, to any person obtaining a * copy of this software and associated documentation files (the "Software"), * to deal in the Software without restriction, subject to the conditions * listed in the Click LICENSE file. These conditions include: you must * preserve this copyright notice, and you cannot mention the copyright * holders in advertising related to the Software without their permission. * The Software is provided WITHOUT ANY WARRANTY, EXPRESS OR IMPLIED. This * notice is a summary of the Click LICENSE file; the license in that file is * legally binding. */#include <click/config.h>#include "fromdagdump.hh"#include <click/confparse.hh>#include <click/router.hh>#include <click/standard/scheduleinfo.hh>#include <click/error.hh>#include <click/glue.hh>#include <click/handlercall.hh>#include <click/packet_anno.hh>#include <clicknet/rfc1483.h>#include <click/userutils.hh>#include "elements/userlevel/fakepcap.hh"#include <unistd.h>#include <sys/types.h>#include <sys/stat.h>#include <fcntl.h>#ifdef ALLOW_MMAP# include <sys/mman.h>#endifCLICK_DECLS#define	SWAPLONG(y) \	((((y)&0xff)<<24) | (((y)&0xff00)<<8) | (((y)&0xff0000)>>8) | (((y)>>24)&0xff))#define	SWAPSHORT(y) \	( (((y)&0xff)<<8) | ((u_short)((y)&0xff00)>>8) )FromDAGDump::FromDAGDump()    : _packet(0), _end_h(0), _task(this){    static_assert(sizeof(DAGCell) == 64 && DAGCell::CELL_SIZE == 64);}FromDAGDump::~FromDAGDump(){    delete _end_h;}intFromDAGDump::configure(Vector<String> &conf, ErrorHandler *errh){    bool timing = false, stop = false, active = true, force_ip = false;    Timestamp first_time, first_time_off, last_time, last_time_off, interval;    String encap;    _sampling_prob = (1 << SAMPLING_SHIFT);    if (_ff.configure_keywords(conf, this, errh) < 0)	return -1;    if (cp_va_kparse(conf, this, errh,		     "FILENAME", cpkP+cpkM, cpFilename, &_ff.filename(),		     "STOP", 0, cpBool, &stop,		     "ACTIVE", 0, cpBool, &active,		     "FORCE_IP", 0, cpBool, &force_ip,		     "START", 0, cpTimestamp, &first_time,		     "START_AFTER", 0, cpTimestamp, &first_time_off,		     "END", 0, cpTimestamp, &last_time,		     "END_AFTER", 0, cpTimestamp, &last_time_off,		     "INTERVAL", 0, cpTimestamp, &interval,		     "END_CALL", 0, cpHandlerCallPtrWrite, &_end_h,		     "SAMPLE", 0, cpUnsignedReal2, SAMPLING_SHIFT, &_sampling_prob,		     "TIMING", 0, cpBool, &timing,		     "ENCAP", 0, cpWord, &encap,		     cpEnd) < 0)	return -1;    // check sampling rate    if (_sampling_prob > (1 << SAMPLING_SHIFT)) {	errh->warning("SAMPLE probability reduced to 1");	_sampling_prob = (1 << SAMPLING_SHIFT);    } else if (_sampling_prob == 0)	errh->warning("SAMPLE probability is 0; emitting no packets");    // check times    _have_first_time = _have_last_time = true;    _first_time_relative = _last_time_relative = _last_time_interval = false;    if ((bool) first_time + (bool) first_time_off > 1)	return errh->error("'START' and 'START_AFTER' are mutually exclusive");    else if ((bool) first_time)	_first_time = first_time;    else if ((bool) first_time_off)	_first_time = first_time_off, _first_time_relative = true;    else	_have_first_time = false, _first_time_relative = true;    if ((bool) last_time + (bool) last_time_off + (bool) interval > 1)	return errh->error("'END', 'END_AFTER', and 'INTERVAL' are mutually exclusive");    else if ((bool) last_time)	_last_time = last_time;    else if ((bool) last_time_off)	_last_time = last_time_off, _last_time_relative = true;    else if ((bool) interval)	_last_time = interval, _last_time_interval = true;    else	_have_last_time = false;    if (stop && _end_h)	return errh->error("'END_CALL' and 'STOP' are mutually exclusive");    else if (stop)	_end_h = new HandlerCall(name() + ".stop");    else if (_have_last_time && !_end_h)	_end_h = new HandlerCall(name() + ".active false");    // default linktype    if (!encap)	_base_linktype = FAKE_DLT_NONE;    else if ((_base_linktype = fake_pcap_parse_dlt(encap)) < 0	     || (_base_linktype != FAKE_DLT_SUNATM		 && _base_linktype != FAKE_DLT_C_HDLC		 && _base_linktype != FAKE_DLT_EN10MB		 && _base_linktype != FAKE_DLT_ATM_RFC1483		 && _base_linktype != FAKE_DLT_PPP		 && _base_linktype != FAKE_DLT_PPP_HDLC		 && _base_linktype != FAKE_DLT_RAW))	return errh->error("bad encapsulation type");    // set other variables    _have_any_times = false;    _timing = timing;    _force_ip = force_ip;    _linktype = FAKE_DLT_NONE;    _active = active;    return 0;}intFromDAGDump::initialize(ErrorHandler *errh){    if (_ff.initialize(errh) < 0)	return -1;    // if forcing IP packets, check we're not running TIMING    if (_force_ip && _timing)	return errh->error("FORCE_IP and TIMING options are incompatible");    // check handler call    if (_end_h && _end_h->initialize_write(this, errh) < 0)	return -1;    // try reading a packet    if (read_packet(errh))	_time_offset = Timestamp::now() - _packet->timestamp_anno();    if (output_is_push(0))	ScheduleInfo::initialize_task(this, &_task, _active, errh);    return 0;}voidFromDAGDump::cleanup(CleanupStage){    _ff.cleanup();    if (_packet)	_packet->kill();    _packet = 0;}voidFromDAGDump::set_active(bool active){    if (_active != active) {	_active = active;	if (active && output_is_push(0) && !_task.scheduled())	    _task.reschedule();    }}static inline uint64_tswapq(uint64_t q){#if CLICK_BYTE_ORDER == CLICK_BIG_ENDIAN    return ((q & 0xff00000000000000LL) >> 56)	| ((q & 0x00ff000000000000LL) >> 40)	| ((q & 0x0000ff0000000000LL) >> 24)	| ((q & 0x000000ff00000000LL) >>  8)	| ((q & 0x00000000ff000000LL) <<  8)	| ((q & 0x0000000000ff0000LL) << 24)	| ((q & 0x000000000000ff00LL) << 40)	| ((q & 0x00000000000000ffLL) << 56);#elif CLICK_BYTE_ORDER == CLICK_LITTLE_ENDIAN    return q;#else#error "neither big nor little endian"#endif}voidFromDAGDump::stamp_to_time(uint64_t stamp, Timestamp &tv) const{    uint32_t sec = (uint32_t) (stamp >> 32);    // based on a code description in an Endace document    stamp = (stamp & 0xFFFFFFFFULL) * 1000000000;    stamp += (stamp & 0x80000000ULL) << 1; // rounding    uint32_t nsec = (uint32_t) (stamp >> 32);    if (nsec >= 1000000000) {	nsec -= 1000000000;	sec += 1;    }    tv = Timestamp::make_nsec(sec, nsec);}voidFromDAGDump::prepare_times(const Timestamp &tv){    if (_first_time_relative)	_first_time += tv;    if (_last_time_relative)	_last_time += tv;    else if (_last_time_interval)	_last_time += _first_time;    _have_any_times = true;}boolFromDAGDump::read_packet(ErrorHandler *errh){    const DAGCell *cell;    static DAGCell static_cell;    Timestamp tv;    Packet *p;    bool more = true;    _packet = 0;  retry:    // quit if we sampled or force_ip failed, but we are no longer active    if (!more)	return false;    // we may need to read bits of the file    cell = reinterpret_cast<const DAGCell *>(_ff.get_aligned(DAGCell::HEADER_SIZE, &static_cell, errh));    if (!cell)	return false;    // check times  check_times:    stamp_to_time(swapq(cell->timestamp), tv);    if (!_have_any_times)	prepare_times(tv);    if (_have_first_time) {	if (tv < _first_time)	    goto retry;	else	    _have_first_time = false;    }    if (_have_last_time && tv >= _last_time) {	_have_last_time = false;	(void) _end_h->call_write(errh);	if (!_active)	    more = false;	// retry _last_time in case someone changed it	goto check_times;    }    // checking sampling probability    if (_sampling_prob < (1 << SAMPLING_SHIFT)	&& (click_random() & ((1<<SAMPLING_SHIFT)-1)) >= _sampling_prob)	goto retry;    // determine read length and wire length    uint32_t wire_length = 0;    if (cell->type == DAGCell::TYPE_LEGACY || _base_linktype >= 0) {      use_base_linktype:	_linktype = _base_linktype;	switch (_base_linktype) {	  cell:	  case FAKE_DLT_ATM_RFC1483:	  case FAKE_DLT_PPP:	  case FAKE_DLT_PPP_HDLC:	    p = _ff.get_packet(DAGCell::CELL_SIZE - DAGCell::HEADER_SIZE, tv.sec(), tv.subsec(), errh);	    break;	  case FAKE_DLT_C_HDLC:	    wire_length = htons(*(reinterpret_cast<const uint16_t*>(cell) + 5));	    goto cell;	  case FAKE_DLT_NONE:	    _linktype = FAKE_DLT_ATM_RFC1483;	    goto cell;	  case FAKE_DLT_SUNATM:	    p = _ff.get_packet_from_data(reinterpret_cast<const uint8_t*>(cell) + 12, 4, DAGCell::CELL_SIZE - 12, tv.sec(), tv.subsec(), errh);	    break;	  case FAKE_DLT_EN10MB:	    wire_length = htons(*(reinterpret_cast<const uint16_t*>(cell) + 4));	    p = _ff.get_packet_from_data(reinterpret_cast<const uint8_t*>(cell) + 10, 6, DAGCell::CELL_SIZE - 10, tv.sec(), tv.subsec(), errh);	    break;	  default:	    p = _ff.get_packet_from_data(reinterpret_cast<const uint8_t*>(cell) + 8, 8, DAGCell::CELL_SIZE - 8, tv.sec(), tv.subsec(), errh);	    break;	}    } else {	int read_length = htons(cell->rlen);	wire_length = htons(cell->wlen);	switch (cell->type) {	  case DAGCell::TYPE_ATM:	  case DAGCell::TYPE_AAL5:	    _linktype = FAKE_DLT_SUNATM;	    break;	  case DAGCell::TYPE_ETH:	    _ff.shift_pos(2);	    read_length -= 2;	    wire_length -= 4;	// XXX DAG 'wlen' includes CRC	    _linktype = FAKE_DLT_EN10MB;	    break;	  case DAGCell::TYPE_HDLC_POS:	    _linktype = FAKE_DLT_C_HDLC;	    break;	  default:		// indicates an old-format dump	    if (_base_linktype == FAKE_DLT_NONE)		_base_linktype = FAKE_DLT_ATM_RFC1483;	    if (errh) {		errh->warning("odd DAG cell type %d, assuming old-style ATM encapsulation", cell->type);		errh->message("(To avoid this warning, specify an explicit ENCAP.)");	    } else		click_chatter("%{element}: DAG cell with odd type %d, assuming old-style\n  ATM encapsulation for rest of dump.  Packets may have been read incorrectly!\n  (To avoid this warning, specify an explicit ENCAP.)", this, cell->type);	    goto use_base_linktype;	}	if (read_length < DAGCell::HEADER_SIZE)	    return false;	p = _ff.get_packet(read_length - DAGCell::HEADER_SIZE, tv.sec(), tv.subsec(), errh);    }    // check packet    if (!p)	return false;    if (wire_length)	SET_EXTRA_LENGTH_ANNO(p, wire_length - p->length());    if (_force_ip && !fake_pcap_force_ip(p, _linktype)) {	checked_output_push(1, p);	goto retry;    }    _packet = p;    return more;}boolFromDAGDump::run_task(Task *){    if (!_active)	return false;    bool more;    if (_packet || read_packet(0)) {	if (_timing	    && _packet->timestamp_anno() > Timestamp::now() - _time_offset) {	    _task.fast_reschedule();	    return false;	}	output(0).push(_packet);	more = read_packet(0);    } else	more = false;    if (more)	_task.fast_reschedule();    else if (_end_h)	_end_h->call_write(ErrorHandler::default_handler());    return true;}Packet *FromDAGDump::pull(int){    if (!_active)	return 0;    bool more;    Packet *p;    if (_packet || read_packet(0)) {	if (_timing	    && _packet->timestamp_anno() > Timestamp::now() - _time_offset)	    return 0;	p = _packet;	more = read_packet(0);    } else {	p = 0;	more = false;    }    if (!more && _end_h)	_end_h->call_write(ErrorHandler::default_handler());    return p;}enum {    H_SAMPLING_PROB, H_ACTIVE, H_ENCAP, H_STOP, H_EXTEND_INTERVAL};StringFromDAGDump::read_handler(Element *e, void *thunk){    FromDAGDump *fd = static_cast<FromDAGDump *>(e);    switch ((intptr_t)thunk) {      case H_SAMPLING_PROB:	return cp_unparse_real2(fd->_sampling_prob, SAMPLING_SHIFT);      case H_ENCAP:	return String(fake_pcap_unparse_dlt(fd->_linktype));      default:	return "<error>";    }}intFromDAGDump::write_handler(const String &s_in, Element *e, void *thunk, ErrorHandler *errh){    FromDAGDump *fd = static_cast<FromDAGDump *>(e);    String s = cp_uncomment(s_in);    switch ((intptr_t)thunk) {      case H_ACTIVE: {	  bool active;	  if (cp_bool(s, &active)) {	      fd->set_active(active);	      return 0;	  } else	      return errh->error("'active' should be Boolean");      }      case H_STOP:	fd->set_active(false);	fd->router()->please_stop_driver();	return 0;      case H_EXTEND_INTERVAL: {	  Timestamp tv;	  if (cp_time(s, &tv)) {	      fd->_last_time += tv;	      if (fd->_end_h)		  fd->_have_last_time = true, fd->set_active(true);	      return 0;	  } else	      return errh->error("'extend_interval' takes a time interval");      }      default:	return -EINVAL;    }}voidFromDAGDump::add_handlers(){    add_read_handler("sampling_prob", read_handler, (void *)H_SAMPLING_PROB);    add_data_handlers("active", Handler::OP_READ | Handler::CHECKBOX, &_active);    add_write_handler("active", write_handler, (void *)H_ACTIVE);    add_read_handler("encap", read_handler, (void *)H_ENCAP);    add_write_handler("stop", write_handler, (void *)H_STOP);    add_write_handler("extend_interval", write_handler, (void *)H_EXTEND_INTERVAL);    _ff.add_handlers(this);    if (output_is_push(0))	add_task_handlers(&_task);}CLICK_ENDDECLSELEMENT_REQUIRES(userlevel int64 FakePcap FromFile)EXPORT_ELEMENT(FromDAGDump)

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
成人国产精品免费观看| 欧美丰满美乳xxx高潮www| 久久亚洲影视婷婷| 美女在线视频一区| 91日韩在线专区| 亚洲欧美视频在线观看| 99精品国产99久久久久久白柏| 精品久久久久久综合日本欧美| 水蜜桃久久夜色精品一区的特点| 色菇凉天天综合网| 26uuu成人网一区二区三区| 国产在线视频不卡二| 日韩精品专区在线影院重磅| 免费xxxx性欧美18vr| 欧美电视剧在线观看完整版| 麻豆精品国产91久久久久久| 精品久久国产97色综合| 亚洲九九爱视频| 色域天天综合网| 亚洲午夜激情网站| 7777精品伊人久久久大香线蕉经典版下载| 夜夜嗨av一区二区三区四季av| 欧洲另类一二三四区| 亚洲成人免费看| 欧美一级欧美三级在线观看 | 精品91自产拍在线观看一区| 经典三级视频一区| 国产亚洲欧美日韩在线一区| 成人性色生活片免费看爆迷你毛片| 国产精品久久久久精k8| 国产精品一区二区久久不卡| 亚洲天天做日日做天天谢日日欢 | 欧美影视一区二区三区| 亚洲成av人**亚洲成av**| 91精品午夜视频| 国产精品自拍一区| 国产精品乱子久久久久| 色综合久久久久久久久| 日本aⅴ亚洲精品中文乱码| 久久网站最新地址| 91蝌蚪porny成人天涯| 亚洲国产精品久久一线不卡| 日韩精品亚洲专区| 99re视频精品| 麻豆成人久久精品二区三区红| 欧美国产日本视频| 91精品综合久久久久久| 99re这里都是精品| 国内成+人亚洲+欧美+综合在线| 17c精品麻豆一区二区免费| 日韩欧美亚洲一区二区| 在线视频一区二区三区| 不卡av电影在线播放| 奇米色一区二区| 亚洲自拍另类综合| 国产精品视频一二三区 | 亚洲国产一区二区三区| 中文欧美字幕免费| 精品久久一区二区| 欧美精三区欧美精三区| 色婷婷av一区二区三区软件| 粉嫩av一区二区三区| 久久国产剧场电影| 日韩av中文字幕一区二区三区| 亚洲免费色视频| 一区在线播放视频| 国产拍欧美日韩视频二区| 日韩一级二级三级精品视频| 欧美日韩中文字幕精品| 91美女蜜桃在线| 91免费国产在线观看| 成人黄色电影在线 | 国产精品视频在线看| 久久夜色精品国产噜噜av| 欧美大片日本大片免费观看| 欧美日韩国产电影| 欧美最猛黑人xxxxx猛交| 色偷偷成人一区二区三区91| av电影一区二区| 99精品国产91久久久久久| bt欧美亚洲午夜电影天堂| 国产成人在线看| 国产九色sp调教91| 国产一区在线观看视频| 韩国v欧美v日本v亚洲v| 国产在线精品一区二区夜色| 韩国一区二区在线观看| 国产一区在线看| 粉嫩一区二区三区在线看| 成人av先锋影音| 91香蕉视频黄| 欧美日韩一区在线观看| 这里只有精品视频在线观看| 精品国产乱码久久久久久图片 | 欧美亚洲一区二区在线| 欧美日韩一本到| 欧美一区二区三区成人| 日韩精品一区二区在线观看| 久久久久99精品一区| 国产精品剧情在线亚洲| 亚洲天堂网中文字| 亚洲国产一二三| 久久精品国产亚洲aⅴ| 国产一区二区不卡| 91论坛在线播放| 在线成人小视频| 精品国产污污免费网站入口 | 国产91丝袜在线播放| 成人av午夜影院| 精品视频免费看| 精品国产伦一区二区三区观看体验| 中文欧美字幕免费| 亚洲6080在线| 国产麻豆精品久久一二三| 97久久超碰国产精品| 3atv一区二区三区| 久久久久久久久久久久久夜| 亚洲欧洲99久久| 视频在线观看91| 国产aⅴ综合色| 欧美日韩精品一区二区三区 | 成人午夜电影网站| 欧美性猛交xxxx黑人交| 精品成人一区二区| 亚洲精品国产一区二区精华液 | 欧美午夜视频网站| 精品国产精品网麻豆系列| 中文字幕一区二区三区av| 日日夜夜精品视频免费| 东方aⅴ免费观看久久av| 欧美色老头old∨ideo| 国产欧美一区二区精品性| 亚洲妇女屁股眼交7| 粗大黑人巨茎大战欧美成人| 欧美精品久久99久久在免费线| 久久久www成人免费毛片麻豆| 亚洲一区二区成人在线观看| 国产精品18久久久久久久久| 欧美区一区二区三区| 国产精品狼人久久影院观看方式| 蜜臀av性久久久久蜜臀aⅴ流畅| 91在线精品一区二区三区| 久久人人爽人人爽| 日日噜噜夜夜狠狠视频欧美人| 成人av网站在线| 久久久精品免费观看| 日韩高清在线不卡| 91国偷自产一区二区开放时间| 久久精品亚洲麻豆av一区二区 | 亚洲欧美中日韩| 国产永久精品大片wwwapp| 91精品国产综合久久香蕉麻豆| 亚洲欧美日韩国产中文在线| 国产激情精品久久久第一区二区 | 精品99久久久久久| 青青草国产成人99久久| 欧美午夜电影一区| 亚洲人成网站在线| 成人高清免费在线播放| 欧美成人伊人久久综合网| 日韩精品一级中文字幕精品视频免费观看 | 国产精品福利av| 国产成人在线看| 久久九九99视频| 国产一二精品视频| 精品1区2区在线观看| 韩日精品视频一区| 精品少妇一区二区三区| 看电视剧不卡顿的网站| 制服视频三区第一页精品| 日韩va欧美va亚洲va久久| 欧美一区二区在线视频| 日韩成人伦理电影在线观看| 欧美日韩国产美| 天天做天天摸天天爽国产一区 | 亚洲国产成人91porn| 在线免费观看视频一区| 亚洲精品国产视频| 91成人在线观看喷潮| 一区二区不卡在线播放| 91激情五月电影| 亚洲 欧美综合在线网络| 欧美日韩国产天堂| 免费观看在线综合色| 欧美一区二区三区在线观看| 老司机午夜精品| 日本一区免费视频| 不卡视频一二三四| 亚洲最大成人综合| 欧美日韩精品一二三区| 免费观看日韩av| 精品国产免费人成电影在线观看四季| 国产伦精品一区二区三区在线观看 | 久久久久高清精品| 91在线观看下载| 天天爽夜夜爽夜夜爽精品视频| 欧美一卡2卡三卡4卡5免费| 国产一区二三区| 亚洲视频免费在线观看| 欧美日韩中文一区|