Skip to content

Commit 26768f2

Browse files
committed
Adjust PassiveDNS plugin
1 parent cad6b58 commit 26768f2

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

process/passivedns.cpp

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,22 +107,22 @@ ProcessPlugin *PassiveDNSPlugin::copy()
107107
return new PassiveDNSPlugin(*this);
108108
}
109109

110-
int PassiveDNSPlugin::post_create(Flow &rec, const Packet &pkt)
110+
ProcessPlugin::FlowAction PassiveDNSPlugin::post_create(Flow &rec, const Packet &pkt)
111111
{
112112
if (pkt.src_port == 53) {
113113
return add_ext_dns(reinterpret_cast<const char *>(pkt.payload), pkt.payload_len, pkt.ip_proto == IPPROTO_TCP, rec);
114114
}
115115

116-
return 0;
116+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
117117
}
118118

119-
int PassiveDNSPlugin::post_update(Flow &rec, const Packet &pkt)
119+
ProcessPlugin::FlowAction PassiveDNSPlugin::post_update(Flow &rec, const Packet &pkt)
120120
{
121121
if (pkt.src_port == 53) {
122122
return add_ext_dns(reinterpret_cast<const char *>(pkt.payload), pkt.payload_len, pkt.ip_proto == IPPROTO_TCP, rec);
123123
}
124124

125-
return 0;
125+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
126126
}
127127

128128
void PassiveDNSPlugin::finish(bool print_stats)
@@ -494,14 +494,14 @@ bool PassiveDNSPlugin::process_ptr_record(std::string name, RecordExtPassiveDNS
494494
* \param [in] tcp DNS over tcp.
495495
* \param [out] rec Destination Flow.
496496
*/
497-
int PassiveDNSPlugin::add_ext_dns(const char *data, unsigned int payload_len, bool tcp, Flow &rec)
497+
ProcessPlugin::FlowAction PassiveDNSPlugin::add_ext_dns(const char *data, unsigned int payload_len, bool tcp, Flow &rec)
498498
{
499499
RecordExt *tmp = parse_dns(data, payload_len, tcp);
500500
if (tmp != nullptr) {
501501
rec.add_extension(tmp);
502502
}
503503

504-
return FLOW_FLUSH;
504+
return ProcessPlugin::FlowAction::FLUSH;
505505
}
506506

507507
}

process/passivedns.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -168,8 +168,8 @@ class PassiveDNSPlugin : public ProcessPlugin
168168
std::string get_name() const { return "passivedns"; }
169169
RecordExt *get_ext() const { return new RecordExtPassiveDNS(); }
170170
ProcessPlugin *copy();
171-
int post_create(Flow &rec, const Packet &pkt);
172-
int post_update(Flow &rec, const Packet &pkt);
171+
ProcessPlugin::FlowAction post_create(Flow &rec, const Packet &pkt);
172+
ProcessPlugin::FlowAction post_update(Flow &rec, const Packet &pkt);
173173
void finish(bool print_stats);
174174

175175
private:
@@ -182,7 +182,7 @@ class PassiveDNSPlugin : public ProcessPlugin
182182
uint32_t data_len; /**< Length of packet payload. */
183183

184184
RecordExtPassiveDNS *parse_dns(const char *data, unsigned int payload_len, bool tcp);
185-
int add_ext_dns(const char *data, unsigned int payload_len, bool tcp, Flow &rec);
185+
ProcessPlugin::FlowAction add_ext_dns(const char *data, unsigned int payload_len, bool tcp, Flow &rec);
186186

187187
std::string get_name(const char *data) const;
188188
size_t get_name_length(const char *data) const;

0 commit comments

Comments
 (0)