diff options
Diffstat (limited to 'src/lib/ndpi_main.c')
-rw-r--r-- | src/lib/ndpi_main.c | 26 |
1 files changed, 13 insertions, 13 deletions
diff --git a/src/lib/ndpi_main.c b/src/lib/ndpi_main.c index a2fe4c3c8..3088f7432 100644 --- a/src/lib/ndpi_main.c +++ b/src/lib/ndpi_main.c @@ -1642,7 +1642,7 @@ u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_str fill_prefix_v4(&prefix, pin, 32, ((patricia_tree_t *) ndpi_str->protocols_ptree)->maxbits); node = ndpi_patricia_search_best(ndpi_str->protocols_ptree, &prefix); - return(node ? node->value.uv.user_value : NDPI_PROTOCOL_UNKNOWN); + return(node ? node->value.u.uv32.user_value : NDPI_PROTOCOL_UNKNOWN); } /* ******************************************* */ @@ -1658,9 +1658,9 @@ u_int16_t ndpi_network_port_ptree_match(struct ndpi_detection_module_struct *ndp node = ndpi_patricia_search_best(ndpi_str->protocols_ptree, &prefix); if(node) { - if((node->value.uv.additional_user_value == 0) - || (node->value.uv.additional_user_value == port)) - return(node->value.uv.user_value); + if((node->value.u.uv32.additional_user_value == 0) + || (node->value.u.uv32.additional_user_value == port)) + return(node->value.u.uv32.user_value); } return(NDPI_PROTOCOL_UNKNOWN); @@ -1746,7 +1746,7 @@ int ndpi_load_ipv4_ptree(struct ndpi_detection_module_struct *ndpi_str, pin.s_addr = inet_addr(addr); if((node = add_to_ptree(ndpi_str->protocols_ptree, AF_INET, &pin, cidr ? atoi(cidr) : 32 /* bits */)) != NULL) { - node->value.uv.user_value = protocol_id, node->value.uv.additional_user_value = 0 /* port */; + node->value.u.uv32.user_value = protocol_id, node->value.u.uv32.additional_user_value = 0 /* port */; num_loaded++; } } @@ -1772,7 +1772,7 @@ static void ndpi_init_ptree_ipv4(struct ndpi_detection_module_struct *ndpi_str, pin.s_addr = htonl(host_list[i].network); if((node = add_to_ptree(ptree, AF_INET, &pin, host_list[i].cidr /* bits */)) != NULL) { - node->value.uv.user_value = host_list[i].value, node->value.uv.additional_user_value = 0; + node->value.u.uv32.user_value = host_list[i].value, node->value.u.uv32.additional_user_value = 0; } } } @@ -1815,7 +1815,7 @@ static int ndpi_add_host_ip_subprotocol(struct ndpi_detection_module_struct *ndp inet_pton(AF_INET, value, &pin); if((node = add_to_ptree(ndpi_str->protocols_ptree, AF_INET, &pin, bits)) != NULL) { - node->value.uv.user_value = protocol_id, node->value.uv.additional_user_value = htons(port); + node->value.u.uv32.user_value = protocol_id, node->value.u.uv32.additional_user_value = htons(port); } return(0); @@ -2302,7 +2302,7 @@ int ndpi_get_custom_category_match(struct ndpi_detection_module_struct *ndpi_str node = ndpi_patricia_search_best(ndpi_str->custom_categories.ipAddresses, &prefix); if(node) { - *id = node->value.uv.user_value; + *id = node->value.u.uv32.user_value; return(0); } @@ -4293,7 +4293,7 @@ int ndpi_load_ip_category(struct ndpi_detection_module_struct *ndpi_str, const c } if((node = add_to_ptree(ndpi_str->custom_categories.ipAddresses_shadow, AF_INET, &pin, bits)) != NULL) { - node->value.uv.user_value = (u_int16_t)category, node->value.uv.additional_user_value = 0; + node->value.u.uv32.user_value = (u_int16_t)category, node->value.u.uv32.additional_user_value = 0; } return(0); @@ -4420,7 +4420,7 @@ int ndpi_fill_ip_protocol_category(struct ndpi_detection_module_struct *ndpi_str } if(node) { - ret->category = (ndpi_protocol_category_t) node->value.uv.user_value; + ret->category = (ndpi_protocol_category_t) node->value.u.uv32.user_value; return(1); } @@ -6649,7 +6649,7 @@ void ndpi_ptree_destroy(ndpi_ptree_t *tree) { /* ******************************************************************** */ int ndpi_ptree_insert(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr, - u_int8_t bits, uint user_data) { + u_int8_t bits, u_int64_t user_data) { u_int8_t is_v6 = ndpi_is_ipv6(addr); patricia_tree_t *ptree = is_v6 ? tree->v6 : tree->v4; prefix_t prefix; @@ -6672,7 +6672,7 @@ int ndpi_ptree_insert(ndpi_ptree_t *tree, const ndpi_ip_addr_t *addr, node = ndpi_patricia_lookup(ptree, &prefix); if(node != NULL) { - node->value.uv.user_value = user_data, node->value.uv.additional_user_value = 0; + node->value.u.uv64 = user_data; return(0); } @@ -6698,7 +6698,7 @@ int ndpi_ptree_match_addr(ndpi_ptree_t *tree, node = ndpi_patricia_search_best(ptree, &prefix); if(node) { - *user_data = node->value.uv.user_value; + *user_data = node->value.u.uv32.user_value; return(0); } |