Merge in SNORT/snort3 from ~SUBALU/snort3:msp to master
Squashed commit of the following:
commit
413d157d7b743f18d98d42f0ca41c58735a31563
Author: suriya <subalu@cisco.com>
Date: Mon May 15 16:55:40 2023 +0530
appid: add support for cip multiple service packet
#include "appid_cip_event_handler.h"
#include "detector_plugins/cip_patterns.h"
+#include "service_inspectors/cip/cip.h"
#include "appid_debug.h"
using namespace snort;
AppId payload_id = asd->get_odp_ctxt().get_cip_matchers().get_cip_payload_id(event_data);
asd->set_payload_id(payload_id);
asd->set_ss_application_ids(APP_ID_CIP, APP_ID_CIP, payload_id, APP_ID_NONE, APP_ID_NONE, change_bits);
-
+ asd->set_cip_msp(event_data->multipayload);
+
if (change_bits[APPID_PAYLOAD_BIT] and appidDebug->is_enabled())
{
appidDebug->activate(flow, asd, inspector.get_ctxt().config.log_all_sessions);
{
return client_info_unpublished;
}
+
+ void set_cip_msp(bool multipayload)
+ {
+ cip_msp = multipayload;
+ }
+
+ bool is_cip_msp() const
+ {
+ return cip_msp;
+ }
+
private:
uint16_t prev_httpx_raw_packet = 0;
bool no_service_candidate = false;
bool no_service_inspector = false;
bool client_info_unpublished = false;
+ bool cip_msp = false;
};
#endif
return true;
}
+ if ( get_service_app_id() == APP_ID_CIP and asd->is_cip_msp())
+ {
+ return true;
+ }
+
if (asd->get_odp_ctxt().check_host_port_app_cache)
return true;
// CIP_DATA_TYPE_SET_ATTRIBUTE
uint8_t service_id;
+ // Set when the packet is a multiple service packet
+ bool multipayload;
+
// Used for:
// CIP_DATA_TYPE_PATH_CLASS: This represents the Request Path Class.
// CIP_DATA_TYPE_SET_ATTRIBUTE: This represents the Request Path Class.
pack_cip_request_event(&embedded_request, &cip_event_data);
+ if (i != number_services)
+ cip_event_data.multipayload = true;
+ else
+ cip_event_data.multipayload = false;
+
DataBus::publish(CipEventData::pub_id, CipEventIds::DATA, cip_event, global_data->snort_packet->flow);
}