-
Notifications
You must be signed in to change notification settings - Fork 82
/
align.hh
48 lines (38 loc) · 940 Bytes
/
align.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
#ifndef CLICK_ALIGN_HH
#define CLICK_ALIGN_HH
#include <click/element.hh>
CLICK_DECLS
/* =c
* Align(MODULUS, OFFSET)
* =s basicmod
* aligns packet data
* =d
*
* Aligns packet data. Each input packet is aligned so that its first byte is
* OFFSET bytes off from a MODULUS-byte boundary. This may involve a packet
* copy.
*
* MODULUS must be 2, 4, or 8.
* =n
*
* The click-align(1) tool will insert this element automatically wherever it
* is required.
*
* =e
* ... -> Align(4, 0) -> ...
*
* =a AlignmentInfo, click-align(1) */
class Align : public Element {
int _offset;
int _mask;
public:
Align() CLICK_COLD;
const char *class_name() const override { return "Align"; }
const char *port_count() const override { return PORTS_1_1; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
Packet *smaction(Packet *);
void push(int, Packet *);
Packet *pull(int);
};
CLICK_ENDDECLS
#endif