*
*/
int ExpectCache::add_flow(const Packet *ctrlPkt, PktType type, IpProtocol ip_proto,
- const SfIp* cliIP, uint16_t cliPort, const SfIp* srvIP, uint16_t srvPort,
- char direction, FlowData* fd, SnortProtocolId snort_protocol_id, bool swap_app_direction)
+ const SfIp* cliIP, uint16_t cliPort, const SfIp* srvIP, uint16_t srvPort, char direction,
+ FlowData* fd, SnortProtocolId snort_protocol_id, bool swap_app_direction, bool expect_multi)
{
/* Just pull the VLAN ID, MPLS ID, and Address Space ID from the
control packet until we have a use case for not doing so. */
PacketTracer::log("Create expected channel request sent with %s -> %s %hu %hhu\n",
dipstr, sipstr, srvPort, static_cast<uint8_t>(ip_proto));
}
+ unsigned flag = 0;
+ if (expect_multi)
+ flag |= DAQ_EFLOW_ALLOW_MULTIPLE;
ctrlPkt->daq_instance->add_expected(ctrlPkt, cliIP, cliPort, srvIP, srvPort,
- ip_proto, 1000, 0);
+ ip_proto, 1000, flag);
}
}
int add_flow(const snort::Packet *ctrlPkt, PktType, IpProtocol, const snort::SfIp* cliIP,
uint16_t cliPort, const snort::SfIp* srvIP, uint16_t srvPort, char direction,
snort::FlowData*, SnortProtocolId snort_protocol_id = UNKNOWN_PROTOCOL_ID,
- bool swap_app_direction = false);
+ bool swap_app_direction = false, bool expect_multi = false);
bool is_expected(snort::Packet*);
bool check(snort::Packet*, snort::Flow*);
int FlowControl::add_expected( const Packet* ctrlPkt, PktType type, IpProtocol ip_proto,
const SfIp *srcIP, uint16_t srcPort, const SfIp *dstIP, uint16_t dstPort,
- SnortProtocolId snort_protocol_id, FlowData* fd, bool swap_app_direction)
+ SnortProtocolId snort_protocol_id, FlowData* fd, bool swap_app_direction, bool expect_multi)
{
return exp_cache->add_flow( ctrlPkt, type, ip_proto, srcIP, srcPort, dstIP, dstPort,
- SSN_DIR_BOTH, fd, snort_protocol_id, swap_app_direction);
+ SSN_DIR_BOTH, fd, snort_protocol_id, swap_app_direction, expect_multi);
}
bool FlowControl::is_expected(Packet* p)
char direction, snort::FlowData*);
int add_expected(const snort::Packet* ctrlPkt, PktType, IpProtocol, const snort::SfIp *srcIP,
- uint16_t srcPort, const snort::SfIp *dstIP, uint16_t dstPort,
- SnortProtocolId snort_protocol_id, snort::FlowData*, bool swap_app_direction = false);
+ uint16_t srcPort, const snort::SfIp *dstIP, uint16_t dstPort, SnortProtocolId snort_protocol_id,
+ snort::FlowData*, bool swap_app_direction = false, bool expect_multi = false);
class ExpectCache* get_exp_cache()
{ return exp_cache; }
int ExpectCache::add_flow(const Packet*, PktType, IpProtocol, const SfIp*, uint16_t,
- const SfIp*, uint16_t, char, FlowData*, SnortProtocolId, bool)
+ const SfIp*, uint16_t, char, FlowData*, SnortProtocolId, bool, bool)
{
return 1;
}
PktType, IpProtocol,
const SfIp*, uint16_t,
const SfIp*, uint16_t,
- char, FlowData*, SnortProtocolId, bool)
+ char, FlowData*, SnortProtocolId, bool, bool)
{
return 1;
}
// FIXIT-L X Add Snort flag definitions for callers to use and translate/pass them through to
// the DAQ module
int SFDAQInstance::add_expected(const Packet* ctrlPkt, const SfIp* cliIP, uint16_t cliPort,
- const SfIp* srvIP, uint16_t srvPort, IpProtocol protocol, unsigned timeout_ms, unsigned /* flags */)
+ const SfIp* srvIP, uint16_t srvPort, IpProtocol protocol, unsigned timeout_ms, unsigned flags)
{
DIOCTL_CreateExpectedFlow d_cef;
key->vlan_cnots = 1;
d_cef.flags = 0;
+
+ if (flags & DAQ_EFLOW_ALLOW_MULTIPLE)
+ d_cef.flags |= DAQ_EFLOW_ALLOW_MULTIPLE;
+
/*
if (flags & DAQ_DC_FLOAT)
d_cef.flags |= DAQ_EFLOW_FLOAT;
int set_packet_trace_data(DAQ_Msg_h, uint8_t* buff, uint32_t buff_len);
int add_expected(const Packet* ctrlPkt, const SfIp* cliIP, uint16_t cliPort,
const SfIp* srvIP, uint16_t srvPort, IpProtocol, unsigned timeout_ms,
- unsigned /* flags */);
+ unsigned flags);
bool get_tunnel_bypass(uint16_t proto);
private:
const Packet* ctrlPkt, PktType type, IpProtocol ip_proto,
const SfIp* srcIP, uint16_t srcPort,
const SfIp* dstIP, uint16_t dstPort,
- SnortProtocolId snort_protocol_id, FlowData* fd, bool swap_app_direction)
+ SnortProtocolId snort_protocol_id, FlowData* fd, bool swap_app_direction, bool expect_multi)
{
assert(flow_con);
return flow_con->add_expected(
ctrlPkt, type, ip_proto, srcIP, srcPort, dstIP, dstPort, snort_protocol_id, fd,
- swap_app_direction);
+ swap_app_direction, expect_multi);
}
void Stream::set_snort_protocol_id_from_ha(
static int set_snort_protocol_id_expected(
const Packet* ctrlPkt, PktType, IpProtocol, const snort::SfIp* srcIP, uint16_t srcPort,
const snort::SfIp* dstIP, uint16_t dstPort, SnortProtocolId, FlowData*,
- bool swap_app_direction = false);
+ bool swap_app_direction = false, bool expect_multi = false);
// Get pointer to application data for a flow based on the lookup tuples for cases where
// Snort does not have an active packet that is relevant.