diff options
author | Luca Deri <deri@ntop.org> | 2023-06-14 23:44:57 +0200 |
---|---|---|
committer | Luca Deri <deri@ntop.org> | 2023-06-14 23:44:57 +0200 |
commit | d0609ea601f6e0e9fac7cfe622d07e41f0129e89 (patch) | |
tree | 7c94c0dabb6d119ee37ee451a72f0791ec5ef93f /src/lib/protocols | |
parent | 66bee475ae1b1f4b1b4104555b7bb4d38c3e20b6 (diff) |
Implemented Zoom/Teams stream type detection
Diffstat (limited to 'src/lib/protocols')
-rw-r--r-- | src/lib/protocols/rtp.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/src/lib/protocols/rtp.c b/src/lib/protocols/rtp.c index a0d6352f7..c727cca58 100644 --- a/src/lib/protocols/rtp.c +++ b/src/lib/protocols/rtp.c @@ -105,7 +105,8 @@ PACK_ON struct zoom_media_encapsulation { #define ZOOM_PORT 8801 -static u_int8_t isZoom(u_int16_t sport, u_int16_t dport, +static u_int8_t isZoom(struct ndpi_flow_struct *flow, + u_int16_t sport, u_int16_t dport, const u_int8_t *payload, const u_int16_t payloadLen, u_int8_t *is_rtp, u_int8_t *zoom_stream_type, u_int16_t *payload_offset) { @@ -118,7 +119,7 @@ static u_int8_t isZoom(u_int16_t sport, u_int16_t dport, if((sport == ZOOM_PORT) || (dport == ZOOM_PORT)) { struct zoom_sfu_encapsulation *enc = (struct zoom_sfu_encapsulation*)payload; - /* traceEvent(TRACE_NORMAL, "==> %u <-> %u [type: %u]", sport, dport, enc->sfu_type); */ + /* printf("==> %u <-> %u [type: %u]\n", sport, dport, enc->sfu_type); */ if((enc->sfu_type >= 3) && (enc->sfu_type <= 5)) { struct zoom_media_encapsulation *enc = (struct zoom_media_encapsulation*)(&payload[sizeof(struct zoom_sfu_encapsulation)]); @@ -130,16 +131,19 @@ static u_int8_t isZoom(u_int16_t sport, u_int16_t dport, case 30: /* Screen Share */ *is_rtp = 0; *payload_offset = 27; + flow->zoom.flow_type = ndpi_multimedia_screen_sharing_flow; break; case 15: /* Audio */ *is_rtp = 1; *payload_offset = 27; + flow->zoom.flow_type = ndpi_multimedia_audio_flow; break; case 16: /* Video */ *is_rtp = 1; *payload_offset = 32; + flow->zoom.flow_type = ndpi_multimedia_video_flow; break; case 33: /* RTCP */ @@ -181,7 +185,7 @@ static void ndpi_rtp_search(struct ndpi_detection_module_struct *ndpi_struct, return; } - if(isZoom(s_port, d_port, payload, payload_len, + if(isZoom(flow, s_port, d_port, payload, payload_len, &is_rtp, &zoom_stream_type, &payload_offset)) { if(payload_offset < payload_len) { /* |