Code review. (#1205)
The common actions required to call the ac_automata_search() function have been moved to the ndpi_match_string_common function. This made it possible to simplify the ndpi_match_string, ndpi_match_string_protocol_id, ndpi_match_string_value, ndpi_match_custom_category, ndpi_match_string_subprotocol, ndpi_match_bigram, ndpi_match_trigram functions. Using u_int16_t type for protocol identifiers when working with the ahocorasick library (changes src/include/ndpi_api.h.in and src/include/ndpi_typedefs.h). Reworked "finalization" of all AC_AUTOMATA_t structures. Changing the order of fields in the ndpi_call_function_struct structure reduces the size of the ndpi_detection_module_struct structure by 10 kB (for x86_64).
This commit is contained in:
@@ -591,9 +591,9 @@ static void processCertificateElements(struct ndpi_detection_module_struct *ndpi
|
||||
|
||||
if(flow->detected_protocol_stack[1] == NDPI_PROTOCOL_UNKNOWN) {
|
||||
/* No idea what is happening behind the scenes: let's check the certificate */
|
||||
u_int32_t proto_id;
|
||||
u_int16_t proto_id;
|
||||
int rc = ndpi_match_string_value(ndpi_struct->tls_cert_subject_automa.ac_automa,
|
||||
rdnSeqBuf, strlen(rdnSeqBuf),&proto_id);
|
||||
rdnSeqBuf, strlen(rdnSeqBuf), &proto_id);
|
||||
|
||||
if(rc == 0) {
|
||||
/* Match found */
|
||||
|
||||
Reference in New Issue
Block a user