Add some docs.

This commit is contained in:
whitequark 2017-09-24 23:29:42 +00:00
parent 0e88617b82
commit 38f648affb
3 changed files with 5 additions and 0 deletions

View File

@ -28,6 +28,7 @@ impl fmt::Display for EtherType {
pub struct Address(pub [u8; 6]);
impl Address {
/// The broadcast address.
pub const BROADCAST: Address = Address([0xff; 6]);
/// Construct an Ethernet address from a sequence of octets, in big-endian.

View File

@ -135,6 +135,7 @@ pub struct Endpoint {
}
impl Endpoint {
/// An endpoint with unspecified address and port.
pub const UNSPECIFIED: Endpoint = Endpoint { addr: Address::Unspecified, port: 0 };
/// Create an endpoint address from given address and port.

View File

@ -12,7 +12,10 @@ pub use super::IpProtocol as Protocol;
pub struct Address(pub [u8; 4]);
impl Address {
/// An unspecified address.
pub const UNSPECIFIED: Address = Address([0x00; 4]);
/// The broadcast address.
pub const BROADCAST: Address = Address([0xff; 4]);
/// Construct an IPv4 address from parts.