diff options
author | Toni <matzeton@googlemail.com> | 2024-04-03 14:10:21 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-04-03 14:10:21 +0200 |
commit | 41eef9246c6a3055e3876e3dd7aeaadecb4b76c0 (patch) | |
tree | 275c7300abf2233e8d89896a3a888ada01fef4bb /src/lib/protocols/thrift.c | |
parent | b5e8bc22147d37011621ae62b680742c8fa105dc (diff) |
Disable `-Wno-unused-parameter -Wno-unused-function`. (#2358)
* unused parameters and functions pollute the code and decrease readability
Signed-off-by: Toni Uhlig <matzeton@googlemail.com>
Diffstat (limited to 'src/lib/protocols/thrift.c')
-rw-r--r-- | src/lib/protocols/thrift.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/src/lib/protocols/thrift.c b/src/lib/protocols/thrift.c index 1e1749b9f..d9be27ca5 100644 --- a/src/lib/protocols/thrift.c +++ b/src/lib/protocols/thrift.c @@ -113,29 +113,27 @@ static int thrift_validate_type(uint8_t message_type) return message_type < TMT_TYPE_MAX; } -static void thrift_set_method(struct ndpi_detection_module_struct *ndpi_struct, - struct ndpi_flow_struct *flow, +static void thrift_set_method(struct ndpi_flow_struct *flow, char const * const method, size_t method_length) { if (thrift_validate_method(method, method_length) == 0) { - ndpi_set_risk(ndpi_struct, flow, NDPI_INVALID_CHARACTERS, "Invalid method name"); + ndpi_set_risk(flow, NDPI_INVALID_CHARACTERS, "Invalid method name"); flow->protos.thrift.method[0] = '\0'; } else { strncpy(flow->protos.thrift.method, method, ndpi_min(sizeof(flow->protos.thrift.method), method_length)); } } -static void thrift_set_type(struct ndpi_detection_module_struct *ndpi_struct, - struct ndpi_flow_struct *flow, +static void thrift_set_type(struct ndpi_flow_struct *flow, uint8_t message_type) { if (message_type == TMT_INVALID_TMESSAGE_TYPE) { - ndpi_set_risk(ndpi_struct, flow, NDPI_MALFORMED_PACKET, "Invalid message type"); + ndpi_set_risk(flow, NDPI_MALFORMED_PACKET, "Invalid message type"); } flow->protos.thrift.message_type = message_type; if (message_type == TMT_EXCEPTION) { - ndpi_set_risk(ndpi_struct, flow, NDPI_ERROR_CODE_DETECTED, "Apache Thrift Exception"); + ndpi_set_risk(flow, NDPI_ERROR_CODE_DETECTED, "Apache Thrift Exception"); } } @@ -168,8 +166,8 @@ static void ndpi_dissect_strict_hdr(struct ndpi_detection_module_struct *ndpi_st ndpi_int_thrift_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_UNKNOWN); - thrift_set_method(ndpi_struct, flow, strict_hdr->method, method_length); - thrift_set_type(ndpi_struct, flow, strict_hdr->message_type); + thrift_set_method(flow, strict_hdr->method, method_length); + thrift_set_type(flow, strict_hdr->message_type); } static void ndpi_dissect_compact_hdr(struct ndpi_detection_module_struct *ndpi_struct, @@ -200,8 +198,8 @@ static void ndpi_dissect_compact_hdr(struct ndpi_detection_module_struct *ndpi_s ndpi_int_thrift_add_connection(ndpi_struct, flow, NDPI_PROTOCOL_UNKNOWN); - thrift_set_method(ndpi_struct, flow, compact_hdr->method, compact_hdr->method_length); - thrift_set_type(ndpi_struct, flow, compact_hdr->message_type); + thrift_set_method(flow, compact_hdr->method, compact_hdr->method_length); + thrift_set_type(flow, compact_hdr->message_type); } static void ndpi_search_thrift_tcp_udp(struct ndpi_detection_module_struct *ndpi_struct, |