fn raw_endpoint(endpoint: &SocketAddr) -> ffi::sock_udp_ep_t {
        let is_ipv6 = match endpoint.addr {
            IpAddress::Ipv4(..) => false,
            IpAddress::Ipv6(..) => true,
            _ => unreachable!("Unknown address format"),
        };

        let family = if is_ipv6 { ffi::AF_INET6 } else { ffi::AF_INET } as _;

        ffi::sock_udp_ep_t {
            family,
            netif: ffi::SOCK_ADDR_ANY_NETIF as _,
            port: endpoint.port,
            addr: {
                if is_ipv6 {
                    let mut ipv6 = [0; 16];
                    ipv6.copy_from_slice(endpoint.addr.as_bytes());
                    ffi::_sock_tl_ep__bindgen_ty_1 { ipv6 }
                } else {
                    let mut ipv4 = [0; 4];
                    ipv4.copy_from_slice(endpoint.addr.as_bytes());
                    ffi::_sock_tl_ep__bindgen_ty_1 { ipv4 }
                }
            },
        }
    }
/// Nice little wrapper for creating udp endpoint for RIOT.
Nice little wrapper for creating udp endpoint for RIOT.
Nice little wrapper for creating udp endpoint for RIOT .
fn raw_endpoint(endpoint: &SocketAddr) -> ffi::sock_udp_ep_t {
        let is_ipv6 = match endpoint.addr {
            IpAddress::Ipv4(..) => false,
            IpAddress::Ipv6(..) => true,
            _ => unreachable!("Unknown address format"),
        };
        let family = if is_ipv6 { ffi::AF_INET6 } else { ffi::AF_INET } as _;
        ffi::sock_udp_ep_t {
            family,
            netif: ffi::SOCK_ADDR_ANY_NETIF as _,
            port: endpoint.port,
            addr: {
                if is_ipv6 {
                    let mut ipv6 = [0; 16];
                    ipv6.copy_from_slice(endpoint.addr.as_bytes());
                    ffi::_sock_tl_ep__bindgen_ty_1 { ipv6 }
                } else {
                    let mut ipv4 = [0; 4];
                    ipv4.copy_from_slice(endpoint.addr.as_bytes());
                    ffi::_sock_tl_ep__bindgen_ty_1 { ipv4 }
                }
            },
        }
    }
fn raw_endpoint ( endpoint : & SocketAddr ) -> ffi :: sock_udp_ep_t { let is_ipv6 = match endpoint . addr { IpAddress :: Ipv4 ( .. ) => false , IpAddress :: Ipv6 ( .. ) => true , _ => unreachable ! ( " " ) , } ; let family = if is_ipv6 { ffi :: AF_INET6 } else { ffi :: AF_INET } as _ ; ffi :: sock_udp_ep_t { family , netif : ffi :: SOCK_ADDR_ANY_NETIF as _ , port : endpoint . port , addr : { if is_ipv6 { let mut ipv6 = [ 0 ; 16 ] ; ipv6 . copy_from_slice ( endpoint . addr . as_bytes ( ) ) ; ffi :: _sock_tl_ep__bindgen_ty_1 { ipv6 } } else { let mut ipv4 = [ 0 ; 4 ] ; ipv4 . copy_from_slice ( endpoint . addr . as_bytes ( ) ) ; ffi :: _sock_tl_ep__bindgen_ty_1 { ipv4 } } } , } }
Nice little wrapper for creating udp endpoint for RIOT.
Nice little wrapper for creating udp endpoint for RIOT .
endpoint
&SocketAddr