aboutsummaryrefslogtreecommitdiff
path: root/example
diff options
context:
space:
mode:
authorToni Uhlig <matzeton@googlemail.com>2023-07-07 03:50:03 +0200
committerToni Uhlig <matzeton@googlemail.com>2023-08-01 00:46:15 +0200
commitc52d9d3c7f045a6a6fc5839486eb55e528323a2e (patch)
tree3512973535ebd78fb883603b2740bf8b3912b6d0 /example
parent5019022e13ac1f807d818ab4c8d6aafc1bd7d66d (diff)
Add Service Location Protocol dissector.add/service-location-protocol-dissector
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'example')
-rw-r--r--example/reader_util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/example/reader_util.c b/example/reader_util.c
index 7144626ca..a70390d9c 100644
--- a/example/reader_util.c
+++ b/example/reader_util.c
@@ -1198,6 +1198,21 @@ void process_ndpi_collected_info(struct ndpi_workflow * workflow, struct ndpi_fl
ndpi_snprintf(flow->softether.fqdn, sizeof(flow->softether.fqdn), "%s",
flow->ndpi_flow->protos.softether.fqdn);
}
+ /* SERVICE_LOCATION */
+ else if(is_ndpi_proto(flow, NDPI_PROTOCOL_SERVICE_LOCATION)) {
+ flow->info_type = INFO_GENERIC;
+ flow->info[0] = 0;
+ if (flow->ndpi_flow->protos.slp.url_count > 0)
+ strncat(flow->info, "URL(s): ", sizeof(flow->info));
+ for (size_t i = 0; i < flow->ndpi_flow->protos.slp.url_count; ++i) {
+ size_t length = strlen(flow->info);
+ strncat(flow->info + length, flow->ndpi_flow->protos.slp.url[i],
+ sizeof(flow->info) - length);
+ length = strlen(flow->info);
+ if (i < (size_t)flow->ndpi_flow->protos.slp.url_count - 1)
+ strncat(flow->info + length, ", ", sizeof(flow->info) - length);
+ }
+ }
/* NATPMP */
else if(is_ndpi_proto(flow, NDPI_PROTOCOL_NATPMP)) {
flow->info_type = INFO_NATPMP;