minor fix mgcp dissector
This commit is contained in:
@@ -1,8 +1,7 @@
|
|||||||
/*
|
/*
|
||||||
* mgcp.c
|
* mgcp.c
|
||||||
*
|
*
|
||||||
* Copyright (C) 2009-2011 by ipoque GmbH
|
* Copyright (C) 2017 - ntop.org
|
||||||
* Copyright (C) 2011-15 - ntop.org
|
|
||||||
*
|
*
|
||||||
* This file is part of nDPI, an open source deep packet inspection
|
* This file is part of nDPI, an open source deep packet inspection
|
||||||
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
* library based on the OpenDPI and PACE technology by ipoque GmbH
|
||||||
@@ -21,12 +20,11 @@
|
|||||||
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
* along with nDPI. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
|
||||||
#include "ndpi_protocols.h"
|
#include "ndpi_protocols.h"
|
||||||
|
|
||||||
#ifdef NDPI_PROTOCOL_MGCP
|
#ifdef NDPI_PROTOCOL_MGCP
|
||||||
|
|
||||||
|
|
||||||
static void ndpi_int_mgcp_add_connection(struct ndpi_detection_module_struct
|
static void ndpi_int_mgcp_add_connection(struct ndpi_detection_module_struct
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
*ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
{
|
{
|
||||||
@@ -34,23 +32,11 @@ static void ndpi_int_mgcp_add_connection(struct ndpi_detection_module_struct
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void ndpi_search_mgcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
||||||
#if !defined(WIN32)
|
|
||||||
static inline
|
|
||||||
#else
|
|
||||||
__forceinline static
|
|
||||||
#endif
|
|
||||||
void ndpi_search_mgcp_connection(struct ndpi_detection_module_struct
|
|
||||||
*ndpi_struct, struct ndpi_flow_struct *flow)
|
|
||||||
{
|
{
|
||||||
|
|
||||||
struct ndpi_packet_struct *packet = &flow->packet;
|
struct ndpi_packet_struct *packet = &flow->packet;
|
||||||
|
|
||||||
// struct ndpi_id_struct *src=ndpi_struct->src;
|
|
||||||
// struct ndpi_id_struct *dst=ndpi_struct->dst;
|
|
||||||
|
|
||||||
/* information about MGCP taken from http://en.wikipedia.org/wiki/MGCP */
|
|
||||||
|
|
||||||
u_int16_t pos = 5;
|
u_int16_t pos = 5;
|
||||||
|
|
||||||
if (packet->payload_packet_len < 8) {
|
if (packet->payload_packet_len < 8) {
|
||||||
@@ -62,8 +48,6 @@ __forceinline static
|
|||||||
goto mgcp_excluded;
|
goto mgcp_excluded;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (packet->payload[0] != 'A' && packet->payload[0] != 'C' && packet->payload[0] != 'D' &&
|
if (packet->payload[0] != 'A' && packet->payload[0] != 'C' && packet->payload[0] != 'D' &&
|
||||||
packet->payload[0] != 'E' && packet->payload[0] != 'M' && packet->payload[0] != 'N' &&
|
packet->payload[0] != 'E' && packet->payload[0] != 'M' && packet->payload[0] != 'N' &&
|
||||||
packet->payload[0] != 'R') {
|
packet->payload[0] != 'R') {
|
||||||
@@ -92,12 +76,6 @@ __forceinline static
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void ndpi_search_mgcp(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow)
|
|
||||||
{
|
|
||||||
ndpi_search_mgcp_connection(ndpi_struct, flow);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void init_mgpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
void init_mgpc_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id, NDPI_PROTOCOL_BITMASK *detection_bitmask)
|
||||||
{
|
{
|
||||||
ndpi_set_bitmask_protocol_detection("MGCP", ndpi_struct, detection_bitmask, *id,
|
ndpi_set_bitmask_protocol_detection("MGCP", ndpi_struct, detection_bitmask, *id,
|
||||||
|
|||||||
Reference in New Issue
Block a user