diff --git a/Cargo.toml b/Cargo.toml index e4b216c..01532e0 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -3,6 +3,7 @@ name = "smoltcp" version = "0.1.0" authors = ["whitequark "] license = "0BSD" +readme-file = "README.md" [dependencies] byteorder = { version = "0.5", default-features = false } diff --git a/README.md b/README.md index 12f9349..6fe811c 100644 --- a/README.md +++ b/README.md @@ -6,6 +6,11 @@ real-time systems. Its design goals are simplicity and robustness. Its design an include complicated compile-time computations, such as macro or type tricks, even at cost of performance degradation. +_smoltcp_ does not need heap allocation *at all*, is [extensively documented][docs], +and compiles on stable Rust. + +[docs]: https://m-labs.github.io/smoltcp/smoltcp/index.html + Features -------- diff --git a/src/lib.rs b/src/lib.rs index 8e52bb3..556954e 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,4 +1,3 @@ -#![feature(associated_consts)] #![cfg_attr(feature = "use_alloc", feature(alloc))] #![no_std] diff --git a/src/socket/udp.rs b/src/socket/udp.rs index 6dd1239..5d852d5 100644 --- a/src/socket/udp.rs +++ b/src/socket/udp.rs @@ -17,7 +17,7 @@ impl<'a> PacketBuffer<'a> { pub fn new(payload: T) -> PacketBuffer<'a> where T: Into> { PacketBuffer { - endpoint: IpEndpoint::UNSPECIFIED, + endpoint: IpEndpoint::default(), size: 0, payload: payload.into() } diff --git a/src/wire/ethernet.rs b/src/wire/ethernet.rs index 6657bfb..9230eb5 100644 --- a/src/wire/ethernet.rs +++ b/src/wire/ethernet.rs @@ -28,7 +28,7 @@ impl fmt::Display for EtherType { pub struct Address(pub [u8; 6]); impl Address { - pub const BROADCAST: Address = Address([0xff; 6]); + // pub const BROADCAST: Address = Address([0xff; 6]); /// Construct an Ethernet address from a sequence of octets, in big-endian. /// diff --git a/src/wire/ip.rs b/src/wire/ip.rs index 432946c..38a5c80 100644 --- a/src/wire/ip.rs +++ b/src/wire/ip.rs @@ -85,7 +85,7 @@ pub struct Endpoint { } impl Endpoint { - pub const UNSPECIFIED: Endpoint = Endpoint { addr: Address::Unspecified, port: 0 }; + // pub const UNSPECIFIED: Endpoint = Endpoint { addr: Address::Unspecified, port: 0 }; /// Create an endpoint address from given address and port. pub fn new(addr: Address, port: u16) -> Endpoint { diff --git a/src/wire/ipv4.rs b/src/wire/ipv4.rs index 8e83929..20d08a2 100644 --- a/src/wire/ipv4.rs +++ b/src/wire/ipv4.rs @@ -11,8 +11,8 @@ pub use super::IpProtocol as Protocol; pub struct Address(pub [u8; 4]); impl Address { - pub const UNSPECIFIED: Address = Address([0x00; 4]); - pub const BROADCAST: Address = Address([0xff; 4]); + // pub const UNSPECIFIED: Address = Address([0x00; 4]); + // pub const BROADCAST: Address = Address([0xff; 4]); /// Construct an IPv4 address from a sequence of octets, in big-endian. ///