File tree Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Expand file tree Collapse file tree 2 files changed +20
-0
lines changed Original file line number Diff line number Diff line change @@ -153,6 +153,8 @@ extern "C" {
153
153
*/
154
154
u_int16_t ndpi_network_ptree_match (struct ndpi_detection_module_struct * ndpi_struct ,
155
155
struct in_addr * pin );
156
+ u_int16_t ndpi_network_ptree6_match (struct ndpi_detection_module_struct * ndpi_str ,
157
+ struct in6_addr * pin );
156
158
157
159
/**
158
160
* Returns the nDPI protocol id for IP+port-based protocol detection
Original file line number Diff line number Diff line change @@ -2725,6 +2725,24 @@ u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_str
2725
2725
2726
2726
/* ******************************************* */
2727
2727
2728
+ u_int16_t ndpi_network_ptree6_match (struct ndpi_detection_module_struct * ndpi_str ,
2729
+ struct in6_addr * pin ) {
2730
+ ndpi_prefix_t prefix ;
2731
+ ndpi_patricia_node_t * node ;
2732
+
2733
+ if (!ndpi_str || !ndpi_str -> protocols )
2734
+ return (NDPI_PROTOCOL_UNKNOWN );
2735
+
2736
+ /* Make sure all in network byte order otherwise compares wont work */
2737
+ ndpi_fill_prefix_v6 (& prefix , pin , 128 ,
2738
+ ((ndpi_patricia_tree_t * ) ndpi_str -> protocols -> v4 )-> maxbits );
2739
+ node = ndpi_patricia_search_best (ndpi_str -> protocols -> v4 , & prefix );
2740
+
2741
+ return (node ? node -> value .u .uv16 [0 ].user_value : NDPI_PROTOCOL_UNKNOWN );
2742
+ }
2743
+
2744
+ /* ******************************************* */
2745
+
2728
2746
u_int16_t ndpi_network_port_ptree_match (struct ndpi_detection_module_struct * ndpi_str ,
2729
2747
struct in_addr * pin /* network byte order */ ,
2730
2748
u_int16_t port /* network byte order */ ) {
You can’t perform that action at this time.
0 commit comments