Skip to content

Commit 5d65df2

Browse files
committed
Adjust RTSP plugin
1 parent 9aa8853 commit 5d65df2

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

process/rtsp.cpp

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -94,49 +94,51 @@ ProcessPlugin *RTSPPlugin::copy()
9494
return new RTSPPlugin(*this);
9595
}
9696

97-
int RTSPPlugin::post_create(Flow &rec, const Packet &pkt)
97+
ProcessPlugin::FlowAction RTSPPlugin::post_create(Flow &rec, const Packet &pkt)
9898
{
9999
const char *payload = reinterpret_cast<const char *>(pkt.payload);
100100
if (is_request(payload, pkt.payload_len)) {
101101
add_ext_rtsp_request(payload, pkt.payload_len, rec);
102+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
102103
} else if (is_response(payload, pkt.payload_len)) {
103104
add_ext_rtsp_response(payload, pkt.payload_len, rec);
105+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
104106
}
105107

106-
return 0;
108+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
107109
}
108110

109-
int RTSPPlugin::pre_update(Flow &rec, Packet &pkt)
111+
ProcessPlugin::FlowAction RTSPPlugin::pre_update(Flow &rec, Packet &pkt)
110112
{
111113
RecordExt *ext = nullptr;
112114
const char *payload = reinterpret_cast<const char *>(pkt.payload);
113115
if (is_request(payload, pkt.payload_len)) {
114116
ext = rec.get_extension(RecordExtRTSP::REGISTERED_ID);
115117
if (ext == nullptr) { /* Check if header is present in flow. */
116118
add_ext_rtsp_request(payload, pkt.payload_len, rec);
117-
return 0;
119+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
118120
}
119121

120122
parse_rtsp_request(payload, pkt.payload_len, static_cast<RecordExtRTSP *>(ext));
121123
if (flow_flush) {
122124
flow_flush = false;
123-
return FLOW_FLUSH_WITH_REINSERT;
125+
return ProcessPlugin::FlowAction::FLUSH_WITH_REINSERT;
124126
}
125127
} else if (is_response(payload, pkt.payload_len)) {
126128
ext = rec.get_extension(RecordExtRTSP::REGISTERED_ID);
127129
if (ext == nullptr) { /* Check if header is present in flow. */
128130
add_ext_rtsp_response(payload, pkt.payload_len, rec);
129-
return 0;
131+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
130132
}
131133

132134
parse_rtsp_response(payload, pkt.payload_len, static_cast<RecordExtRTSP *>(ext));
133135
if (flow_flush) {
134136
flow_flush = false;
135-
return FLOW_FLUSH_WITH_REINSERT;
137+
return ProcessPlugin::FlowAction::FLUSH_WITH_REINSERT;
136138
}
137139
}
138140

139-
return 0;
141+
return ProcessPlugin::FlowAction::GET_ALL_DATA;
140142
}
141143

142144
void RTSPPlugin::finish(bool print_stats)

process/rtsp.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ class RTSPPlugin : public ProcessPlugin
202202
RecordExt *get_ext() const { return new RecordExtRTSP(); }
203203
ProcessPlugin *copy();
204204

205-
int post_create(Flow &rec, const Packet &pkt);
206-
int pre_update(Flow &rec, Packet &pkt);
205+
ProcessPlugin::FlowAction post_create(Flow &rec, const Packet &pkt);
206+
ProcessPlugin::FlowAction pre_update(Flow &rec, Packet &pkt);
207207
void finish(bool print_stats);
208208

209209
private:

0 commit comments

Comments
 (0)