Add some docs.
This commit is contained in:
parent
0e88617b82
commit
38f648affb
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue