-
Notifications
You must be signed in to change notification settings - Fork 82
/
icmppingencap.hh
77 lines (50 loc) · 1.58 KB
/
icmppingencap.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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
// -*- c-basic-offset: 4 -*-
#ifndef CLICK_ICMPPINGENCAP_HH
#define CLICK_ICMPPINGENCAP_HH
#include <click/element.hh>
#include <click/timer.hh>
CLICK_DECLS
/*
=c
ICMPPingEncap(SRC, DST [, I<keyword> IDENTIFIER])
=s icmp
encapsulates packets in ICMP ping headers
=d
Encapsulates input packets in an ICMP ping header with source IP address SRC
and destination IP address DST. Advances the "sequence" field by one for
each packet. (The sequence field is stored in network byte order in the
packet.)
Keyword arguments are:
=over 8
=item IDENTIFIER
Integer. Determines the ICMP identifier field in emitted pings. Default is
0.
=back
=h src read/write
Returns or sets the SRC argument.
=h dst read/write
Returns or sets the DST argument.
=a
ICMPPingSource, ICMPPingResponder, ICMPPingRewriter */
class ICMPPingEncap : public Element { public:
ICMPPingEncap() CLICK_COLD;
~ICMPPingEncap() CLICK_COLD;
const char *class_name() const override { return "ICMPPingEncap"; }
const char *port_count() const override { return PORTS_1_1; }
const char *flags() const { return "A"; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
void add_handlers() CLICK_COLD;
Packet *simple_action(Packet *);
private:
struct in_addr _src;
struct in_addr _dst;
uint16_t _icmp_id;
uint16_t _ip_id;
#if HAVE_FAST_CHECKSUM && FAST_CHECKSUM_ALIGNED
bool _aligned;
#endif
static String read_handler(Element *, void *) CLICK_COLD;
static int write_handler(const String &, Element *, void *, ErrorHandler *) CLICK_COLD;
};
CLICK_ENDDECLS
#endif