dns/
test_util.rs

1// Copyright 2020 The Fuchsia Authors. All rights reserved.
2// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
5use fidl_fuchsia_net as net;
6
7use crate::DEFAULT_PORT;
8
9pub const STATIC_SERVER: net::SocketAddress = net::SocketAddress::Ipv4(net::Ipv4SocketAddress {
10    address: net::Ipv4Address { addr: [8, 8, 8, 8] },
11    port: DEFAULT_PORT,
12});
13
14pub const DHCP_SERVER: net::SocketAddress = net::SocketAddress::Ipv4(net::Ipv4SocketAddress {
15    address: net::Ipv4Address { addr: [8, 8, 4, 4] },
16    port: DEFAULT_PORT,
17});
18
19pub const NDP_SERVER: net::SocketAddress = net::SocketAddress::Ipv6(net::Ipv6SocketAddress {
20    address: net::Ipv6Address {
21        addr: [
22            0x20, 0x01, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
23            0x44, 0x44,
24        ],
25    },
26    port: DEFAULT_PORT,
27    zone_index: 2,
28});
29
30pub const DHCPV6_SERVER: net::SocketAddress = net::SocketAddress::Ipv6(net::Ipv6SocketAddress {
31    address: net::Ipv6Address {
32        addr: [
33            0x20, 0x02, 0x48, 0x60, 0x48, 0x60, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
34            0x44, 0x44,
35        ],
36    },
37    port: DEFAULT_PORT,
38    zone_index: 3,
39});