pub struct ClientSubnet { /* private fields */ }Expand description
RFC 7871, Client Subnet, Optional
+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ 0: | FAMILY | +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ 2: | SOURCE PREFIX-LENGTH | SCOPE PREFIX-LENGTH | +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+ 4: | ADDRESS… / +—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+—+
o FAMILY, 2 octets, indicates the family of the address contained in the option, using address family codes as assigned by IANA in Address Family Numbers [Address_Family_Numbers]. o SOURCE PREFIX-LENGTH, an unsigned octet representing the leftmost number of significant bits of ADDRESS to be used for the lookup. In responses, it mirrors the same value as in the queries. o SCOPE PREFIX-LENGTH, an unsigned octet representing the leftmost number of significant bits of ADDRESS that the response covers. In queries, it MUST be set to 0. o ADDRESS, variable number of octets, contains either an IPv4 or IPv6 address, depending on FAMILY, which MUST be truncated to the number of bits indicated by the SOURCE PREFIX-LENGTH field, padding with 0 bits to pad to the end of the last octet needed. o A server receiving an ECS option that uses either too few or too many ADDRESS octets, or that has non-zero ADDRESS bits set beyond SOURCE PREFIX-LENGTH, SHOULD return FORMERR to reject the packet, as a signal to the software developer making the request to fix their implementation.
Implementations§
Trait Implementations§
Source§impl<'a> BinDecodable<'a> for ClientSubnet
impl<'a> BinDecodable<'a> for ClientSubnet
Source§fn read(decoder: &mut BinDecoder<'a>) -> ProtoResult<Self>
fn read(decoder: &mut BinDecoder<'a>) -> ProtoResult<Self>
Source§fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
fn from_bytes(bytes: &'r [u8]) -> ProtoResult<Self>
Source§impl BinEncodable for ClientSubnet
impl BinEncodable for ClientSubnet
Source§fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
fn emit(&self, encoder: &mut BinEncoder<'_>) -> ProtoResult<()>
Source§impl Clone for ClientSubnet
impl Clone for ClientSubnet
Source§fn clone(&self) -> ClientSubnet
fn clone(&self) -> ClientSubnet
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more