-
Notifications
You must be signed in to change notification settings - Fork 81
/
storedata.hh
59 lines (51 loc) · 1.32 KB
/
storedata.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
// -*- c-basic-offset: 4 -*-
#ifndef CLICK_STOREDATA_HH
#define CLICK_STOREDATA_HH
#include <click/batchelement.hh>
CLICK_DECLS
/* =c
* StoreData(OFFSET, DATA, [MASK], I[<KEYWORDS>])
* =s basicmod
* changes packet data
* =d
*
* Changes packet data starting at OFFSET to DATA.
*
* Optionally MASK can be specified, so only these bits
* of packet data are changed which corresponding bits
* of MASK are 1.
*
* DATA and MASK can be specified is hexadecimal using
* the following syntax:
*
* StoreData(1, \<FF>, MASK \<02>);
*
* Keyword arguments are:
*
* =over 8
*
* =item GROW
*
* When set to true and DATA exceeds past packet length,
* packet length will be extended. Otherwise, excessive data
* will not be stored. Default is false.
*
* =a AlignmentInfo, click-align(1) */
class StoreData : public BatchElement { public:
StoreData() CLICK_COLD;
const char *class_name() const override { return "StoreData"; }
const char *port_count() const override { return PORTS_1_1; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
int initialize(ErrorHandler *) CLICK_COLD;
Packet *simple_action(Packet *);
#if HAVE_BATCH
PacketBatch *simple_action_batch(PacketBatch *);
#endif
private:
unsigned _offset;
String _data;
String _mask;
bool _grow;
};
CLICK_ENDDECLS
#endif