diff options
author | Luca <deri@ntop.org> | 2019-11-05 08:21:31 +0000 |
---|---|---|
committer | Luca <deri@ntop.org> | 2019-11-05 08:21:31 +0000 |
commit | 6298ecc2718a74a7e5c92e57af464d97c3a60bf9 (patch) | |
tree | 6c496a11cb045ad47572aa80d79a3aaf89c9f21d /src | |
parent | 75302a10bd24556e0a0f50b0de905ad4c46ad8c7 (diff) |
Added tunnelling decapsulation
Diffstat (limited to 'src')
-rw-r--r-- | src/include/ndpi_api.h | 1 | ||||
-rw-r--r-- | src/include/ndpi_typedefs.h | 7 | ||||
-rw-r--r-- | src/lib/ndpi_utils.c | 22 |
3 files changed, 30 insertions, 0 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index a1c33b36e..b049755ab 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -818,6 +818,7 @@ extern "C" { struct ndpi_flow_struct *flow); u_int8_t ndpi_is_safe_ssl_cipher(u_int32_t cipher); const char* ndpi_cipher2str(u_int32_t cipher); + const char* ndpi_tunnel2str(ndpi_packet_tunnel tt); u_int16_t ndpi_guess_host_protocol_id(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow); int ndpi_has_human_readeable_string(struct ndpi_detection_module_struct *ndpi_struct, diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 04e439221..1e71ee89e 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -42,6 +42,13 @@ typedef enum { ndpi_l4_proto_tcp_and_udp, } ndpi_l4_proto_info; +typedef enum { + ndpi_no_tunnel = 0, + ndpi_gtp_tunnel, + ndpi_capwap_tunnel, + ndpi_tzsp_tunnel, +} ndpi_packet_tunnel; + /* NDPI_VISIT */ typedef enum { ndpi_preorder, diff --git a/src/lib/ndpi_utils.c b/src/lib/ndpi_utils.c index f11f074cd..091cac927 100644 --- a/src/lib/ndpi_utils.c +++ b/src/lib/ndpi_utils.c @@ -1072,3 +1072,25 @@ int ndpi_flow2json(struct ndpi_detection_module_struct *ndpi_struct, } /* ********************************** */ + +const char* ndpi_tunnel2str(ndpi_packet_tunnel tt) { + switch(tt) { + case ndpi_no_tunnel: + return("No-Tunnel"); + break; + + case ndpi_gtp_tunnel: + return("GTP"); + break; + + case ndpi_capwap_tunnel: + return("CAPWAP"); + break; + + case ndpi_tzsp_tunnel: + return("TZSP"); + break; + } +} + +/* ********************************** */ |