-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #3 from mozilla/feat-readme
feat: Add a README
- Loading branch information
Showing
1 changed file
with
27 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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<usize, Error> | ||
``` | ||
|
||
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. |