-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcustom_t.cpp
More file actions
42 lines (35 loc) · 916 Bytes
/
Copy pathcustom_t.cpp
File metadata and controls
42 lines (35 loc) · 916 Bytes
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
#include "custom_t.h"
#include "utils.h"
namespace custom {
CustomRFC::CustomRFC(const IParseable::type& res MAYBEUNUSED)
: IParseable<Result_t, CustomRFC>{res}
{
}
CustomRFC &CustomRFC::operator()(const IParseable::type& res)
{
struct EthL4 eth = utils::GetEthL4(res.data);
MAYBEUNUSED size_t offset = 0;
MAYBEUNUSED size_t total = res.out.len;
MAYBEUNUSED unsigned int payload_len = 0;
//TODO: custom type is not supported
switch (eth.type) {
FALLTROUGH;
case EthL4::TCP:
case EthL4::UDP:
case EthL4::UNKNOWN:
default:
break;
}
return *this;
}
CustomRFC &CustomRFC::operator()()
{
return this->operator()(this->value);
}
} // custom
//hint
#if 0
offset = eth.options_len + (sizeof(struct ether_header) + sizeof(struct ip) + sizeof(tcphdr));
MAYBEUNUSED const char *pdata = (const char*)res.data+offset;
break;
#endif