-
Notifications
You must be signed in to change notification settings - Fork 78
/
setip6dscp.hh
46 lines (34 loc) · 1.04 KB
/
setip6dscp.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
#ifndef CLICK_SETIP6DSCP_HH
#define CLICK_SETIP6DSCP_HH
/*
* =c
* SetIP6DSCP(VAL)
* =s ip6
* sets IP6 packets' DSCP fields
* =d
* Expects IP6 packets as input and
* sets their Differential Services Code Point to VAL
* and passes the packet to output 0.
* The DSCP is the upper 6 bits of the IP6 TRAFFIC CLASS field.
*/
#include <click/batchelement.hh>
#include <click/glue.hh>
#include <clicknet/ip6.h>
CLICK_DECLS
class SetIP6DSCP : public SimpleElement<SetIP6DSCP> { public:
SetIP6DSCP();
~SetIP6DSCP();
const char *class_name() const override { return "SetIP6DSCP"; }
const char *port_count() const override { return PORTS_1_1; }
uint8_t dscp() const { return ntohl(_dscp) >> IP6_DSCP_SHIFT; }
int configure(Vector<String> &conf, ErrorHandler *errh) CLICK_COLD;
bool can_live_reconfigure() const { return true; }
void add_handlers() CLICK_COLD;
inline Packet *smaction(Packet *p);
void push(int port, Packet *p);
Packet *pull(int port);
private:
uint32_t _dscp;
};
CLICK_ENDDECLS
#endif