aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/rtp.c
diff options
context:
space:
mode:
authorLuca Deri <deri@ntop.org>2020-09-24 23:26:03 +0200
committerLuca Deri <deri@ntop.org>2020-09-24 23:26:03 +0200
commit044ed14b4f23708ec05f5b5c85ca29acbf4b59db (patch)
treea03aea7d48eb8ec6b5d83da71c7ab2c40fcbc10c /src/lib/protocols/rtp.c
parent51e86346d31f270099d4169cd2ebcb0146e5e593 (diff)
Various optimizations to reduce not-necessary calls
Optimized various UDP dissectors Removed dead protocols such as pando and pplive
Diffstat (limited to 'src/lib/protocols/rtp.c')
-rw-r--r--src/lib/protocols/rtp.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/lib/protocols/rtp.c b/src/lib/protocols/rtp.c
index acea41b54..fdf8d8b9f 100644
--- a/src/lib/protocols/rtp.c
+++ b/src/lib/protocols/rtp.c
@@ -76,6 +76,8 @@ static u_int8_t isValidMSRTPType(u_int8_t payloadType) {
static void ndpi_rtp_search(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
const u_int8_t * payload, const u_int16_t payload_len) {
+ u_int8_t payloadType, payload_type = payload[1] & 0x7F;
+
NDPI_LOG_DBG(ndpi_struct, "search RTP\n");
if((payload_len < 2) || flow->protos.stun_ssl.stun.num_binding_requests) {
@@ -83,9 +85,6 @@ static void ndpi_rtp_search(struct ndpi_detection_module_struct *ndpi_struct,
return;
}
- //struct ndpi_packet_struct *packet = &flow->packet;
- u_int8_t payloadType, payload_type = payload[1] & 0x7F;
-
/* Check whether this is an RTP flow */
if((payload_len >= 12)
&& (((payload[0] & 0xFF) == 0x80) || ((payload[0] & 0xFF) == 0xA0)) /* RTP magic byte[1] */
@@ -105,13 +104,6 @@ static void ndpi_rtp_search(struct ndpi_detection_module_struct *ndpi_struct,
NDPI_LOG_INFO(ndpi_struct, "Found Skype for Business (former MS Lync)\n");
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_SKYPE, NDPI_PROTOCOL_UNKNOWN);
return;
- } else /* RTCP */ {
-#if 0
- /* If it's RTCP the RTCP decoder will catch it */
- NDPI_LOG_INFO(ndpi_struct, "Found MS RTCP\n");
- ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_RTCP, NDPI_PROTOCOL_UNKNOWN);
- return;
-#endif
}
}
@@ -136,6 +128,8 @@ void ndpi_search_rtp(struct ndpi_detection_module_struct *ndpi_struct, struct nd
&& (dest > 1023)
)
ndpi_rtp_search(ndpi_struct, flow, packet->payload, packet->payload_packet_len);
+ else
+ NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
}
/* *************************************************************** */