-
Notifications
You must be signed in to change notification settings - Fork 82
/
forceip.hh
43 lines (34 loc) · 741 Bytes
/
forceip.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
#ifndef CLICK_FORCEIP_HH
#define CLICK_FORCEIP_HH
#include <click/element.hh>
#include <click/glue.hh>
#include <clicknet/ip.h>
CLICK_DECLS
/*
* =c
* ForceIP()
* =s ip
* Fixes fields to make packets into legal IP packets.
* =d
*
* Fixes various fields in incoming packets to make sure they
* are legal IP packets.
*
* =e
*
* RandomSource(20)
* -> SetIPAddress(1.2.3.4)
* -> StoreIPAddress(16)
* -> ForceIP() -> ...
*/
class ForceIP : public Element {
int _count;
public:
ForceIP() CLICK_COLD;
~ForceIP() CLICK_COLD;
const char *class_name() const override { return "ForceIP"; }
const char *port_count() const override { return PORTS_1_1; }
Packet *simple_action(Packet *);
};
CLICK_ENDDECLS
#endif