Update CFFI definitions.

This commit is contained in:
aouinizied
2020-07-29 12:31:21 +02:00
parent 02dc8d5feb
commit c4b19fd6c5
+12 -4
View File
@@ -2,7 +2,7 @@
file: ndpi.py
This file is part of nfstream.
Copyright (C) 2019-20 - Zied Aouini <aouinizied@gmail.com>
Copyright (C) 2019-20 - nfstream.org
nfstream is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License
as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
@@ -265,6 +265,9 @@ struct tinc_cache_entry {
"""
cc_ndpi_stuctures = """
#define NDPI_MAX_NUM_DISSECTED_TLS_BLOCKS 32
typedef enum {
NDPI_LOG_ERROR,
NDPI_LOG_TRACE,
@@ -308,6 +311,7 @@ typedef enum {
NDPI_MALFORMED_PACKET,
NDPI_SSH_OBSOLETE_CLIENT_VERSION_OR_CIPHER,
NDPI_SSH_OBSOLETE_SERVER_VERSION_OR_CIPHER,
NDPI_SMB_INSECURE_VERSION,
/* Leave this as last member */
NDPI_MAX_RISK
} ndpi_risk_enum;
@@ -578,7 +582,8 @@ struct ndpi_flow_tcp_struct {
/* NDPI_PROTOCOL_TLS */
uint8_t hello_processed:1, certificate_processed:1, subprotocol_detected:1, fingerprint_set:1, _pad:4;
uint8_t sha1_certificate_fingerprint[20];
uint8_t sha1_certificate_fingerprint[20], num_tls_blocks;
uint16_t tls_blocks_len[NDPI_MAX_NUM_DISSECTED_TLS_BLOCKS];
} tls;
/* NDPI_PROTOCOL_POSTGRES */
@@ -891,8 +896,11 @@ struct ndpi_detection_module_struct {
NDPI_PROTOCOL_BITMASK generic_http_packet_bitmask;
uint32_t current_ts;
uint32_t ticks_per_second;
uint16_t num_tls_blocks_to_follow;
char custom_category_labels[NUM_CUSTOM_CATEGORIES][CUSTOM_CATEGORY_LABEL_LEN];
/* callback function buffer */
struct ndpi_call_function_struct callback_buffer[250];
@@ -1033,7 +1041,7 @@ struct ndpi_flow_struct {
uint8_t host_server_name[240];
uint8_t initial_binary_bytes[8], initial_binary_bytes_len;
uint8_t risk_checked;
uint32_t risk; /* Issues found with this flow [bitmask of ndpi_risk] */
ndpi_risk risk; /* Issues found with this flow [bitmask of ndpi_risk] */
/*
This structure below will not stay inside the protos
@@ -1437,4 +1445,4 @@ class NDPI():
def ndpi_exit_detection_module(self):
""" Exit function for nDPI module """
self._ndpi.ndpi_exit_detection_module(self._mod)
self._ffi.dlclose(self._ndpi)
self._ffi.dlclose(self._ndpi)