diff options
author | Toni <matzeton@googlemail.com> | 2023-08-01 08:50:46 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-08-01 08:50:46 +0200 |
commit | e4d3d619bc9fa2e38521b7ced17f4e7aa633d812 (patch) | |
tree | 10a64f1a9973ad1f4f25502c3c9e88a9749c87fd /example | |
parent | 083275f6176965a70d75911830f17ff019055131 (diff) |
Add Service Location Protocol dissector. (#2036)
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'example')
-rw-r--r-- | example/reader_util.c | 15 |
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; |