@@ -46,55 +46,12 @@ static u_int8_t ndpi_check_for_NOTICE_or_PRIVMSG(struct ndpi_detection_module_st
4646 return 0 ;
4747}
4848
49- static u_int8_t ndpi_check_for_Nickname (struct ndpi_detection_module_struct * ndpi_struct )
50- {
51- struct ndpi_packet_struct * packet = & ndpi_struct -> packet ;
52- u_int16_t i , packetl = packet -> payload_packet_len ;
53-
54- if (packetl < 4 ) {
55- return 0 ;
56- }
57-
58- for (i = 0 ; i < (packetl - 4 ); i ++ ) {
59- if (packet -> payload [i ] == 'N' || packet -> payload [i ] == 'n' ) {
60- if ((((packetl - (i + 1 )) >= 4 ) && memcmp (& packet -> payload [i + 1 ], "ick=" , 4 ) == 0 )
61- || (((packetl - (i + 1 )) >= 8 ) && (memcmp (& packet -> payload [i + 1 ], "ickname=" , 8 ) == 0 ))
62- || (((packetl - (i + 1 )) >= 8 ) && (memcmp (& packet -> payload [i + 1 ], "ickName=" , 8 ) == 0 ))) {
63- NDPI_LOG_DBG2 (ndpi_struct , "found HTTP IRC Nickname pattern\n" );
64- return 1 ;
65- }
66- }
67- }
68- return 0 ;
69- }
70-
71- static u_int8_t ndpi_check_for_cmd (struct ndpi_detection_module_struct * ndpi_struct )
72- {
73- struct ndpi_packet_struct * packet = & ndpi_struct -> packet ;
74- u_int16_t i ;
75-
76- if (packet -> payload_packet_len < 4 ) {
77- return 0 ;
78- }
79-
80- for (i = 0 ; i < packet -> payload_packet_len - 4 ; i ++ ) {
81- if (packet -> payload [i ] == 'c' ) {
82- if (memcmp (& packet -> payload [i + 1 ], "md=" , 3 ) == 0 ) {
83- NDPI_LOG_DBG2 (ndpi_struct , "found HTTP IRC cmd pattern \n" );
84- return 1 ;
85- }
86- }
87- }
88- return 0 ;
89- }
90-
9149static void ndpi_search_irc_tcp (struct ndpi_detection_module_struct * ndpi_struct , struct ndpi_flow_struct * flow )
9250{
9351 struct ndpi_packet_struct * packet = & ndpi_struct -> packet ;
9452
9553 u_int16_t c = 0 ;
9654 u_int16_t i = 0 ;
97- u_int16_t http_content_ptr_len = 0 ;
9855
9956 NDPI_LOG_DBG (ndpi_struct , "search irc\n" );
10057 if ((flow -> detected_protocol_stack [0 ] != NDPI_PROTOCOL_IRC && (flow -> packet_counter > 10 ))
@@ -209,19 +166,6 @@ static void ndpi_search_irc_tcp(struct ndpi_detection_module_struct *ndpi_struct
209166 }
210167 }
211168 }
212-
213- if ((flow -> detected_protocol_stack [0 ] != NDPI_PROTOCOL_IRC ) && (flow -> l4 .tcp .irc_stage == 1 )) {
214- if ((((packet -> payload_packet_len - http_content_ptr_len ) > 10 )
215- && (memcmp (packet -> payload + http_content_ptr_len , "interface=" , 10 ) == 0 )
216- && (ndpi_check_for_Nickname (ndpi_struct ) != 0 ))
217- || (((packet -> payload_packet_len - http_content_ptr_len ) > 5 )
218- && (memcmp (packet -> payload + http_content_ptr_len , "item=" , 5 ) == 0 )
219- && (ndpi_check_for_cmd (ndpi_struct ) != 0 ))) {
220- NDPI_LOG_INFO (ndpi_struct , "found IRC: Nickname, cmd, one time" );
221- ndpi_int_irc_add_connection (ndpi_struct , flow , NDPI_CONFIDENCE_DPI );
222- return ;
223- }
224- }
225169}
226170
227171void init_irc_dissector (struct ndpi_detection_module_struct * ndpi_struct )
0 commit comments