Skip to content

Commit

Permalink
config: extend unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
IvanNardi committed Dec 11, 2023
1 parent 4d9ec7f commit 8b08d13
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 4 deletions.
2 changes: 1 addition & 1 deletion example/ndpiReader.c
Original file line number Diff line number Diff line change
Expand Up @@ -1006,7 +1006,7 @@ static void parseOptions(int argc, char **argv) {

case 'd':
enable_protocol_guess = 0;
if(__add_cfg(NULL, "guess_on_giveup", "0") == 1) {
if(__add_cfg(NULL, ndpi_strdup("guess_on_giveup"), ndpi_strdup("0")) == 1) {
printf("Invalid parameter [%s] [num:%d/%d]\n", optarg, num_cfgs, MAX_NUM_CFGS);
exit(1);
}
Expand Down
3 changes: 1 addition & 2 deletions python/ndpi/ndpi.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,9 @@ def process_packet(self, flow, packet, packet_time_ms, input_info):
app_protocol=p.app_protocol,
category=p.category)

def giveup(self, flow, enable_guess=True):
def giveup(self, flow):
p = lib.ndpi_detection_giveup(self._detection_module,
flow.C,
enable_guess,
ffi.new("uint8_t*", 0))
return ndpi_protocol(C=p,
master_protocol=p.master_protocol,
Expand Down
1 change: 0 additions & 1 deletion python/ndpi/ndpi_build.py
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,6 @@
const struct ndpi_flow_input_info *input_info);
ndpi_protocol ndpi_detection_giveup(struct ndpi_detection_module_struct *ndpi_struct,
struct ndpi_flow_struct *flow,
u_int8_t enable_guess,
u_int8_t *protocol_was_guessed);
void ndpi_py_setup_detection_module(struct ndpi_detection_module_struct *mod);
struct ndpi_flow_struct * ndpi_py_initialize_flow(void);
Expand Down
1 change: 1 addition & 0 deletions tests/cfgs/guessing_disable/config.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
-d
1 change: 1 addition & 0 deletions tests/cfgs/guessing_disable/pcap/webex.pcap
Loading

0 comments on commit 8b08d13

Please sign in to comment.