-
Notifications
You must be signed in to change notification settings - Fork 22
/
HTTP2_HeaderStorage.h
executable file
·93 lines (79 loc) · 2.32 KB
/
HTTP2_HeaderStorage.h
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
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
// Generated by binpac_quickstart
#ifndef ANALYZER_PROTOCOL_HTTP2_HTTP2_HEADER_STORAGE_H
#define ANALYZER_PROTOCOL_HTTP2_HTTP2_HEADER_STORAGE_H
#include "zeek/ZeekString.h"
#include "zeek/util.h"
#include "zeek/Val.h"
#include "nghttp2.h"
#include "nghttp2ver.h"
namespace analyzer { namespace mitrecnd {
struct HTTP2_HeaderStorage {
HTTP2_HeaderStorage(std::string& name, std::string& value);
HTTP2_HeaderStorage(const HTTP2_HeaderStorage& orig);
~HTTP2_HeaderStorage()=default;
std::string name;
std::string val;
};
class HTTP2_HeaderList {
public:
HTTP2_HeaderList();
~HTTP2_HeaderList();
/**
* void HTTP2_HeaderList::addHeader(std::string& name,
* std::string& value)
*
* Description: Create and add a HTTP2_HeaderStorage object to
* the List.
*
*
* @param name
* @param value
*/
void addHeader(std::string& name, std::string& value);
/**
* void HTTP2_HeaderList::addHeader(HTTP2_HeaderStorage *header)
*
* Description: Add an existing HTTP2_HeaderStorage object to
* the List.
*
*
* @param header
*/
void addHeader(HTTP2_HeaderStorage& header);
void addHeader(HTTP2_HeaderStorage&& header);
/**
* void HTTP2_HeaderList::flushHeaders()
*
* Description: Remove all the HTTP2_HeaderStorage objects from
* the list and delete their instances.
*
*
*/
void flushHeaders();
/**
* zeek::RecordValPtr
* HTTP2_HeaderList::BuildHeaderVal(HTTP2_HeaderStorage h)
*
* Description: Create a header record entry for use when
* building a header table to be consumed by zeek.
*
*
* @param h reference to the header storage
* structure to use when building the
* header record entry.
*
* @return zeek::RecordValPtr reference to resulting header record.
*/
zeek::RecordValPtr BuildHeaderVal(HTTP2_HeaderStorage& h);
/**
* TableVal* HTTP2_HeaderList::BuildHeaderTable(void)
*
* Description: Create a header table to be consumed by zeek.
*
* @return TableVal* reference to the resulting header table
*/
zeek::TableValPtr BuildHeaderTable(void);
std::vector<HTTP2_HeaderStorage> headers;
};
} } // namespace analyzer::*
#endif