diff options
Diffstat (limited to 'src/include/ndpi_api.h')
-rw-r--r-- | src/include/ndpi_api.h | 57 |
1 files changed, 13 insertions, 44 deletions
diff --git a/src/include/ndpi_api.h b/src/include/ndpi_api.h index c2c129ec0..16ac45de0 100644 --- a/src/include/ndpi_api.h +++ b/src/include/ndpi_api.h @@ -58,7 +58,7 @@ extern "C" { * else 0 * */ - int check_punycode_string(char * buff , int len); + int check_punycode_string(char *buff, int len); /** @@ -78,7 +78,6 @@ extern "C" { */ u_int32_t ndpi_detection_get_sizeof_ndpi_id_struct(void); - /** * nDPI personal allocation and free functions **/ @@ -115,7 +114,6 @@ extern "C" { */ char* ndpi_strncasestr(const char *s, const char *find, size_t slen); - /** * Returns the nDPI protocol id for IP-based protocol detection * @@ -128,7 +126,6 @@ extern "C" { u_int16_t ndpi_network_ptree_match(struct ndpi_detection_module_struct *ndpi_struct, struct in_addr *pin); - /** * Init single protocol match * @@ -155,7 +152,6 @@ extern "C" { */ void ndpi_free_flow(struct ndpi_flow_struct *flow); - /** * Enables cache support. * In nDPI is used for some protocol (i.e. Skype) @@ -168,7 +164,6 @@ extern "C" { void ndpi_enable_cache(struct ndpi_detection_module_struct *ndpi_mod, char* host, u_int port); - /** * Destroys the detection module * @@ -177,7 +172,6 @@ extern "C" { */ void ndpi_exit_detection_module(struct ndpi_detection_module_struct *ndpi_struct); - /** * Sets a single protocol bitmask * This function does not increment the index of the callback_buffer @@ -192,7 +186,8 @@ extern "C" { * @par b_add_detection_bitmask = if set as "true" add the protocol bitmask to the detection bitmask * */ - void ndpi_set_bitmask_protocol_detection(char *label, struct ndpi_detection_module_struct *ndpi_struct, + void ndpi_set_bitmask_protocol_detection(char *label, + struct ndpi_detection_module_struct *ndpi_struct, const NDPI_PROTOCOL_BITMASK *detection_bitmask, const u_int32_t idx, u_int16_t ndpi_protocol_id, @@ -202,7 +197,6 @@ extern "C" { u_int8_t b_save_bitmask_unknow, u_int8_t b_add_detection_bitmask); - /** * Sets the protocol bitmask2 * @@ -213,7 +207,6 @@ extern "C" { void ndpi_set_protocol_detection_bitmask2(struct ndpi_detection_module_struct *ndpi_struct, const NDPI_PROTOCOL_BITMASK * detection_bitmask); - /** * Function to be called before we give up with detection for a given flow. * This function reduces the NDPI_UNKNOWN_PROTOCOL detection @@ -270,8 +263,6 @@ extern "C" { const u_int64_t current_tick, struct ndpi_id_struct *src, struct ndpi_id_struct *dst); - - /** * Get the main protocol of the passed flows for the detected module * @@ -283,8 +274,7 @@ extern "C" { */ u_int16_t ndpi_get_flow_masterprotocol(struct ndpi_detection_module_struct *ndpi_struct, struct ndpi_flow_struct *flow); - - + /** * API call that is called internally by ndpi_detection_process_packet or by apps * that want to avoid calling ndpi_detection_process_packet as they have already @@ -316,7 +306,6 @@ extern "C" { u_int8_t ndpi_detection_get_l4(const u_int8_t *l3, u_int16_t l3_len, const u_int8_t **l4_return, u_int16_t *l4_len_return, u_int8_t *l4_protocol_return, u_int32_t flags); - /** * Search and return the protocol based on matched ports * @@ -333,8 +322,6 @@ extern "C" { u_int16_t sport, u_int32_t dhost, u_int16_t dport); - - /** * Search and return the protocol guessed that is undetected * @@ -353,8 +340,6 @@ extern "C" { u_int16_t sport, u_int32_t dhost, u_int16_t dport); - - /** * Check if the string passed match with a protocol * @@ -369,8 +354,6 @@ extern "C" { char *string_to_match, u_int string_to_match_len, u_int8_t is_host_match); - - /** * Check if the host passed match with a protocol * @@ -405,8 +388,6 @@ extern "C" { char *string_to_match, u_int string_to_match_len, u_int16_t master_protocol_id); - - /** * Exclude protocol from search * @@ -419,8 +400,6 @@ extern "C" { struct ndpi_flow_struct *flow, u_int16_t master_protocol_id, const char *_file, const char *_func,int _line); - - /** * Check if the string -bigram_to_match- match with a bigram of -automa- * @@ -444,7 +423,8 @@ extern "C" { * @return the buffer contains the master_protocol and protocol name * */ - char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod, ndpi_protocol proto, char *buf, u_int buf_len); + char* ndpi_protocol2name(struct ndpi_detection_module_struct *ndpi_mod, + ndpi_protocol proto, char *buf, u_int buf_len); /** * Find out if a given category is custom/user-defined @@ -543,7 +523,6 @@ extern "C" { ndpi_protocol_breed_t ndpi_get_proto_breed(struct ndpi_detection_module_struct *ndpi_struct, u_int16_t proto); - /** * Return the string name of the protocol breed * @@ -555,7 +534,6 @@ extern "C" { char* ndpi_get_proto_breed_name(struct ndpi_detection_module_struct *ndpi_struct, ndpi_protocol_breed_t breed_id); - /** * Return the ID of the protocol * @@ -566,7 +544,6 @@ extern "C" { */ int ndpi_get_protocol_id(struct ndpi_detection_module_struct *ndpi_mod, char *proto); - /** * Return the ID of the category * @@ -577,7 +554,6 @@ extern "C" { */ int ndpi_get_category_id(struct ndpi_detection_module_struct *ndpi_mod, char *cat); - /** * Write the list of the supported protocols * @@ -585,7 +561,6 @@ extern "C" { */ void ndpi_dump_protocols(struct ndpi_detection_module_struct *mod); - /** * Read a file and load the protocols * @@ -604,7 +579,6 @@ extern "C" { int ndpi_load_protocols_file(struct ndpi_detection_module_struct *ndpi_mod, char* path); - /** * Get the total number of the supported protocols * @@ -614,7 +588,6 @@ extern "C" { */ u_int ndpi_get_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod); - /** * Get the nDPI version release * @@ -623,7 +596,6 @@ extern "C" { */ char* ndpi_revision(void); - /** * Set the automa for the protocol search * @@ -634,7 +606,6 @@ extern "C" { void ndpi_set_automa(struct ndpi_detection_module_struct *ndpi_struct, void* automa); - #ifdef NDPI_PROTOCOL_HTTP /** * Retrieve information for HTTP flows @@ -647,7 +618,6 @@ extern "C" { ndpi_http_method ndpi_get_http_method(struct ndpi_detection_module_struct *ndpi_mod, struct ndpi_flow_struct *flow); - /** * Get the HTTP url * @@ -659,7 +629,6 @@ extern "C" { char* ndpi_get_http_url(struct ndpi_detection_module_struct *ndpi_mod, struct ndpi_flow_struct *flow); - /** * Get the HTTP content-type * @@ -672,7 +641,6 @@ extern "C" { struct ndpi_flow_struct *flow); #endif - #ifdef NDPI_PROTOCOL_TOR /** * Check if the flow could be detected as TOR protocol @@ -697,7 +665,6 @@ extern "C" { */ void* ndpi_init_automa(void); - /** * Free Aho-Corasick automata allocated with ndpi_init_automa(); * @@ -706,7 +673,6 @@ extern "C" { */ void ndpi_free_automa(void *_automa); - /** * Add a string to match to an automata * @@ -718,7 +684,6 @@ extern "C" { */ int ndpi_add_string_value_to_automa(void *_automa, char *str, unsigned long num); - /** * Add a string to match to an automata. Same as ndpi_add_string_value_to_automa() with num set to 1 * @@ -729,7 +694,6 @@ extern "C" { */ int ndpi_add_string_to_automa(void *_automa, char *str); - /** * Finalize the automa (necessary before start searching) * @@ -738,7 +702,6 @@ extern "C" { */ void ndpi_finalize_automa(void *_automa); - /** * Add a string to match to an automata * @@ -758,9 +721,15 @@ extern "C" { struct ndpi_flow_struct *flow, ndpi_protocol *ret); int ndpi_set_detection_preferences(struct ndpi_detection_module_struct *ndpi_mod, - ndpi_detection_preference pref, + ndpi_detection_preference pref, int value); + ndpi_proto_defaults_t* ndpi_get_proto_defaults(struct ndpi_detection_module_struct *ndpi_mod); + u_int ndpi_get_ndpi_num_supported_protocols(struct ndpi_detection_module_struct *ndpi_mod); + u_int ndpi_get_ndpi_num_custom_protocols(struct ndpi_detection_module_struct *ndpi_mod); + u_int ndpi_get_ndpi_detection_module_size(); + void ndpi_set_log_level(struct ndpi_detection_module_struct *ndpi_mod, u_int l); + /** * Add a string to match to an automata * |