Exported ndpi_netbios_name_interpret() to all nDPI apps
This commit is contained in:
@@ -49,3 +49,4 @@ set_ndpi_free
|
|||||||
set_ndpi_debug_function
|
set_ndpi_debug_function
|
||||||
ndpi_category_str
|
ndpi_category_str
|
||||||
ndpi_get_proto_category
|
ndpi_get_proto_category
|
||||||
|
ndpi_netbios_name_interpret
|
||||||
@@ -106,7 +106,10 @@ extern "C" {
|
|||||||
extern int ndpi_get_protocol_id_master_proto(struct ndpi_detection_module_struct *ndpi_struct, u_int16_t protocol_id,
|
extern int ndpi_get_protocol_id_master_proto(struct ndpi_detection_module_struct *ndpi_struct, u_int16_t protocol_id,
|
||||||
u_int16_t** tcp_master_proto,
|
u_int16_t** tcp_master_proto,
|
||||||
u_int16_t** udp_master_proto);
|
u_int16_t** udp_master_proto);
|
||||||
|
#ifdef NDPI_PROTOCOL_NETBIOS
|
||||||
|
int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len);
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
#ifdef NDPI_ENABLE_DEBUG_MESSAGES
|
||||||
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
void ndpi_debug_get_last_log_function_line(struct ndpi_detection_module_struct *ndpi_struct,
|
||||||
const char **file, const char **func, u_int32_t * line);
|
const char **file, const char **func, u_int32_t * line);
|
||||||
|
|||||||
@@ -32,7 +32,7 @@ struct netbios_header {
|
|||||||
};
|
};
|
||||||
|
|
||||||
/* The function below has been inherited by tcpdump */
|
/* The function below has been inherited by tcpdump */
|
||||||
static int netbios_name_interpret(char *in, char *out, u_int out_len) {
|
int ndpi_netbios_name_interpret(char *in, char *out, u_int out_len) {
|
||||||
int ret = 0, len;
|
int ret = 0, len;
|
||||||
char *b;
|
char *b;
|
||||||
|
|
||||||
@@ -114,7 +114,7 @@ void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
NDPI_LOG(NDPI_PROTOCOL_NETBIOS, ndpi_struct,
|
NDPI_LOG(NDPI_PROTOCOL_NETBIOS, ndpi_struct,
|
||||||
NDPI_LOG_DEBUG, "found netbios with questions = 1 and answers = 0, authority = 0 and broadcast \n");
|
NDPI_LOG_DEBUG, "found netbios with questions = 1 and answers = 0, authority = 0 and broadcast \n");
|
||||||
|
|
||||||
if(netbios_name_interpret((char*)&packet->payload[12], name, sizeof(name)) > 0)
|
if(ndpi_netbios_name_interpret((char*)&packet->payload[12], name, sizeof(name)) > 0)
|
||||||
snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
|
snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
|
||||||
|
|
||||||
ndpi_int_netbios_add_connection(ndpi_struct, flow);
|
ndpi_int_netbios_add_connection(ndpi_struct, flow);
|
||||||
@@ -341,7 +341,7 @@ void ndpi_search_netbios(struct ndpi_detection_module_struct *ndpi_struct, struc
|
|||||||
NDPI_LOG(NDPI_PROTOCOL_NETBIOS, ndpi_struct,
|
NDPI_LOG(NDPI_PROTOCOL_NETBIOS, ndpi_struct,
|
||||||
NDPI_LOG_DEBUG, "found netbios with checked ip-address.\n");
|
NDPI_LOG_DEBUG, "found netbios with checked ip-address.\n");
|
||||||
|
|
||||||
if(netbios_name_interpret((char*)&packet->payload[12], name, sizeof(name)) > 0)
|
if(ndpi_netbios_name_interpret((char*)&packet->payload[12], name, sizeof(name)) > 0)
|
||||||
snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
|
snprintf((char*)flow->host_server_name, sizeof(flow->host_server_name)-1, "%s", name);
|
||||||
|
|
||||||
ndpi_int_netbios_add_connection(ndpi_struct, flow);
|
ndpi_int_netbios_add_connection(ndpi_struct, flow);
|
||||||
|
|||||||
Reference in New Issue
Block a user