Moved RTSP http patterns to the protocol source file.
Signed-off-by: lns <matzeton@googlemail.com>
This commit is contained in:
@@ -986,6 +986,7 @@ static void ndpi_init_protocol_defaults(struct ndpi_detection_module_struct *ndp
|
|||||||
NDPI_PROTOCOL_MAPLESTORY, NDPI_PROTOCOL_ZATTOO, NDPI_PROTOCOL_WORLDOFWARCRAFT,
|
NDPI_PROTOCOL_MAPLESTORY, NDPI_PROTOCOL_ZATTOO, NDPI_PROTOCOL_WORLDOFWARCRAFT,
|
||||||
NDPI_PROTOCOL_THUNDER, NDPI_PROTOCOL_IRC,
|
NDPI_PROTOCOL_THUNDER, NDPI_PROTOCOL_IRC,
|
||||||
NDPI_PROTOCOL_IPP,
|
NDPI_PROTOCOL_IPP,
|
||||||
|
NDPI_PROTOCOL_RTSP,
|
||||||
NDPI_PROTOCOL_MATCHED_BY_CONTENT,
|
NDPI_PROTOCOL_MATCHED_BY_CONTENT,
|
||||||
NDPI_PROTOCOL_NO_MORE_SUBPROTOCOLS); /* NDPI_PROTOCOL_HTTP can have (content-matched) subprotocols */
|
NDPI_PROTOCOL_NO_MORE_SUBPROTOCOLS); /* NDPI_PROTOCOL_HTTP can have (content-matched) subprotocols */
|
||||||
ndpi_set_proto_defaults(ndpi_str, 1 /* cleartext */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_MDNS,
|
ndpi_set_proto_defaults(ndpi_str, 1 /* cleartext */, NDPI_PROTOCOL_ACCEPTABLE, NDPI_PROTOCOL_MDNS,
|
||||||
|
|||||||
@@ -361,20 +361,6 @@ static void ndpi_int_http_add_connection(struct ndpi_detection_module_struct *nd
|
|||||||
|
|
||||||
/* ************************************************************* */
|
/* ************************************************************* */
|
||||||
|
|
||||||
static void rtsp_parse_packet_acceptline(struct ndpi_detection_module_struct
|
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
|
||||||
{
|
|
||||||
struct ndpi_packet_struct *packet = &ndpi_struct->packet;
|
|
||||||
|
|
||||||
if((packet->accept_line.len >= 28)
|
|
||||||
&& (memcmp(packet->accept_line.ptr, "application/x-rtsp-tunnelled", 28) == 0)) {
|
|
||||||
NDPI_LOG_INFO(ndpi_struct, "found RTSP accept line\n");
|
|
||||||
ndpi_int_http_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_RTSP, NDPI_PROTOCOL_CATEGORY_MEDIA);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/* ************************************************************* */
|
|
||||||
|
|
||||||
static void setHttpUserAgent(struct ndpi_detection_module_struct *ndpi_struct,
|
static void setHttpUserAgent(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
struct ndpi_flow_struct *flow, char *ua) {
|
struct ndpi_flow_struct *flow, char *ua) {
|
||||||
if( !strcmp(ua, "Windows NT 5.0")) ua = "Windows 2000";
|
if( !strcmp(ua, "Windows NT 5.0")) ua = "Windows 2000";
|
||||||
@@ -764,10 +750,6 @@ static void check_content_type_and_change_protocol(struct ndpi_detection_module_
|
|||||||
if(packet->accept_line.ptr != NULL) {
|
if(packet->accept_line.ptr != NULL) {
|
||||||
NDPI_LOG_DBG2(ndpi_struct, "Accept line found %.*s\n",
|
NDPI_LOG_DBG2(ndpi_struct, "Accept line found %.*s\n",
|
||||||
packet->accept_line.len, packet->accept_line.ptr);
|
packet->accept_line.len, packet->accept_line.ptr);
|
||||||
if(NDPI_COMPARE_PROTOCOL_TO_BITMASK(ndpi_struct->detection_bitmask,
|
|
||||||
NDPI_PROTOCOL_RTSP) != 0) {
|
|
||||||
rtsp_parse_packet_acceptline(ndpi_struct, flow);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* check for authorization line */
|
/* check for authorization line */
|
||||||
|
|||||||
@@ -50,7 +50,9 @@ void ndpi_search_rtsp_tcp_udp(struct ndpi_detection_module_struct
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (packet->parsed_lines > 0 &&
|
if (packet->parsed_lines > 0 &&
|
||||||
LINE_ENDS(packet->line[0], "RTSP/1.0") != 0)
|
(LINE_ENDS(packet->line[0], "RTSP/1.0") != 0 ||
|
||||||
|
LINE_ENDS(packet->accept_line, "application/x-rtsp-tunnelled") != 0 ||
|
||||||
|
LINE_ENDS(packet->content_line, "application/x-rtsp-tunnelled") != 0))
|
||||||
{
|
{
|
||||||
ndpi_int_rtsp_add_connection(ndpi_struct, flow);
|
ndpi_int_rtsp_add_connection(ndpi_struct, flow);
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user