-
Notifications
You must be signed in to change notification settings - Fork 81
/
setipdscp.hh
49 lines (38 loc) · 1.09 KB
/
setipdscp.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
#ifndef CLICK_SETIPDSCP_HH
#define CLICK_SETIPDSCP_HH
#include <click/batchelement.hh>
#include <click/glue.hh>
CLICK_DECLS
/*
* =c
* SetIPDSCP(DSCP)
* =s ip
* sets IP packets' DSCP fields
* =d
* Expects IP packets as input and
* sets their Differential Services Code Point to DSCP.
* Then it incrementally recalculates the IP checksum
* and passes the packet to output 0.
* The DSCP is the upper 6 bits of the IP TOS field.
* =sa SetIPECN
*/
class SetIPDSCP : public BatchElement { public:
SetIPDSCP() CLICK_COLD;
~SetIPDSCP() CLICK_COLD;
const char *class_name() const override { return "SetIPDSCP"; }
const char *port_count() const override { return PORTS_1_1; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
bool can_live_reconfigure() const { return true; }
void add_handlers() CLICK_COLD;
inline Packet *smaction(Packet *);
void push(int, Packet *p);
Packet *pull(int);
#if HAVE_BATCH
void push_batch(int, PacketBatch *);
PacketBatch *pull_batch(int port, unsigned max);
#endif
private:
unsigned char _dscp;
};
CLICK_ENDDECLS
#endif