Skip to content

Commit 1eb931a

Browse files
committed
SSADetector: Added pkt entry structure
1 parent 67093e7 commit 1eb931a

File tree

2 files changed

+30
-1
lines changed

2 files changed

+30
-1
lines changed

process/ssadetector.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,24 @@ int SSADetectorPlugin::post_update(Flow &rec, const Packet &pkt)
100100

101101
void SSADetectorPlugin::pre_export(Flow &rec)
102102
{
103+
//--------------------RecordExtSSADetector::pkt_entry-------------------------------
104+
void RecordExtSSADetector::pkt_entry::reset()
105+
{
106+
ts_dir1.tv_sec = 0;
107+
ts_dir1.tv_usec = 0;
108+
ts_dir2.tv_sec = 0;
109+
ts_dir2.tv_usec = 0;
110+
}
111+
112+
timeval& RecordExtSSADetector::pkt_entry::get_time(dir_t dir)
113+
{
114+
return (dir == 1)? ts_dir1 : ts_dir2;
115+
}
116+
117+
RecordExtSSADetector::pkt_entry::pkt_entry()
118+
{
119+
reset();
120+
}
103121
}
104122

105123
}

process/ssadetector.hpp

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,13 +64,24 @@ UR_FIELDS (
6464
uint8 SSA_CONF_LEVEL
6565
)
6666

67+
using dir_t = uint8_t;
6768
/**
6869
* \brief Flow record extension header for storing parsed SSADETECTOR data.
6970
*/
7071
struct RecordExtSSADetector : public RecordExt {
7172
static int REGISTERED_ID;
7273

73-
uint8_t possible_vpn;
74+
75+
struct pkt_entry
76+
{
77+
pkt_entry();
78+
void reset();
79+
timeval& get_time(dir_t dir);
80+
81+
timeval ts_dir1;
82+
timeval ts_dir2;
83+
84+
};
7485

7586
RecordExtSSADetector() : RecordExt(REGISTERED_ID)
7687
{

0 commit comments

Comments
 (0)