async fn check_new_client(
        server: &mut fnet_dhcpv6::ClientProviderRequestStream,
        sockaddr: fnet::Ipv6SocketAddress,
        dns_watchers: &mut DnsServerWatchers<'_>,
    ) -> Result<fnet_dhcpv6::ClientRequestStream, anyhow::Error> {
        let evt =
            server.try_next().await.context("error getting next dhcpv6 client provider event")?;
        let client_server =
            match evt.ok_or(anyhow::anyhow!("expected dhcpv6 client provider request"))? {
                fnet_dhcpv6::ClientProviderRequest::NewClient {
                    params,
                    request,
                    control_handle: _,
                } => {
                    assert_eq!(
                        params,
                        fnet_dhcpv6::NewClientParams {
                            interface_id: Some(INTERFACE_ID),
                            address: Some(sockaddr),
                            config: Some(fnet_dhcpv6::ClientConfig {
                                information_config: Some(fnet_dhcpv6::InformationConfig {
                                    dns_servers: Some(true),
                                    ..fnet_dhcpv6::InformationConfig::EMPTY
                                }),
                                ..fnet_dhcpv6::ClientConfig::EMPTY
                            }),
                            ..fnet_dhcpv6::NewClientParams::EMPTY
                        }
                    );

                    request.into_stream().context("error converting client server end to stream")?
                }
            };
        assert!(dns_watchers.contains_key(&DHCPV6_DNS_SOURCE), "should have a watcher");
        Ok(client_server)
    }
/// Make sure that a new DHCPv6 client was requested, and verify its parameters.
Make sure that a new DHCPv6 client was requested, and verify its parameters.
Make sure that a new DHCPv6 client was requested and verify its parameters .
async fn check_new_client(
        server: &mut fnet_dhcpv6::ClientProviderRequestStream,
        sockaddr: fnet::Ipv6SocketAddress,
        dns_watchers: &mut DnsServerWatchers<'_>,
    ) -> Result<fnet_dhcpv6::ClientRequestStream, anyhow::Error> {
        let evt =
            server.try_next().await.context("error getting next dhcpv6 client provider event")?;
        let client_server =
            match evt.ok_or(anyhow::anyhow!("expected dhcpv6 client provider request"))? {
                fnet_dhcpv6::ClientProviderRequest::NewClient {
                    params,
                    request,
                    control_handle: _,
                } => {
                    assert_eq!(
                        params,
                        fnet_dhcpv6::NewClientParams {
                            interface_id: Some(INTERFACE_ID),
                            address: Some(sockaddr),
                            config: Some(fnet_dhcpv6::ClientConfig {
                                information_config: Some(fnet_dhcpv6::InformationConfig {
                                    dns_servers: Some(true),
                                    ..fnet_dhcpv6::InformationConfig::EMPTY
                                }),
                                ..fnet_dhcpv6::ClientConfig::EMPTY
                            }),
                            ..fnet_dhcpv6::NewClientParams::EMPTY
                        }
                    );
                    request.into_stream().context("error converting client server end to stream")?
                }
            };
        assert!(dns_watchers.contains_key(&DHCPV6_DNS_SOURCE), "should have a watcher");
        Ok(client_server)
    }
async fn check_new_client ( server : & mut fnet_dhcpv6 :: ClientProviderRequestStream , sockaddr : fnet :: Ipv6SocketAddress , dns_watchers : & mut DnsServerWatchers < ' _ > , ) -> Result < fnet_dhcpv6 :: ClientRequestStream , anyhow :: Error > { let evt = server . try_next ( ) . await . context ( " " ) ? ; let client_server = match evt . ok_or ( anyhow :: anyhow ! ( " " ) ) ? { fnet_dhcpv6 :: ClientProviderRequest :: NewClient { params , request , control_handle : _ , } => { assert_eq ! ( params fnet_dhcpv6 NewClientParams { interface_id Some ( INTERFACE_ID ) address Some ( sockaddr ) config Some ( fnet_dhcpv6 ClientConfig { information_config Some ( fnet_dhcpv6 InformationConfig { dns_servers Some ( true ) fnet_dhcpv6 InformationConfig EMPTY } ) fnet_dhcpv6 ClientConfig EMPTY } ) fnet_dhcpv6 NewClientParams EMPTY } ) ; request . into_stream ( ) . context ( " " ) ? } } ; assert ! ( dns_watchers contains_key ( DHCPV6_DNS_SOURCE ) " " ) ; Ok ( client_server ) }
Make sure that a new DHCPv6 client was requested, and verify its parameters.
Make sure that a new DHCPv6 client was requested and verify its parameters .
server
&mut fnet_dhcpv6::ClientProviderRequestStream
sockaddr
fnet::Ipv6SocketAddress
dns_watchers
&mut DnsServerWatchers<'_>
server
&mut fnet_dhcpv6::ClientProviderRequestStream
sockaddr
fnet::Ipv6SocketAddress
dns_watchers
&mut DnsServerWatchers<'_>