-
Notifications
You must be signed in to change notification settings - Fork 83
/
Copy pathtruncateippayload.hh
49 lines (32 loc) · 1.17 KB
/
truncateippayload.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
// -*- mode: c++; c-basic-offset: 4 -*-
#ifndef CLICK_TRUNCATEIPPAYLOAD_HH
#define CLICK_TRUNCATEIPPAYLOAD_HH
#include <click/batchelement.hh>
CLICK_DECLS
/*
=c
TruncateIPPayload([LENGTH, TRANSPORT])
=s basicmod
limit payload length
=d
Shorten IP packets to have payload of at most LENGTH bytes. Normally
"payload" begins at the end of the transport header (TruncateIPPayload
understands TCP, UDP, and ICMP headers). If TRANSPORT is false, "payload"
begins at the end of the IP header. Non-IP packets are truncated to at most
LENGTH bytes. Default LENGTH is 0.
The EXTRA_LENGTH keyword argument determines whether packets' extra length
annotations are updated to account for any dropped bytes. Default is true.
=a Truncate
*/
class TruncateIPPayload : public SimpleElement<TruncateIPPayload> { public:
TruncateIPPayload() CLICK_COLD;
~TruncateIPPayload() CLICK_COLD;
const char *class_name() const override { return "TruncateIPPayload"; }
const char *port_count() const override { return PORTS_1_1; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
Packet *simple_action(Packet *);
private:
unsigned _nbytes;
};
CLICK_ENDDECLS
#endif