-
Notifications
You must be signed in to change notification settings - Fork 82
/
etherrewrite.hh
75 lines (47 loc) · 1.58 KB
/
etherrewrite.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
#ifndef CLICK_ETHERREWRITE_HH
#define CLICK_ETHERREWRITE_HH
#include <click/batchelement.hh>
#include <clicknet/ether.h>
CLICK_DECLS
/*
=c
EtherRewrite(SRC, DST)
=s ethernet
rewrite source and destination Ethernet address
=d
Rewrite the source and the destination address in the Ethernet header.
The ETHERTYPE is left untouched.
=e
Ensure that source address of all packets passing by is 1:1:1:1:1:1, and
the destination address is 2:2:2:2:2:2:
EtherRewrite(1:1:1:1:1:1, 2:2:2:2:2:2)
=n
This element is useful if there is only one possible nexthop on a given link
(such as for a network-layer transparent firewall), meaning that source and
destination ethernet address will always be the same for a given output.
=h src read/write
Return or set the SRC parameter.
=h dst read/write
Return or set the DST parameter.
=a
EtherEncap, EtherVLANEncap, ARPQuerier, EnsureEther, StoreEtherAddress */
class EtherRewrite : public BatchElement { public:
EtherRewrite() CLICK_COLD;
~EtherRewrite() CLICK_COLD;
const char *class_name() const override { return "EtherRewrite"; }
const char *port_count() const override { return PORTS_1_1; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
bool can_live_reconfigure() const { return true; }
void add_handlers() CLICK_COLD;
inline Packet *smaction(Packet *);
Packet *pull(int) override;
void push(int, Packet *) override;
#if HAVE_BATCH
void push_batch(int, PacketBatch *) override;
PacketBatch *pull_batch(int, unsigned) override;
#endif
private:
click_ether _ethh;
};
CLICK_ENDDECLS
#endif