-
Notifications
You must be signed in to change notification settings - Fork 82
/
tee.hh
64 lines (48 loc) · 1.42 KB
/
tee.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
56
57
58
59
60
61
62
63
64
#ifndef CLICK_TEE_HH
#define CLICK_TEE_HH
#include <click/batchelement.hh>
CLICK_DECLS
/*
* =c
* Tee([N])
*
* PullTee([N])
* =s basictransfer
* duplicates packets
* =d
* Tee sends a copy of each incoming packet out each output.
*
* PullTee's input and its first output are pull; its other outputs are push.
* Each time the pull output pulls a packet, it
* sends a copy out the push outputs.
*
* Tee and PullTee have however many outputs are used in the configuration,
* but you can say how many outputs you expect with the optional argument
* N.
*/
class Tee : public BatchElement {
public:
Tee() CLICK_COLD;
const char *class_name() const override { return "Tee"; }
const char *port_count() const override { return "1/1-"; }
const char *processing() const override { return PUSH; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
void push(int, Packet *) override;
#if HAVE_BATCH
void push_batch(int, PacketBatch *) override;
#endif
};
class PullTee : public BatchElement {
public:
PullTee() CLICK_COLD;
const char *class_name() const override { return "PullTee"; }
const char *port_count() const override { return "1/1-"; }
const char *processing() const override { return "l/lh"; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
Packet *pull(int) override;
#if HAVE_BATCH
PacketBatch *pull_batch(int, unsigned) override;
#endif
};
CLICK_ENDDECLS
#endif