-
Notifications
You must be signed in to change notification settings - Fork 82
/
idle.hh
55 lines (45 loc) · 1.21 KB
/
idle.hh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
#ifndef CLICK_IDLE_HH
#define CLICK_IDLE_HH
#include <click/batchelement.hh>
#include <click/notifier.hh>
CLICK_DECLS
/*
* =c
* Idle
* =s basicsources
* discards packets
* =d
*
* Idle never pushes a packet to any output or pulls a packet from any input.
* Any packet it does receive by push is discarded. Idle is often used to
* avoid "input not connected" error messages.
*
* Idle provides an upstream-empty notifier to inform downstream pullers that
* it is dormant. As a result, in the configuration
*
* Idle -> SimpleQueue -> Discard;
*
* the Discard element will itself go dormant. Use SimpleIdle to avoid this
* effect.
*
* =sa SimpleIdle
*/
class Idle : public BatchElement {
public:
Idle() CLICK_COLD;
const char *class_name() const override { return "Idle"; }
const char *port_count() const override { return "-/-"; }
const char *processing() const override { return "a/a"; }
const char *flow_code() const override { return "x/y"; }
void *cast(const char *);
const char *flags() const { return "S0"; }
void push(int, Packet *);
Packet *pull(int);
#if HAVE_BATCH
void push_batch(int, PacketBatch *);
#endif
private:
Notifier _notifier;
};
CLICK_ENDDECLS
#endif