Lines Matching refs:Address

6 use crate::wire::ipv6::Address as Ipv6Address;
86 pub enum Address { enum
93 impl Default for Address { implementation
95 Address::Extended([0u8; 8]) in default()
99 impl Address { impl
101 pub const BROADCAST: Address = Address::Short([0xff; 2]);
125 Address::Short(b) in from_bytes()
129 Address::Extended(b) in from_bytes()
137 Address::Absent => &[], in as_bytes()
138 Address::Short(value) => value, in as_bytes()
139 Address::Extended(value) => value, in as_bytes()
146 Address::Absent | Address::Short(_) => None,
147 Address::Extended(value) => {
170 impl fmt::Display for Address { implementation
391 pub fn dst_addr(&self) -> Option<Address> { in dst_addr() argument
394 AddressingMode::Absent => Some(Address::Absent), in dst_addr()
399 Some(Address::short_from_bytes(raw)) in dst_addr()
405 Some(Address::extended_from_bytes(raw)) in dst_addr()
432 pub fn src_addr(&self) -> Option<Address> { in src_addr() argument
446 AddressingMode::Absent => Some(Address::Absent), in src_addr()
451 Some(Address::short_from_bytes(raw)) in src_addr()
457 Some(Address::extended_from_bytes(raw)) in src_addr()
640 pub fn set_dst_addr(&mut self, value: Address) { in set_dst_addr() argument
642 Address::Absent => self.set_dst_addressing_mode(AddressingMode::Absent), in set_dst_addr()
643 Address::Short(mut value) => { in set_dst_addr()
650 Address::Extended(mut value) => { in set_dst_addr()
686 pub fn set_src_addr(&mut self, value: Address) { in set_src_addr() argument
697 Address::Absent => self.set_src_addressing_mode(AddressingMode::Absent), in set_src_addr()
698 Address::Short(mut value) => { in set_src_addr()
705 Address::Extended(mut value) => { in set_src_addr()
766 pub dst_addr: Option<Address>,
768 pub src_addr: Option<Address>,
797 Some(Address::Absent) | None => 0, in buffer_len()
798 Some(Address::Short(_)) => 2, in buffer_len()
799 Some(Address::Extended(_)) => 8, in buffer_len()
803 Some(Address::Absent) | None => 0, in buffer_len()
804 Some(Address::Short(_)) => 2, in buffer_len()
805 Some(Address::Extended(_)) => 8, in buffer_len()
845 assert!(Address::BROADCAST.is_broadcast()); in test_broadcast()
846 assert!(!Address::BROADCAST.is_unicast()); in test_broadcast()
862 dst_addr: Some(Address::BROADCAST), in prepare_frame()
864 src_addr: Some(Address::Extended([ in prepare_frame()
884 assert_eq!(frame.dst_addr(), Some(Address::BROADCAST)); in prepare_frame()
888 Some(Address::Extended([ in prepare_frame()
922 dst_addr -> Some(Address::Extended([0x01, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00])),
923 src_addr -> Some(Address::Extended([0x02, 0x00, 0x01, 0x00, 0x01, 0x00, 0x01, 0x00])),
944 dst_addr -> Some(Address::Short([0x56, 0x78])),
946 src_addr -> Some(Address::Short([0x9a, 0xbc])),
992 dst_addr -> Some(Address::Extended([0x00,0x12,0x4b,0x00,0x06,0x15,0x9b,0xbf])),
994 src_addr -> Some(Address::Extended([0x00,0x12,0x4b,0x00,0x14,0xb5,0xd9,0xc7])),