minor fixes

This commit is contained in:
Giuliano Bellini s294739
2024-02-10 12:09:12 +01:00
parent a7bd130463
commit d26707d028
4 changed files with 10 additions and 5 deletions

View File

@@ -330,13 +330,14 @@ ## Supported network services
Please, remember that this is just a convention:
> **Warning**
> [!WARNING]
>
> The Internet Assigned Numbers Authority (IANA) is responsible for maintaining
> the official assignments of port numbers for specific uses. <br>
> However, many unofficial uses of well-known port numbers occur in practice.
The full list of services is generated from Nmap's service collection and is available in the file `services.txt`.
Sniffnet's list of services is generated from [Nmap's service collection](https://nmap.org/book/nmap-services.html)
and is available in the file [`services.txt`](https://raw.githubusercontent.com/GyulyVGC/sniffnet/main/services.txt).
</details>

View File

@@ -31,8 +31,8 @@ fn set_icon() {
}
fn build_services_phf() {
let path = Path::new(&env::var("OUT_DIR").unwrap()).join("services.rs");
let mut file = BufWriter::new(File::create(path).unwrap());
let out_path = Path::new(&env::var("OUT_DIR").unwrap()).join("services.rs");
let mut output = BufWriter::new(File::create(out_path).unwrap());
let mut services_map = phf_codegen::Map::new();
@@ -53,7 +53,7 @@ fn build_services_phf() {
assert_eq!(num_entries, 12066);
writeln!(
&mut file,
&mut output,
"#[allow(clippy::unreadable_literal)]\n\
static SERVICES: phf::Map<ServiceQuery, Service> = {};",
services_map.build()

View File

@@ -1,3 +1,5 @@
// WARNING: this file is imported in build.rs
/// Enum representing the possible observed values of protocol.
#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash)]
#[allow(clippy::upper_case_acronyms)]

View File

@@ -1,3 +1,5 @@
// WARNING: this file is imported in build.rs
use std::hash::Hash;
/// Used to query the phf services map (key of the map).