Update main Readme and remove commented out code (#2471)
Avoid that useless code is copy-and-pasted into new dissector, as in https://github.com/ntop/nDPI/pull/2470#discussion_r1639384434
This commit is contained in:
@@ -79,11 +79,12 @@ The entire procedure of adding new protocols in detail:
|
||||
4. Add a new entry for the search function for the new protocol in: `src/include/ndpi_protocols.h`
|
||||
5. Choose (do not change anything) a selection bitmask from: `src/include/ndpi_define.h`
|
||||
6. Set protocol default ports in `ndpi_init_protocol_defaults` in: `src/lib/ndpi_main.c`
|
||||
7. Be sure to have nBPF support, cloning `PF_RING` in the same directory where you cloned `nDPI`: `git clone https://github.com/ntop/PF_RING/ && cd PF_RING/userland/nbpf && ./configure && make`
|
||||
7. Be sure to have nBPF support, cloning `PF_RING` in the same directory where you cloned `nDPI`: `git clone https://github.com/ntop/PF_RING/ && cd PF_RING/userland/nbpf && ./configure && make`. You can ignore the `/bin/sh: 1: ../lib/pfring_config: not found` error
|
||||
8. From the `nDPI` root directory, `./autogen.sh --with-pcre2` (nBPF and PCRE2 are usually optional, but they are needed to run/update *all* the unit tests)
|
||||
9. `make`
|
||||
10. `make check`
|
||||
11. Update the documentation, adding this new protocol to `doc/protocols.rst`
|
||||
12. Update the Windows Visual Studio configuration, adding the new c file in `windows/nDPI.vcxproj`
|
||||
|
||||
### How to use nDPI to Block Selected Traffic
|
||||
|
||||
|
||||
@@ -35,8 +35,7 @@ struct amqp_header {
|
||||
} PACK_OFF;
|
||||
|
||||
static void ndpi_int_amqp_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */) {
|
||||
struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_AMQP, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
@@ -45,7 +44,6 @@ static void ndpi_search_amqp(struct ndpi_detection_module_struct *ndpi_struct, s
|
||||
|
||||
NDPI_LOG_DBG(ndpi_struct, "search amqp\n");
|
||||
|
||||
if (packet->tcp != NULL) {
|
||||
if(packet->payload_packet_len > sizeof(struct amqp_header)) {
|
||||
struct amqp_header *h = (struct amqp_header*)packet->payload;
|
||||
|
||||
@@ -69,7 +67,7 @@ static void ndpi_search_amqp(struct ndpi_detection_module_struct *ndpi_struct, s
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if(flow->packet_counter > 5)
|
||||
NDPI_EXCLUDE_PROTO(ndpi_struct, flow);
|
||||
}
|
||||
|
||||
@@ -30,7 +30,7 @@
|
||||
|
||||
|
||||
static void ndpi_int_crossfire_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , ndpi_protocol_type_t protocol_type */)
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_CROSSFIRE, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
|
||||
@@ -31,8 +31,7 @@
|
||||
|
||||
|
||||
static void ndpi_int_qq_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */)
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_QQ, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
@@ -29,8 +29,7 @@
|
||||
#include "ndpi_private.h"
|
||||
|
||||
static void ndpi_int_worldofwarcraft_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */)
|
||||
struct ndpi_flow_struct *flow)
|
||||
{
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_WORLDOFWARCRAFT, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
@@ -28,8 +28,7 @@
|
||||
/* *************************************************** */
|
||||
|
||||
static void ndpi_int_zabbix_add_connection(struct ndpi_detection_module_struct *ndpi_struct,
|
||||
struct ndpi_flow_struct *flow/* , */
|
||||
/* ndpi_protocol_type_t protocol_type */) {
|
||||
struct ndpi_flow_struct *flow) {
|
||||
ndpi_set_detected_protocol(ndpi_struct, flow, NDPI_PROTOCOL_ZABBIX, NDPI_PROTOCOL_UNKNOWN, NDPI_CONFIDENCE_DPI);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user