aboutsummaryrefslogtreecommitdiff
path: root/src/lib/protocols/netflow.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/protocols/netflow.c')
-rw-r--r--src/lib/protocols/netflow.c26
1 files changed, 11 insertions, 15 deletions
diff --git a/src/lib/protocols/netflow.c b/src/lib/protocols/netflow.c
index ccb5b2762..7e3d7580f 100644
--- a/src/lib/protocols/netflow.c
+++ b/src/lib/protocols/netflow.c
@@ -1,7 +1,7 @@
/*
* netflow.c
*
- * Copyright (C) 2011-22 - ntop.org
+ * Copyright (C) 2011-25 - ntop.org
*
* nDPI is free software: you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
@@ -119,7 +119,7 @@ static void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct
case 7:
case 9:
if((n == 0) || (n > 30)) {
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
return;
}
@@ -142,7 +142,7 @@ static void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct
}
if((expected_len > 0) && (expected_len != payload_len)) {
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
return;
}
@@ -154,7 +154,7 @@ static void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct
u_int16_t ipfix_len = n;
if(ipfix_len != payload_len) {
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
return;
}
}
@@ -162,7 +162,7 @@ static void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct
break;
default:
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
return;
}
@@ -179,18 +179,14 @@ static void ndpi_search_netflow(struct ndpi_detection_module_struct *ndpi_struct
return;
}
} else
- NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
+ NDPI_EXCLUDE_DISSECTOR(ndpi_struct, flow);
}
-void init_netflow_dissector(struct ndpi_detection_module_struct *ndpi_struct, u_int32_t *id)
+void init_netflow_dissector(struct ndpi_detection_module_struct *ndpi_struct)
{
- ndpi_set_bitmask_protocol_detection("NetFlow", ndpi_struct, *id,
- NDPI_PROTOCOL_NETFLOW,
- ndpi_search_netflow,
- NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD,
- SAVE_DETECTION_BITMASK_AS_UNKNOWN,
- ADD_TO_DETECTION_BITMASK);
-
- *id += 1;
+ register_dissector("NetFlow", ndpi_struct,
+ ndpi_search_netflow,
+ NDPI_SELECTION_BITMASK_PROTOCOL_V4_V6_UDP_WITH_PAYLOAD,
+ 1, NDPI_PROTOCOL_NETFLOW);
}