-
Notifications
You must be signed in to change notification settings - Fork 81
/
paintswitch.hh
53 lines (36 loc) · 1.32 KB
/
paintswitch.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
#ifndef CLICK_PAINTSWITCH_HH
#define CLICK_PAINTSWITCH_HH
#include <click/batchelement.hh>
CLICK_DECLS
/*
=c
PaintSwitch
=s paint
sends packet stream to output chosen per-packet
=d
PaintSwitch sends every incoming packet to one of its output ports --
specifically, output port number K, where K is the value of the
incoming packet's paint annotation. If the paint annotation is set to
255, the packet is duplicated and sent to all outputs. Since there
are only 256 different paint annotations, including the special value
of 255, PaintSwitch can have up to 255 outputs. If there is no output
port K, the packet is dropped.
PaintSwitch uses the PAINT annotation by default, but the ANNO argument can
specify any one-byte annotation.
=a StaticSwitch, PullSwitch, RoundRobinSwitch, StrideSwitch, HashSwitch,
RandomSwitch, Paint, PaintTee */
class PaintSwitch : public BatchElement { public:
PaintSwitch() CLICK_COLD;
const char *class_name() const override { return "PaintSwitch"; }
const char *port_count() const override { return "1/-"; }
const char *processing() const override { return PUSH; }
int configure(Vector<String> &conf, ErrorHandler *errh) CLICK_COLD;
void push(int, Packet *);
#if HAVE_BATCH
void push_batch(int, PacketBatch *);
#endif
private:
uint8_t _anno;
};
CLICK_ENDDECLS
#endif