-
Notifications
You must be signed in to change notification settings - Fork 81
/
arpprint.hh
87 lines (57 loc) · 1.71 KB
/
arpprint.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
78
79
80
81
82
83
84
85
86
87
#ifndef CLICK_ARPPRINT_HH
#define CLICK_ARPPRINT_HH
#include <click/batchelement.hh>
CLICK_DECLS
/*
=c
ARPPrint([TAG, I<KEYWORDS>])
=s arp
pretty-prints ARP packets a la tcpdump
=d
Expects ARP packets as input.
Prints out ARP packets in a human-readable tcpdump-like format, preceded by
the TAG text.
Keyword arguments are:
=over 2
=item TIMESTAMP
Boolean. Determines whether to print each packet's timestamp in seconds since
1970. Default is true.
=item ETHER
Boolean. Determines whether to print each packet's Ethernet addresses.
Default is false.
=item OUTFILE
String. Only available at user level. PrintV<> information to the file specified
by OUTFILE instead of standard error.
=item ACTIVE
Boolean. If false, don't print messages. Default is true.
=back
=h active read/write
Returns or sets the ACTIVE parameter.
=a Print, CheckARPHeader */
class ARPPrint : public BatchElement {
public:
ARPPrint() CLICK_COLD;
~ARPPrint() CLICK_COLD;
const char *class_name() const override { return "ARPPrint"; }
const char *port_count() const override { return PORTS_1_1; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
int initialize(ErrorHandler *) CLICK_COLD;
void cleanup(CleanupStage) CLICK_COLD;
void add_handlers() CLICK_COLD;
Packet *simple_action (Packet *);
#if HAVE_BATCH
PacketBatch *simple_action_batch(PacketBatch *);
#endif
private:
String _label;
bool _print_timestamp;
bool _print_ether;
bool _active;
#if CLICK_USERLEVEL
String _outfilename;
FILE *_outfile;
#endif
ErrorHandler *_errh;
};
CLICK_ENDDECLS
#endif