diff --git a/packet_sniffer/report.txt b/packet_sniffer/report.txt index 4a621b18..2b9378c4 100644 --- a/packet_sniffer/report.txt +++ b/packet_sniffer/report.txt @@ -4,10 +4,10 @@ <><> Packets are sniffed from adapter 'en0' <><> <><> Report updates info -<><> Report start time: 16/08/2022 15:38:48 -<><> Report last update: 16/08/2022 15:38:58 -<><> Report update frequency: every 5 seconds -<><> Number of times report was updated: 2 +<><> Report start time: 16/08/2022 16:25:14 +<><> Report last update: 16/08/2022 16:26:02 +<><> Report update frequency: every 2 seconds +<><> Number of times report was updated: 20 <><> <><> Filters <><> Considering address:port pairs featured by any number of packets diff --git a/packet_sniffer/src/main.rs b/packet_sniffer/src/main.rs index aeb91f54..725bad50 100644 --- a/packet_sniffer/src/main.rs +++ b/packet_sniffer/src/main.rs @@ -255,7 +255,7 @@ fn set_status_by_key(status_pair: Arc<(Mutex, Condvar)>) { InputEvent::Keyboard(KeyEvent::Char('s')) => { *status = Status::Stop; cvar.notify_all(); - println!("\n\t{}", "Capture stopped\r".red()); + println!("\n\t{}", "Capture stopped\n\r".red()); return; } _ => { /* Other events */ } diff --git a/packet_sniffer/src/thread_parse_packets_functions.rs b/packet_sniffer/src/thread_parse_packets_functions.rs index 74b281fc..b2b0756f 100644 --- a/packet_sniffer/src/thread_parse_packets_functions.rs +++ b/packet_sniffer/src/thread_parse_packets_functions.rs @@ -30,6 +30,8 @@ use crate::{AddressPort, AppProtocol, ReportInfo, Status, TransProtocol}; /// ```-t``` option. /// /// * `mutex_map` - Mutex to permit exclusive access to the shared variable in which the parsed packets are inserted. +/// +/// * `status_pair` - Shared variable to check the application current status. pub fn parse_packets_loop(mut cap: Capture, lowest_port: u16, highest_port: u16, network_layer_filter: String, transport_layer_filter: String, mutex_map: Arc>>, diff --git a/packet_sniffer/src/thread_write_report_functions.rs b/packet_sniffer/src/thread_write_report_functions.rs index c8e2dc09..5f975d7a 100644 --- a/packet_sniffer/src/thread_write_report_functions.rs +++ b/packet_sniffer/src/thread_write_report_functions.rs @@ -46,6 +46,8 @@ use crate::{AddressPort, ReportInfo, Status}; /// ```-o``` option. /// /// * `mutex_map` - Mutex to permit exclusive access to the shared variable containing the parsed packets. +/// +/// * `status_pair` - Shared variable to check the application current status. pub fn sleep_and_write_report_loop(lowest_port: u16, highest_port: u16, interval: u64, min_packets: u32, device_name: String, network_layer: String, transport_layer: String, output_file: String, mutex_map: Arc>>, diff --git a/packet_sniffer/target/debug/.fingerprint/packet_sniffer-e082052473f402b2/doc-bin-packet_sniffer b/packet_sniffer/target/debug/.fingerprint/packet_sniffer-e082052473f402b2/doc-bin-packet_sniffer index 17c378a0..e76a5e99 100644 --- a/packet_sniffer/target/debug/.fingerprint/packet_sniffer-e082052473f402b2/doc-bin-packet_sniffer +++ b/packet_sniffer/target/debug/.fingerprint/packet_sniffer-e082052473f402b2/doc-bin-packet_sniffer @@ -1 +1 @@ -22c8030a7ec18d42 \ No newline at end of file +81d1caf43e23eb94 \ No newline at end of file diff --git a/packet_sniffer/target/debug/.fingerprint/packet_sniffer-e082052473f402b2/doc-bin-packet_sniffer.json b/packet_sniffer/target/debug/.fingerprint/packet_sniffer-e082052473f402b2/doc-bin-packet_sniffer.json index 1b10a0cd..a0fdb535 100644 --- a/packet_sniffer/target/debug/.fingerprint/packet_sniffer-e082052473f402b2/doc-bin-packet_sniffer.json +++ b/packet_sniffer/target/debug/.fingerprint/packet_sniffer-e082052473f402b2/doc-bin-packet_sniffer.json @@ -1 +1 @@ -{"rustc":1057704222874089767,"features":"[]","target":1089383778197212572,"profile":7205898968962111825,"path":1684066648322511884,"deps":[[1007160655150010859,"etherparse",false,2001235469302492025],[2546391497213564629,"crossterm",false,12305349783692866968],[10684445640410993552,"clap",false,518261689120114046],[13706948548054529507,"pcap",false,18010210317093663328],[14419135841914355888,"chrono",false,12893910902775493131],[17707344772896049979,"colored",false,16682548037058840226]],"local":[{"Precalculated":"1660659606.777190526s (src/main.rs)"}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file +{"rustc":1057704222874089767,"features":"[]","target":1089383778197212572,"profile":7205898968962111825,"path":1684066648322511884,"deps":[[1007160655150010859,"etherparse",false,2001235469302492025],[2546391497213564629,"crossterm",false,12305349783692866968],[10684445640410993552,"clap",false,518261689120114046],[13706948548054529507,"pcap",false,18010210317093663328],[14419135841914355888,"chrono",false,12893910902775493131],[17707344772896049979,"colored",false,16682548037058840226]],"local":[{"Precalculated":"1660660310.266129890s (src/thread_write_report_functions.rs)"}],"rustflags":[],"metadata":7797948686568424061,"config":2202906307356721367,"compile_kind":0} \ No newline at end of file diff --git a/packet_sniffer/target/debug/deps/packet_sniffer-dc5f7f27d88e7304 b/packet_sniffer/target/debug/deps/packet_sniffer-dc5f7f27d88e7304 index 89226869..c670c872 100755 Binary files a/packet_sniffer/target/debug/deps/packet_sniffer-dc5f7f27d88e7304 and b/packet_sniffer/target/debug/deps/packet_sniffer-dc5f7f27d88e7304 differ diff --git a/packet_sniffer/target/debug/deps/packet_sniffer-dc5f7f27d88e7304.packet_sniffer.5f51af02-cgu.9.rcgu.o b/packet_sniffer/target/debug/deps/packet_sniffer-dc5f7f27d88e7304.packet_sniffer.5f51af02-cgu.9.rcgu.o index c3fd57dd..3814a610 100644 Binary files a/packet_sniffer/target/debug/deps/packet_sniffer-dc5f7f27d88e7304.packet_sniffer.5f51af02-cgu.9.rcgu.o and b/packet_sniffer/target/debug/deps/packet_sniffer-dc5f7f27d88e7304.packet_sniffer.5f51af02-cgu.9.rcgu.o differ diff --git a/packet_sniffer/target/debug/packet_sniffer b/packet_sniffer/target/debug/packet_sniffer index 89226869..c670c872 100755 Binary files a/packet_sniffer/target/debug/packet_sniffer and b/packet_sniffer/target/debug/packet_sniffer differ diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.analyze_network_header.html b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.analyze_network_header.html index aa24554e..90b8c43b 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.analyze_network_header.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.analyze_network_header.html @@ -1,6 +1,6 @@ analyze_network_header in packet_sniffer::thread_parse_packets_functions - Rust

Function packet_sniffer::thread_parse_packets_functions::analyze_network_header[−][src]

fn analyze_network_header(
    network_header: Option<IpHeader>,
    exchanged_bytes: &mut u32,
    network_layer: &mut String,
    address1: &mut String,
    address2: &mut String,
    skip_packet: &mut bool
)
Expand description

This function analyzes the network layer header passed as parameter and updates variables +

Function packet_sniffer::thread_parse_packets_functions::analyze_network_header[−][src]

fn analyze_network_header(
    network_header: Option<IpHeader>,
    exchanged_bytes: &mut u32,
    network_layer: &mut String,
    address1: &mut String,
    address2: &mut String,
    skip_packet: &mut bool
)
Expand description

This function analyzes the network layer header passed as parameter and updates variables passed by reference on the basis of the packet header content.

Arguments

    diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.analyze_transport_header.html b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.analyze_transport_header.html index 41196099..c570d077 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.analyze_transport_header.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.analyze_transport_header.html @@ -1,6 +1,6 @@ analyze_transport_header in packet_sniffer::thread_parse_packets_functions - Rust

    Function packet_sniffer::thread_parse_packets_functions::analyze_transport_header[−][src]

    fn analyze_transport_header(
        transport_header: Option<TransportHeader>,
        transport_layer: &mut String,
        port1: &mut u16,
        port2: &mut u16,
        application_protocol_1: &mut Option<AppProtocol>,
        application_protocol_2: &mut Option<AppProtocol>,
        application_protocols: &mut HashSet<AppProtocol>,
        transport_protocol: &mut TransProtocol,
        skip_packet: &mut bool
    )
    Expand description

    This function analyzes the transport layer header passed as parameter and updates variables +

    Function packet_sniffer::thread_parse_packets_functions::analyze_transport_header[−][src]

    fn analyze_transport_header(
        transport_header: Option<TransportHeader>,
        transport_layer: &mut String,
        port1: &mut u16,
        port2: &mut u16,
        application_protocol_1: &mut Option<AppProtocol>,
        application_protocol_2: &mut Option<AppProtocol>,
        application_protocols: &mut HashSet<AppProtocol>,
        transport_protocol: &mut TransProtocol,
        skip_packet: &mut bool
    )
    Expand description

    This function analyzes the transport layer header passed as parameter and updates variables passed by reference on the basis of the packet header content.

    Arguments

      diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.from_port_to_application_protocol.html b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.from_port_to_application_protocol.html index 7582ca71..c2fa9f0d 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.from_port_to_application_protocol.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.from_port_to_application_protocol.html @@ -1,6 +1,6 @@ from_port_to_application_protocol in packet_sniffer::thread_parse_packets_functions - Rust

      Function packet_sniffer::thread_parse_packets_functions::from_port_to_application_protocol[−][src]

      fn from_port_to_application_protocol(port: u16) -> Option<AppProtocol>
      Expand description

      Given an integer in the range 0..=65535, this function returns an Option<AppProtocol> containing +

      Function packet_sniffer::thread_parse_packets_functions::from_port_to_application_protocol[−][src]

      fn from_port_to_application_protocol(port: u16) -> Option<AppProtocol>
      Expand description

      Given an integer in the range 0..=65535, this function returns an Option<AppProtocol> containing the respective application protocol represented by a value of the AppProtocol enum. Only the most common application layer protocols are considered; if a unknown port number is provided, this function returns None.

      diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.modify_or_insert_destination_in_map.html b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.modify_or_insert_destination_in_map.html index f39aa2ce..81fd03f5 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.modify_or_insert_destination_in_map.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.modify_or_insert_destination_in_map.html @@ -1,6 +1,6 @@ modify_or_insert_destination_in_map in packet_sniffer::thread_parse_packets_functions - Rust

      Function packet_sniffer::thread_parse_packets_functions::modify_or_insert_destination_in_map[−][src]

      fn modify_or_insert_destination_in_map(
          mutex_map: Arc<Mutex<HashMap<AddressPort, ReportInfo>>>,
          key: AddressPort,
          exchanged_bytes: u32,
          transport_protocol: TransProtocol,
          application_protocol_1: Option<AppProtocol>,
          application_protocol_2: Option<AppProtocol>,
          application_protocols: HashSet<AppProtocol>
      )
      Expand description

      Function to insert the destination of a packet into the shared map containing the analyzed traffic.

      +

      Function packet_sniffer::thread_parse_packets_functions::modify_or_insert_destination_in_map[−][src]

      fn modify_or_insert_destination_in_map(
          mutex_map: Arc<Mutex<HashMap<AddressPort, ReportInfo>>>,
          key: AddressPort,
          exchanged_bytes: u32,
          transport_protocol: TransProtocol,
          application_protocol_1: Option<AppProtocol>,
          application_protocol_2: Option<AppProtocol>,
          application_protocols: HashSet<AppProtocol>
      )
      Expand description

      Function to insert the destination of a packet into the shared map containing the analyzed traffic.

      Arguments

      • diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.modify_or_insert_source_in_map.html b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.modify_or_insert_source_in_map.html index b969d0ae..8028c39b 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.modify_or_insert_source_in_map.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.modify_or_insert_source_in_map.html @@ -1,6 +1,6 @@ modify_or_insert_source_in_map in packet_sniffer::thread_parse_packets_functions - Rust

        Function packet_sniffer::thread_parse_packets_functions::modify_or_insert_source_in_map[−][src]

        fn modify_or_insert_source_in_map(
            mutex_map: Arc<Mutex<HashMap<AddressPort, ReportInfo>>>,
            key: AddressPort,
            exchanged_bytes: u32,
            transport_protocol: TransProtocol,
            application_protocol_1: Option<AppProtocol>,
            application_protocol_2: Option<AppProtocol>,
            application_protocols: HashSet<AppProtocol>
        )
        Expand description

        Function to insert the source of a packet into the shared map containing the analyzed traffic.

        +

        Function packet_sniffer::thread_parse_packets_functions::modify_or_insert_source_in_map[−][src]

        fn modify_or_insert_source_in_map(
            mutex_map: Arc<Mutex<HashMap<AddressPort, ReportInfo>>>,
            key: AddressPort,
            exchanged_bytes: u32,
            transport_protocol: TransProtocol,
            application_protocol_1: Option<AppProtocol>,
            application_protocol_2: Option<AppProtocol>,
            application_protocols: HashSet<AppProtocol>
        )
        Expand description

        Function to insert the source of a packet into the shared map containing the analyzed traffic.

        Arguments

        • diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.parse_packets_loop.html b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.parse_packets_loop.html index f7810998..8380ccef 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.parse_packets_loop.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/fn.parse_packets_loop.html @@ -1,6 +1,6 @@ parse_packets_loop in packet_sniffer::thread_parse_packets_functions - Rust

          Function packet_sniffer::thread_parse_packets_functions::parse_packets_loop[−][src]

          pub fn parse_packets_loop(
              cap: Capture<Active>,
              lowest_port: u16,
              highest_port: u16,
              network_layer_filter: String,
              transport_layer_filter: String,
              mutex_map: Arc<Mutex<HashMap<AddressPort, ReportInfo>>>,
              status_pair: Arc<(Mutex<Status>, Condvar)>
          )
          Expand description

          The calling thread enters in a loop in which it waits for network packets, parses them according +

          Function packet_sniffer::thread_parse_packets_functions::parse_packets_loop[−][src]

          pub fn parse_packets_loop(
              cap: Capture<Active>,
              lowest_port: u16,
              highest_port: u16,
              network_layer_filter: String,
              transport_layer_filter: String,
              mutex_map: Arc<Mutex<HashMap<AddressPort, ReportInfo>>>,
              status_pair: Arc<(Mutex<Status>, Condvar)>
          )
          Expand description

          The calling thread enters in a loop in which it waits for network packets, parses them according to the user specified filters, and inserts them into the shared map variable.

          Arguments

            @@ -26,6 +26,9 @@ through the -h option.

          • mutex_map - Mutex to permit exclusive access to the shared variable in which the parsed packets are inserted.

          • +
          • +

            status_pair - Shared variable to check the application current status.

            +
          \ No newline at end of file diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/index.html b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/index.html index 8c888696..4d3021bd 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/index.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_parse_packets_functions/index.html @@ -1,6 +1,6 @@ packet_sniffer::thread_parse_packets_functions - Rust

          Module packet_sniffer::thread_parse_packets_functions[−][src]

          Expand description

          Module containing functions executed by the thread in charge of parsing sniffed packets and +

          Module thread_parse_packets_functions

          Module packet_sniffer::thread_parse_packets_functions[−][src]

          Expand description

          Module containing functions executed by the thread in charge of parsing sniffed packets and inserting them in the shared map.

          Functions

          This function analyzes the network layer header passed as parameter and updates variables diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_min_packets_string.html b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_min_packets_string.html index e8d9a12a..a40a7cb6 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_min_packets_string.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_min_packets_string.html @@ -1,6 +1,6 @@ get_min_packets_string in packet_sniffer::thread_write_report_functions - Rust

          Function packet_sniffer::thread_write_report_functions::get_min_packets_string[−][src]

          fn get_min_packets_string(min_packets: u32) -> String
          Expand description

          Given the minimum packets number, the function generates the corresponding String +

          Function packet_sniffer::thread_write_report_functions::get_min_packets_string[−][src]

          fn get_min_packets_string(min_packets: u32) -> String
          Expand description

          Given the minimum packets number, the function generates the corresponding String to be used in the output report file header.

          Arguments

            diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_network_layer_string.html b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_network_layer_string.html index 59dcb020..5091983b 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_network_layer_string.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_network_layer_string.html @@ -1,6 +1,6 @@ get_network_layer_string in packet_sniffer::thread_write_report_functions - Rust

            Function packet_sniffer::thread_write_report_functions::get_network_layer_string[−][src]

            fn get_network_layer_string(network_layer: String) -> String
            Expand description

            Given the network layer textual filter, the function generates the corresponding String +

            Function packet_sniffer::thread_write_report_functions::get_network_layer_string[−][src]

            fn get_network_layer_string(network_layer: String) -> String
            Expand description

            Given the network layer textual filter, the function generates the corresponding String to be used in the output report file header.

            Arguments

              diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_ports_string.html b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_ports_string.html index aebab406..dad8760e 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_ports_string.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_ports_string.html @@ -1,6 +1,6 @@ get_ports_string in packet_sniffer::thread_write_report_functions - Rust

              Function packet_sniffer::thread_write_report_functions::get_ports_string[−][src]

              fn get_ports_string(lowest_port: u16, highest_port: u16) -> String
              Expand description

              Given the lowest and highest port numbers, the function generates the corresponding String +

              Function packet_sniffer::thread_write_report_functions::get_ports_string[−][src]

              fn get_ports_string(lowest_port: u16, highest_port: u16) -> String
              Expand description

              Given the lowest and highest port numbers, the function generates the corresponding String to be used in the output report file header.

              Arguments

                diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_transport_layer_string.html b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_transport_layer_string.html index 30e9f364..aa43bf85 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_transport_layer_string.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.get_transport_layer_string.html @@ -1,6 +1,6 @@ get_transport_layer_string in packet_sniffer::thread_write_report_functions - Rust

                Function packet_sniffer::thread_write_report_functions::get_transport_layer_string[−][src]

                fn get_transport_layer_string(transport_layer: String) -> String
                Expand description

                Given the transport layer textual filter, the function generates the corresponding String +

                Function packet_sniffer::thread_write_report_functions::get_transport_layer_string[−][src]

                fn get_transport_layer_string(transport_layer: String) -> String
                Expand description

                Given the transport layer textual filter, the function generates the corresponding String to be used in the output report file header.

                Arguments

                  diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.sleep_and_write_report_loop.html b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.sleep_and_write_report_loop.html index 0ae59882..2ac81ba1 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.sleep_and_write_report_loop.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.sleep_and_write_report_loop.html @@ -1,6 +1,6 @@ sleep_and_write_report_loop in packet_sniffer::thread_write_report_functions - Rust

                  Function packet_sniffer::thread_write_report_functions::sleep_and_write_report_loop[−][src]

                  pub fn sleep_and_write_report_loop(
                      lowest_port: u16,
                      highest_port: u16,
                      interval: u64,
                      min_packets: u32,
                      device_name: String,
                      network_layer: String,
                      transport_layer: String,
                      output_file: String,
                      mutex_map: Arc<Mutex<HashMap<AddressPort, ReportInfo>>>,
                      status_pair: Arc<(Mutex<Status>, Condvar)>
                  )
                  Expand description

                  The calling thread enters in a loop in which it waits for interval seconds and then re-write +

                  Function packet_sniffer::thread_write_report_functions::sleep_and_write_report_loop[−][src]

                  pub fn sleep_and_write_report_loop(
                      lowest_port: u16,
                      highest_port: u16,
                      interval: u64,
                      min_packets: u32,
                      device_name: String,
                      network_layer: String,
                      transport_layer: String,
                      output_file: String,
                      mutex_map: Arc<Mutex<HashMap<AddressPort, ReportInfo>>>,
                      status_pair: Arc<(Mutex<Status>, Condvar)>
                  )
                  Expand description

                  The calling thread enters in a loop in which it waits for interval seconds and then re-write from scratch the output report file, with updated values.

                  Arguments

                    @@ -39,6 +39,9 @@ Specified by the user through the -m option.

                  • mutex_map - Mutex to permit exclusive access to the shared variable containing the parsed packets.

                  • +
                  • +

                    status_pair - Shared variable to check the application current status.

                    +
                  \ No newline at end of file diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.write_report_file_header.html b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.write_report_file_header.html index 0800b152..7f99e1db 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.write_report_file_header.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/fn.write_report_file_header.html @@ -1,6 +1,6 @@ write_report_file_header in packet_sniffer::thread_write_report_functions - Rust

                  Function packet_sniffer::thread_write_report_functions::write_report_file_header[−][src]

                  fn write_report_file_header(
                      output: File,
                      device_name: String,
                      first_timestamp: String,
                      times_report_updated: i32,
                      interval: u64,
                      lowest_port: u16,
                      highest_port: u16,
                      min_packets: u32,
                      network_layer: String,
                      transport_layer: String
                  )
                  Expand description

                  Writes the output report file header, which contains useful info about the sniffing process.

                  +

                  Function packet_sniffer::thread_write_report_functions::write_report_file_header[−][src]

                  fn write_report_file_header(
                      output: File,
                      device_name: String,
                      first_timestamp: String,
                      times_report_updated: i32,
                      interval: u64,
                      lowest_port: u16,
                      highest_port: u16,
                      min_packets: u32,
                      network_layer: String,
                      transport_layer: String
                  )
                  Expand description

                  Writes the output report file header, which contains useful info about the sniffing process.

                  Arguments

                  • diff --git a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/index.html b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/index.html index 33db7938..8ce5c00a 100644 --- a/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/index.html +++ b/packet_sniffer/target/doc/packet_sniffer/thread_write_report_functions/index.html @@ -1,6 +1,6 @@ packet_sniffer::thread_write_report_functions - Rust

                    Module packet_sniffer::thread_write_report_functions[−][src]

                    Expand description

                    Module containing functions executed by the thread in charge of updating the output report +

                    Module thread_write_report_functions

                    Module packet_sniffer::thread_write_report_functions[−][src]

                    Expand description

                    Module containing functions executed by the thread in charge of updating the output report every interval seconds, with interval specified by the user through the -i command line option.

                    If the -i option is not specified, the report is updated every 5 seconds.

                    diff --git a/packet_sniffer/target/doc/src/packet_sniffer/main.rs.html b/packet_sniffer/target/doc/src/packet_sniffer/main.rs.html index 28a78170..c1528a17 100644 --- a/packet_sniffer/target/doc/src/packet_sniffer/main.rs.html +++ b/packet_sniffer/target/doc/src/packet_sniffer/main.rs.html @@ -523,7 +523,7 @@ InputEvent::Keyboard(KeyEvent::Char('s')) => { *status = Status::Stop; cvar.notify_all(); - println!("\n\t{}", "Capture stopped\r".red()); + println!("\n\t{}", "Capture stopped\n\r".red()); return; } _ => { /* Other events */ } diff --git a/packet_sniffer/target/doc/src/packet_sniffer/thread_parse_packets_functions.rs.html b/packet_sniffer/target/doc/src/packet_sniffer/thread_parse_packets_functions.rs.html index 74556df8..e604915a 100644 --- a/packet_sniffer/target/doc/src/packet_sniffer/thread_parse_packets_functions.rs.html +++ b/packet_sniffer/target/doc/src/packet_sniffer/thread_parse_packets_functions.rs.html @@ -398,6 +398,8 @@ 396 397 398 +399 +400
                    //! Module containing functions executed by the thread in charge of parsing sniffed packets and
                     //! inserting them in the shared map.
                     
                    @@ -430,6 +432,8 @@
                     /// ```-t``` option.
                     ///
                     /// * `mutex_map` - Mutex to permit exclusive access to the shared variable in which the parsed packets are inserted.
                    +///
                    +/// * `status_pair` - Shared variable to check the application current status.
                     pub fn parse_packets_loop(mut cap: Capture<Active>, lowest_port: u16, highest_port: u16,
                                               network_layer_filter: String, transport_layer_filter: String,
                                               mutex_map: Arc<Mutex<HashMap<AddressPort,ReportInfo>>>,
                    diff --git a/packet_sniffer/target/doc/src/packet_sniffer/thread_write_report_functions.rs.html b/packet_sniffer/target/doc/src/packet_sniffer/thread_write_report_functions.rs.html
                    index 3c7ee104..c14ea51b 100644
                    --- a/packet_sniffer/target/doc/src/packet_sniffer/thread_write_report_functions.rs.html
                    +++ b/packet_sniffer/target/doc/src/packet_sniffer/thread_write_report_functions.rs.html
                    @@ -259,6 +259,8 @@
                     257
                     258
                     259
                    +260
                    +261
                     
                    //! Module containing functions executed by the thread in charge of updating the output report
                     //! every ```interval``` seconds, with ```interval``` specified by the user through the
                     //! ```-i``` command line option.
                    @@ -307,6 +309,8 @@
                     /// ```-o``` option.
                     ///
                     /// * `mutex_map` - Mutex to permit exclusive access to the shared variable containing the parsed packets.
                    +///
                    +/// * `status_pair` - Shared variable to check the application current status.
                     pub fn sleep_and_write_report_loop(lowest_port: u16, highest_port: u16, interval: u64, min_packets: u32,
                                                        device_name: String, network_layer: String, transport_layer: String,
                                                        output_file: String, mutex_map: Arc<Mutex<HashMap<AddressPort,ReportInfo>>>,