From 65b15abc00f4d9a8506195a1527b95869c2cae2c Mon Sep 17 00:00:00 2001 From: Lars Eggert Date: Mon, 2 Sep 2024 12:15:02 +0300 Subject: [PATCH] feat: Add a README --- README.md | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..a6b1f41 --- /dev/null +++ b/README.md @@ -0,0 +1,27 @@ +# MTU + +A crate to return the maximum transmission unit (MTU) of the local network interface towards a given destination `SocketAddr`. + +## Usage + +This crate exports a single function + +```rust +pub fn get_interface_mtu(remote: &SocketAddr) -> Result +``` + +that returns the MTU of the local network interface towards the `remote` destination, or an `Error` when the MTU could not be determined. It supports both IPv4 and IPv6. + +## Supported Platforms + +* Linux +* macOS +* Windows + +## Notes + +The returned MTU may exceed the maximum IP packet size of 65,535 bytes on some platforms for some remote destinations. (For example, loopback destinations on Windows.) + +## Contributing + +We're happy to receive PRs that improve this crate. Please take a look at our [community guidelines](CODE_OF_CONDUCT.md) beforehand.