Lines Matching refs:octets
50 /// They are usually represented as four octets.
58 /// `Ipv4Addr` provides a [`FromStr`] implementation. The four octets are in decimal
74 /// assert!("012.004.002.000".parse::<Ipv4Addr>().is_err()); // all octets are in octal
76 /// assert!("0xcb.0x0.0x71.0x00".parse::<Ipv4Addr>().is_err()); // all octets are in hex
81 octets: [u8; 4],
163 octets: [u8; 16],
467 /// Creates a new IPv4 address from four eight-bit octets.
487 octets: [a, b, c, d],
541 /// assert_eq!(addr.octets(), [127, 0, 0, 1]);
550 pub const fn octets(&self) -> [u8; 4] {
551 self.octets
577 u32::from_be_bytes(self.octets) == 0
602 self.octets()[0] == 127
636 match self.octets() {
667 matches!(self.octets(), [169, 254, ..])
750 !(self.octets()[0] == 0 // "This network"
756 ||(self.octets()[0] == 192 && self.octets()[1] == 0 && self.octets()[2] == 0)
786 self.octets()[0] == 100 && (self.octets()[1] & 0b1100_0000 == 0b0100_0000)
815 self.octets()[0] == 198 && (self.octets()[1] & 0xfe) == 18
853 self.octets()[0] & 240 == 240 && !self.is_broadcast()
880 self.octets()[0] >= 224 && self.octets()[0] <= 239
885 /// A broadcast address has all octets set to `255` as defined in [IETF RFC 919].
905 u32::from_be_bytes(self.octets()) == u32::from_be_bytes(Self::BROADCAST.octets())
937 self.octets(),
971 let [a, b, c, d] = self.octets();
973 octets: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, a, b, c, d],
1001 let [a, b, c, d] = self.octets();
1003 octets: [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0xFF, 0xFF, a, b, c, d],
1108 self.octets.cmp(&other.octets)
1126 u32::from_be_bytes(ip.octets)
1145 octets: ip.to_be_bytes(),
1163 fn from(octets: [u8; 4]) -> Ipv4Addr {
1164 Ipv4Addr { octets }
1181 fn from(octets: [u8; 4]) -> IpAddr {
1182 IpAddr::V4(Ipv4Addr::from(octets))
1219 octets: unsafe { transmute::<_, [u8; 16]>(addr16) },
1267 // All elements in `self.octets` must be big endian.
1269 let [a, b, c, d, e, f, g, h] = unsafe { transmute::<_, [u16; 8]>(self.octets) };
1305 u128::from_be_bytes(self.octets()) == u128::from_be_bytes(Ipv6Addr::UNSPECIFIED.octets())
1332 u128::from_be_bytes(self.octets()) == u128::from_be_bytes(Ipv6Addr::LOCALHOST.octets())
1419 u128::from_be_bytes(self.octets()) == 0x2001_0001_0000_0000_0000_0000_0000_0001
1421 || u128::from_be_bytes(self.octets()) == 0x2001_0001_0000_0000_0000_0000_0000_0002
1739 match self.octets() {
1825 /// assert_eq!(Ipv6Addr::new(0xff00, 0, 0, 0, 0, 0, 0, 0).octets(),
1835 pub const fn octets(&self) -> [u8; 16] {
1836 self.octets
1917 u128::from_be_bytes(ip.octets)
1967 fn from(octets: [u8; 16]) -> Ipv6Addr {
1968 Ipv6Addr { octets }
2026 fn from(octets: [u8; 16]) -> IpAddr {
2027 IpAddr::V6(Ipv6Addr::from(octets))