-
Notifications
You must be signed in to change notification settings - Fork 81
/
ipgwoptions.hh
65 lines (54 loc) · 1.94 KB
/
ipgwoptions.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
#ifndef CLICK_IPGWOPTIONS_HH
#define CLICK_IPGWOPTIONS_HH
#include <click/batchelement.hh>
#include <click/glue.hh>
#include <click/atomic.hh>
CLICK_DECLS
/*
* =c
* IPGWOptions(MYADDR [, OTHERADDRS])
* =s ip
* processes router IP options
* =d
* Process the IP options that should be processed by every router,
* not just when ip_dst refers to the current router. At the moment
* that amounts to Record Route and Timestamp (in particular,
* not the source route options). MYADDR is the router's
* IP address on the interface downstream from the element.
*
* Probably needs to be placed on the output path, since MYADDR
* must be the outgoing interface's IP address (rfc1812 4.2.2.2).
*
* Recomputes the IP header checksum if it modifies the packet.
*
* The optional OTHERADDRS argument should be a space-separated list of IP
* addresses containing the router's other interface addresses. It is used to
* implement the Timestamp option.
*
* The second output may be connected to an ICMPError to produce
* a parameter problem (type=12,code=0) message. IPGWOptions sets
* the param_off packet annotation so that ICMPError can set
* the Parameter Problem pointer to point to the erroneous byte.
*
* =a ICMPError */
class IPGWOptions : public BatchElement { public:
IPGWOptions() CLICK_COLD;
~IPGWOptions() CLICK_COLD;
const char *class_name() const override { return "IPGWOptions"; }
const char *port_count() const override { return PORTS_1_1X2; }
const char *processing() const override { return PROCESSING_A_AH; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
void add_handlers() CLICK_COLD;
uint32_t drops() const { return _drops; }
Packet *handle_options(Packet *);
Packet *simple_action (Packet *);
#if HAVE_BATCH
PacketBatch *simple_action_batch(PacketBatch *);
#endif
private:
atomic_uint32_t _drops;
struct in_addr _preferred_addr;
Vector<IPAddress> _my_addrs;
};
CLICK_ENDDECLS
#endif