Skip to content

Commit

Permalink
Add some docs.
Browse files Browse the repository at this point in the history
whitequark committed Sep 24, 2017
1 parent 0454c3f commit 2d31ef9
Showing 3 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions src/wire/ethernet.rs
Original file line number Diff line number Diff line change
@@ -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.
1 change: 1 addition & 0 deletions src/wire/ip.rs
Original file line number Diff line number Diff line change
@@ -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.
3 changes: 3 additions & 0 deletions src/wire/ipv4.rs
Original file line number Diff line number Diff line change
@@ -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.

0 comments on commit 2d31ef9

Please sign in to comment.