Skip to content

pdh11/cotton

Repository files navigation

CI status codecov dependency status License: CC0-1.0

Cotton

A collection of Rust crates for low-level networking functionality.

So far:

  • cotton-netif Crates.io Crates.io docs.rs: enumerating available network interfaces and their IP addresses, including ongoing (asynchronous) comings and goings of network interfaces (e.g. on USB hotplug/unplug); so far, for Linux only.

  • cotton-ssdp Crates.io Crates.io docs.rs: implementing SSDP, the Simple Service Discovery Protocol, a mechanism for discovering available resources (service) on a local network. Uses cotton-netif, in order to do the Right Thing on multi-homed hosts (but meaning that it is unlikely to work on Windows platforms).

  • cotton-unique: creating deterministic but per-device unique identifiers such as MAC addresses. Not yet on crates.io as it depends on a small unmerged PR to the rp2040-flash crate, but released here in case anyone needs example code.

  • cotton-w5500: smoltcp driver for the Wiznet W5500 Ethernet controller in MACRAW mode, including interrupt-driven mode. Not yet on crates.io as it depends on a git prerelease of the w5500 crate, but released here in case anyone needs example code.

These crates are no_std-compatible, meaning that they can be used on embedded systems. In fact, all pushes to my local (not Github) continuous-integration server are automatically tested on both STM32 and RP2040 platforms. You can read about how that is set up on my blog: Part one, Part two, Part three.

These system-tests also serve as example code combining the Cotton crates with the wider ecosystem, including examples where the combining of the wider ecosystem components needed a little research in its own right even before involving Cotton, so perhaps that in itself will be useful to others:

My long-term goals for this project as a whole:

  • provide useful, solid, well-tested components to folks needing Rust crates for networking, including UPnP and embedded devices

  • develop skills in Rust coding, including the packaging, distributing, and publicising of it, after a career spent with C++

Everything is licensed under Creative Commons CC0, qv.

About

Low-level networking functionality in Rust

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages