mdns-proto 0.2.0

Sans-I/O mDNS protocol state machines (no_std, no_alloc capable, panic-free).
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
use core::net::{IpAddr, Ipv4Addr, SocketAddr, SocketAddrV4};

use super::Transmit;

#[test]
fn accessors_return_constructed_fields() {
  let dst = SocketAddr::V4(SocketAddrV4::new(Ipv4Addr::new(224, 0, 0, 251), 5353));
  let src = IpAddr::V4(Ipv4Addr::new(192, 168, 1, 5));
  let t = Transmit::new(dst, Some(src), 42);
  assert_eq!(t.dst(), dst);
  assert_eq!(t.src_ip(), Some(src));
  assert_eq!(t.size(), 42);
}