-
Notifications
You must be signed in to change notification settings - Fork 82
/
sha1.hh
47 lines (37 loc) · 1.02 KB
/
sha1.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
#ifndef CLICK_IPSECAUTHSHA1_HH
#define CLICK_IPSECAUTHSHA1_HH
#include <click/element.hh>
#include <click/atomic.hh>
#include <click/glue.hh>
CLICK_DECLS
/*
* =c
* IPsecAuthSHA1(VERIFY)
* =s ipsec
* verify SHA1 authentication digest.
* =d
*
* If first argument is 0, computes SHA1 authentication digest for ESP packet
* per RFC 2404, 2406. If first argument is 1, verify SHA1 digest and remove
* authentication bits.
*
* =a IPsecESPEncap, IPsecDES, IPsecAES
*/
class IPsecAuthSHA1 : public Element {
public:
IPsecAuthSHA1();
~IPsecAuthSHA1();
const char *class_name() const override { return "IPsecAuthSHA1"; }
const char *port_count() const override { return "1/-"; }
int configure(Vector<String> &, ErrorHandler *) CLICK_COLD;
int initialize(ErrorHandler *) CLICK_COLD;
Packet *simple_action(Packet *);
void add_handlers() CLICK_COLD;
static String drop_handler(Element *e, void *thunk);
private:
int _op;
atomic_uint32_t _drops;
enum { COMPUTE_AUTH = 0, VERIFY_AUTH = 1 };
};
CLICK_ENDDECLS
#endif