aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/soap.c
diff options
context:
space:
mode:
authorToni <matzeton@googlemail.com>2022-06-18 17:19:16 +0200
committerGitHub <noreply@github.com>2022-06-18 17:19:16 +0200
commitc287eb835b537ce64d9293a52ca13e670b6d3b0d (patch)
tree733bf6222431bc8a9acd5fac6a72d47ef9420dab /src/lib/protocols/soap.c
parent6cd8f8cc6dded6e872f8befaf63c18266d5bcabc (diff)
Improved SOAP via HTTP. (#1605)
Signed-off-by: lns <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/protocols/soap.c')
-rw-r--r--src/lib/protocols/soap.c28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/lib/protocols/soap.c b/src/lib/protocols/soap.c
index da8d10fef..8ba885974 100644
--- a/src/lib/protocols/soap.c
+++ b/src/lib/protocols/soap.c
@@ -27,7 +27,14 @@
static void ndpi_int_soap_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow)
{
- ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOAP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
+ if (flow->guessed_host_protocol_id == NDPI_PROTOCOL_HTTP)
+ {
+ ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SOAP, NDPI_PROTOCOL_HTTP,
+ NDPI_CONFIDENCE_DPI);
+ } else {
+ ndpi_set_detected_protocol(ndpi_struct, flow, flow->guessed_host_protocol_id, NDPI_PROTOCOL_SOAP,
+ NDPI_CONFIDENCE_DPI);
+ }
}
void ndpi_search_soap(struct ndpi_detection_module_struct *ndpi_struct,
@@ -37,6 +44,25 @@ void ndpi_search_soap(struct ndpi_detection_module_struct *ndpi_struct,
NDPI_LOG_DBG(ndpi_struct, "search soap\n");
+ if (packet->parsed_lines == 0)
+ {
+ ndpi_parse_packet_line_info(ndpi_struct, flow);
+ }
+
+ if (packet->parsed_lines > 0)
+ {
+ size_t i;
+
+ for (i = 0; i < packet->parsed_lines && packet->line[i].len > 0; ++i)
+ {
+ if (LINE_STARTS(packet->line[i], "SOAPAction") != 0)
+ {
+ ndpi_int_soap_add_connection(ndpi_struct, flow);
+ return;
+ }
+ }
+ }
+
if (flow->packet_counter > 3)
{
if (flow->l4.tcp.soap_stage == 1)