diff options
author | Ivan Nardi <12729895+IvanNardi@users.noreply.github.com> | 2023-11-07 15:30:56 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-11-07 15:30:56 +0100 |
commit | 58a9e2d9679f268a64b9082dae70498147bb58a8 (patch) | |
tree | b894bd3b1881e6c1cc9649bc91fcbd1542d945a8 /src/include/ndpi_typedefs.h | |
parent | 0db12b1390b1cc554b927230c76b05264c05b498 (diff) |
Remove `struct ndpi_packet_struct` from the public API (#2129)
Right now, the only instance of `struct ndpi_packet_struct` is embedded
into `struct ndpi_detection_module_struct`. Since the latter is a
private structure (because of `NDPI_LIB_COMPILATION` ) there is no way for
the application to get a pointer to `ndpi_struct->packet`.
Bottom line: the application can't use any API functions having `struct
ndpi_packet_struct *` as parameter. Remove them all (since they are
completly unused and unusable).
There are no public helper functions to initialize/populate/deinit a
`struct ndpi_packet_struct` object, so the application can't neither
create its own instance of this object.
Protect `struct ndpi_packet_struct` via the same define
`NDPI_LIB_COMPILATION`.
Diffstat (limited to 'src/include/ndpi_typedefs.h')
-rw-r--r-- | src/include/ndpi_typedefs.h | 86 |
1 files changed, 43 insertions, 43 deletions
diff --git a/src/include/ndpi_typedefs.h b/src/include/ndpi_typedefs.h index 8b1874f38..26fcf0be3 100644 --- a/src/include/ndpi_typedefs.h +++ b/src/include/ndpi_typedefs.h @@ -965,49 +965,6 @@ struct ndpi_int_one_line_struct { u_int16_t len; }; -struct ndpi_packet_struct { - const struct ndpi_iphdr *iph; - const struct ndpi_ipv6hdr *iphv6; - const struct ndpi_tcphdr *tcp; - const struct ndpi_udphdr *udp; - const u_int8_t *generic_l4_ptr; /* is set only for non tcp-udp traffic */ - const u_int8_t *payload; - - u_int64_t current_time_ms; - - struct ndpi_int_one_line_struct line[NDPI_MAX_PARSE_LINES_PER_PACKET]; - /* HTTP headers */ - struct ndpi_int_one_line_struct host_line; - struct ndpi_int_one_line_struct forwarded_line; - struct ndpi_int_one_line_struct referer_line; - struct ndpi_int_one_line_struct content_line; - struct ndpi_int_one_line_struct content_disposition_line; - struct ndpi_int_one_line_struct accept_line; - struct ndpi_int_one_line_struct authorization_line; - struct ndpi_int_one_line_struct user_agent_line; - struct ndpi_int_one_line_struct http_url_name; - struct ndpi_int_one_line_struct http_encoding; - struct ndpi_int_one_line_struct http_transfer_encoding; - struct ndpi_int_one_line_struct http_contentlen; - struct ndpi_int_one_line_struct http_cookie; - struct ndpi_int_one_line_struct http_origin; - struct ndpi_int_one_line_struct http_x_session_type; - struct ndpi_int_one_line_struct server_line; - struct ndpi_int_one_line_struct http_method; - struct ndpi_int_one_line_struct http_response; /* the first "word" in this pointer is the - response code in the packet (200, etc) */ - u_int8_t http_num_headers; /* number of found (valid) header lines in HTTP request or response */ - - u_int16_t l3_packet_len; - u_int16_t payload_packet_len; - u_int16_t parsed_lines; - u_int16_t empty_line_position; - u_int8_t tcp_retransmission; - - u_int8_t packet_lines_parsed_complete:1, - packet_direction:1, empty_line_position_set:1, http_check_content:1, pad:4; -}; - struct ndpi_detection_module_struct; struct ndpi_flow_struct; @@ -1250,6 +1207,49 @@ typedef struct { } nbpf_filter; #endif +struct ndpi_packet_struct { + const struct ndpi_iphdr *iph; + const struct ndpi_ipv6hdr *iphv6; + const struct ndpi_tcphdr *tcp; + const struct ndpi_udphdr *udp; + const u_int8_t *generic_l4_ptr; /* is set only for non tcp-udp traffic */ + const u_int8_t *payload; + + u_int64_t current_time_ms; + + struct ndpi_int_one_line_struct line[NDPI_MAX_PARSE_LINES_PER_PACKET]; + /* HTTP headers */ + struct ndpi_int_one_line_struct host_line; + struct ndpi_int_one_line_struct forwarded_line; + struct ndpi_int_one_line_struct referer_line; + struct ndpi_int_one_line_struct content_line; + struct ndpi_int_one_line_struct content_disposition_line; + struct ndpi_int_one_line_struct accept_line; + struct ndpi_int_one_line_struct authorization_line; + struct ndpi_int_one_line_struct user_agent_line; + struct ndpi_int_one_line_struct http_url_name; + struct ndpi_int_one_line_struct http_encoding; + struct ndpi_int_one_line_struct http_transfer_encoding; + struct ndpi_int_one_line_struct http_contentlen; + struct ndpi_int_one_line_struct http_cookie; + struct ndpi_int_one_line_struct http_origin; + struct ndpi_int_one_line_struct http_x_session_type; + struct ndpi_int_one_line_struct server_line; + struct ndpi_int_one_line_struct http_method; + struct ndpi_int_one_line_struct http_response; /* the first "word" in this pointer is the + response code in the packet (200, etc) */ + u_int8_t http_num_headers; /* number of found (valid) header lines in HTTP request or response */ + + u_int16_t l3_packet_len; + u_int16_t payload_packet_len; + u_int16_t parsed_lines; + u_int16_t empty_line_position; + u_int8_t tcp_retransmission; + + u_int8_t packet_lines_parsed_complete:1, + packet_direction:1, empty_line_position_set:1, http_check_content:1, pad:4; +}; + struct ndpi_detection_module_struct { NDPI_PROTOCOL_BITMASK detection_bitmask; |