Page Menu
Home
c4science
Search
Configure Global Search
Log In
Files
F120482905
makeburst.hh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Subscribers
None
File Metadata
Details
File Info
Storage
Attached
Created
Fri, Jul 4, 16:52
Size
2 KB
Mime Type
text/x-c++
Expires
Sun, Jul 6, 16:52 (1 d, 23 h)
Engine
blob
Format
Raw Data
Handle
27186256
Attached To
R6591 HyMAB
makeburst.hh
View Options
#ifndef CLICK_MAKEBURST_HH
#define CLICK_MAKEBURST_HH
#include <click/element.hh>
#include <click/standard/storage.hh>
#include <click/element.hh>
#include <click/notifier.hh>
#include <click/router.hh>
#include <click/confparse.hh>
#include <click/timer.hh>
#include <click/error.hh>
#include <click/etheraddress.hh>
#include <click/hashtable.hh>
#include <click/vector.hh>
#include <click/config.h>
#include <click/args.hh>
#include <click/string.hh>
#include <click/straccum.hh>
#include <clicknet/tcp.h>
#include "util.hh"
#include <elements/standard/fullnotequeue.hh>
CLICK_DECLS
class FullNoteQueue;
class MakeBurst : public Element, public Storage {
public:
MakeBurst();
~MakeBurst();
int drops() const { return _drops; }
inline bool enq(Packet*);
inline Packet* deq();
const char *class_name() const { return "MakeBurst"; }
const char *port_count() const { return "1/1-3"; }
// output 0: packets sent in burst
// output 1: traffic packets sent without burst
// output 2: packets sent with high priority (eg control)
const char *processing() const { return PUSH; }
int configure(Vector<String> &, ErrorHandler *);
int initialize(ErrorHandler *);
void push(int, Packet*);
void run_timer(Timer *timer);
//#ifdef __linux__
inline void packet_memory_barrier(Packet* volatile& packet);
//#endif
bool set_burst(int);
void set_timeout(int n) {_timeout = n;}
void set_timeout_tcp(int n) {_timeout_tcp = n;}
// handlers
void add_handlers();
static int bool_handler(const String &, Element *, void *,ErrorHandler *);
static int set_int_handler(const String &, Element *, void *,ErrorHandler *);
int get_drops() { return _drops; }
void set_debug(bool b) {_debug = b; }
void set_verb_debug(bool debug) {_verb_debug=debug; if(_verb_debug) set_debug(true);}
void set_print_stats(int a) {_print_stats=a; if(_print_stats)_print_stats_timer.schedule_after_sec(_print_stats);}
int get_burst() { return _burst; }
protected:
Packet* volatile * _q;
int _drops;
bool _debug;
bool _verb_debug;
int _burst;
bool _print_dropped;
int _timeout;
int _timeout_tcp;
Timer _timeout_timer;
Timer _print_stats_timer;
bool _check_mab_id;
int _print_stats;
int _packets_sent;
int _count_bursts;
FullNoteQueue *_next_queue;
};
//#ifdef __linux__
inline void
MakeBurst::packet_memory_barrier(Packet * volatile &packet)
{
__asm__ volatile("" : : "m" (packet), "m" (_head), "m" (_tail));
}
//#endif
CLICK_ENDDECLS
#endif
Event Timeline
Log In to Comment