From fcf7ecb2f21673cf4fbc7450734448e6321e9f01 Mon Sep 17 00:00:00 2001 From: GyulyVGC <100347457+GyulyVGC@users.noreply.github.com> Date: Sun, 14 Aug 2022 21:40:25 +0200 Subject: [PATCH] Update README.md --- README.md | 59 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 29fb2be8..3e3c87ad 100644 --- a/README.md +++ b/README.md @@ -174,10 +174,67 @@ Specifically, the transport layer protocols field is based on an Enum with only ## Error conditions -In this section are reported the errors that may occur due to command line options wrong specification or while the program is running. +In this section are reported the errors that may occur while the application is running. ### Wrong command line options specification + +- **Not existing adapter name** + +    If a non-existing adapter name is provided, the application raises an error and terminates. + +    In this case the application will suggest to use the ```-d``` option to print on the standard output a list of the available devices. + +    ```packet_sniffer -d``` prints a list of all the available network adapters names and addresses, as in the example that follows. + +    ![Screenshot](./img/device_list.png) + + +- **Invalid highest port number** + +    If the provided highest port number is not an integer in the range ```0..=65535``` the program raises an error and terminates. + +    If also the lowest port number is specified and ```highest_port < lowest_port == true``` the program raises an error and terminates. + + +- **Invalid interval value** + +    If the provided interval value is not an integer in the range ```1..=u64::MAX``` the program raises an error and terminates. + + +- **Invalid lowest port number** + +    If the provided lowest port number is not an integer in the range ```0..=65535``` the program raises an error and terminates. + +    If also the highest port number is specified and ```highest_port < lowest_port == true``` the program raises an error and terminates. + + +- **Invalid minimum packets value** + +    If the provided minimum packets value is not an integer in the range ```0..=u32::MAX``` the program raises an error and terminates. + + +- **Invalid network layer protocol filter** + +    If a string different from "IPv4", "IPv6" or "no filter" is provided (not case sensitive), the application raises an error and terminates. + +    Note that not including the ```-n``` option is equal to provide ```-n "no filter"```. + + +- **Invalid ouput file extension** + +    There is no particular limitation on the output file name. + +    However, if an invalid file extension is provided the file may result unreadable if the extension is not subsequently removed. + + +- **Invalid transport layer protocol filter** + +    If a string different from "TCP", "UDP" or "no filter" is provided (not case sensitive), the application raises an error and terminates. + +    Note that not including the ```-t``` option is equal to provide ```-t "no filter"```. + + ### Permissions errors - **PcapError: Permission denied**