Skip to content

Commit 006f091

Browse files
committed
Adjust SMTP plugin
1 parent 02aae48 commit 006f091

File tree

2 files changed

+9
-7
lines changed

2 files changed

+9
-7
lines changed

process/smtp.cpp

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,27 +66,29 @@ ProcessPlugin *SMTPPlugin::copy()
6666
return new SMTPPlugin(*this);
6767
}
6868

69-
int SMTPPlugin::post_create(Flow &rec, const Packet &pkt)
69+
ProcessPlugin::FlowAction SMTPPlugin::post_create(Flow &rec, const Packet &pkt)
7070
{
7171
if (pkt.src_port == 25 || pkt.dst_port == 25) {
7272
create_smtp_record(rec, pkt);
73+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
7374
}
7475

75-
return 0;
76+
return ProcessPlugin::FlowAction::NO_PROCESS;
7677
}
7778

78-
int SMTPPlugin::pre_update(Flow &rec, Packet &pkt)
79+
ProcessPlugin::FlowAction SMTPPlugin::pre_update(Flow &rec, Packet &pkt)
7980
{
8081
if (pkt.src_port == 25 || pkt.dst_port == 25) {
8182
RecordExt *ext = rec.get_extension(RecordExtSMTP::REGISTERED_ID);
8283
if (ext == nullptr) {
8384
create_smtp_record(rec, pkt);
84-
return 0;
85+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
8586
}
8687
update_smtp_record(static_cast<RecordExtSMTP *>(ext), pkt);
88+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
8789
}
8890

89-
return 0;
91+
return ProcessPlugin::FlowAction::NO_PROCESS;
9092
}
9193

9294
char *strncasestr(const char *str, size_t n, const char *substr)

process/smtp.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -241,8 +241,8 @@ class SMTPPlugin : public ProcessPlugin
241241
RecordExt *get_ext() const { return new RecordExtSMTP(); }
242242
ProcessPlugin *copy();
243243

244-
int post_create(Flow &rec, const Packet &pkt);
245-
int pre_update(Flow &rec, Packet &pkt);
244+
ProcessPlugin::FlowAction post_create(Flow &rec, const Packet &pkt);
245+
ProcessPlugin::FlowAction pre_update(Flow &rec, Packet &pkt);
246246
void finish(bool print_stats);
247247

248248
bool smtp_keyword(const char *data);

0 commit comments

Comments
 (0)