-
Notifications
You must be signed in to change notification settings - Fork 82
/
setipchecksum.hh
43 lines (34 loc) · 1 KB
/
setipchecksum.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_SETIPCHECKSUM_HH
#define CLICK_SETIPCHECKSUM_HH
#include <click/batchelement.hh>
#include <click/glue.hh>
CLICK_DECLS
/*
* =c
* SetIPChecksum()
* =s ip
* sets IP packets' checksums
* =d
* Expects an IP packet as input.
* Calculates the IP header's checksum and sets the checksum header field.
*
* You will not normally need SetIPChecksum. Most elements that modify an IP
* header, like DecIPTTL, SetIPDSCP, and IPRewriter, already update the
* checksum incrementally.
*
* =a CheckIPHeader, DecIPTTL, SetIPDSCP, IPRewriter */
class SetIPChecksum : public BatchElement { public:
SetIPChecksum() CLICK_COLD;
~SetIPChecksum() CLICK_COLD;
const char *class_name() const override { return "SetIPChecksum"; }
const char *port_count() const override { return PORTS_1_1; }
void add_handlers() CLICK_COLD;
Packet *simple_action(Packet *p);
#if HAVE_BATCH
PacketBatch *simple_action_batch(PacketBatch *);
#endif
private:
unsigned _drops;
};
CLICK_ENDDECLS
#endif