p->ts.tv_sec = parent->ts.tv_sec;
p->ts.tv_usec = parent->ts.tv_usec;
p->datalink = DLT_RAW;
+ p->tenant_id = parent->tenant_id;
/* set the root ptr to the lowest layer */
if (parent->root != NULL)
p->ts.tv_sec = parent->ts.tv_sec;
p->ts.tv_usec = parent->ts.tv_usec;
p->datalink = DLT_RAW;
+ p->tenant_id = parent->tenant_id;
/* tell new packet it's part of a tunnel */
SET_TUNNEL_PKT(p);
p->vlan_id[0] = parent->vlan_id[0];
FLOWLOCK_WRLOCK(pflow);
{
+ /* store tenant_id in the flow so that we can use it
+ * for creating pseudo packets */
+ if (p->tenant_id > 0 && pflow->tenant_id == 0) {
+ pflow->tenant_id = p->tenant_id;
+ }
+
/* live ruleswap check for flow updates */
if (pflow->de_ctx_id == 0) {
/* first time this flow is inspected, set id */
return TM_ECODE_OK;
}
- uint32_t tenant_id = det_ctx->TenantGetId(det_ctx, p);
+ uint32_t tenant_id = p->tenant_id;
+ if (tenant_id == 0)
+ tenant_id = det_ctx->TenantGetId(det_ctx, p);
if (tenant_id > 0 && tenant_id < det_ctx->mt_det_ctxs_cnt) {
p->tenant_id = tenant_id;
det_ctx = GetTenantById(det_ctx->mt_det_ctxs_hash, tenant_id);
TcpSession *ssn,
int dummy)
{
+ p->tenant_id = f->tenant_id;
p->datalink = DLT_RAW;
p->proto = IPPROTO_TCP;
FlowReference(&p->flow, f);
(f)->proto = 0; \
SC_ATOMIC_INIT((f)->flow_state); \
SC_ATOMIC_INIT((f)->use_cnt); \
+ (f)->tenant_id = 0; \
(f)->probing_parser_toserver_alproto_masks = 0; \
(f)->probing_parser_toclient_alproto_masks = 0; \
(f)->flags = 0; \
(f)->proto = 0; \
SC_ATOMIC_RESET((f)->flow_state); \
SC_ATOMIC_RESET((f)->use_cnt); \
+ (f)->tenant_id = 0; \
(f)->probing_parser_toserver_alproto_masks = 0; \
(f)->probing_parser_toclient_alproto_masks = 0; \
(f)->flags = 0; \
/** flow queue id, used with autofp */
SC_ATOMIC_DECLARE(int16_t, autofp_tmqh_flow_qid);
+ /** flow tenant id, used to setup flow timeout and stream pseudo
+ * packets with the correct tenant id set */
+ uint32_t tenant_id;
+
uint32_t probing_parser_toserver_alproto_masks;
uint32_t probing_parser_toclient_alproto_masks;
/* Setup the IP and TCP headers */
StreamTcpPseudoPacketSetupHeader(np,p);
+ np->tenant_id = p->flow->tenant_id;
+
np->flowflags = p->flowflags;
np->flags |= PKT_STREAM_EST;