flow: add parent_id field

This patch adds a parent_id field to the Flow structure that
contain the flow ID of the parent connection for protocol with
dynamic parallel connection opening like FTP.
pull/3108/head
Eric Leblond 8 years ago committed by Victor Julien
parent 5be5e7c879
commit 2d68050e60

@ -43,6 +43,7 @@
SC_ATOMIC_INIT((f)->flow_state); \
SC_ATOMIC_INIT((f)->use_cnt); \
(f)->tenant_id = 0; \
(f)->parent_id = 0; \
(f)->probing_parser_toserver_alproto_masks = 0; \
(f)->probing_parser_toclient_alproto_masks = 0; \
(f)->flags = 0; \
@ -85,6 +86,7 @@
SC_ATOMIC_RESET((f)->flow_state); \
SC_ATOMIC_RESET((f)->use_cnt); \
(f)->tenant_id = 0; \
(f)->parent_id = 0; \
(f)->probing_parser_toserver_alproto_masks = 0; \
(f)->probing_parser_toclient_alproto_masks = 0; \
(f)->flags = 0; \

@ -361,6 +361,9 @@ typedef struct Flow_
uint32_t flags; /**< generic flags */
/* Parent flow id for protocol like ftp */
int64_t parent_id;
uint16_t file_flags; /**< file tracking/extraction flags */
/* coccinelle: Flow:file_flags:FLOWFILE_ */

@ -387,6 +387,9 @@ void CreateJSONFlowId(json_t *js, const Flow *f)
return;
int64_t flow_id = FlowGetId(f);
json_object_set_new(js, "flow_id", json_integer(flow_id));
if (f->parent_id) {
json_object_set_new(js, "parent_id", json_integer(f->parent_id));
}
}
json_t *CreateJSONHeader(const Packet *p, int direction_sensitive,

Loading…
Cancel
Save