1// Copyright 2019 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.
45//! Useful constants for tests.
67/// IPv4 constants.
8pub mod ipv4 {
9/// A default IPv4 time-to-live value.
10pub const DEFAULT_TTL: u8 = 64;
11}
1213/// IPv6 constants.
14pub mod ipv6 {
15use net_declare::{net_ip_v6, net_subnet_v6};
16use net_types::ip as net_types_ip;
1718/// A default IPv6 hop limit value.
19pub const DEFAULT_HOP_LIMIT: u8 = 64;
2021/// A globally-routable IPv6 prefix.
22pub const GLOBAL_PREFIX: net_types_ip::Subnet<net_types_ip::Ipv6Addr> =
23net_subnet_v6!("2001:f1f0:4060:1::/64");
2425/// An IPv6 address in `GLOBAL_PREFIX`.
26pub const GLOBAL_ADDR: net_types_ip::Ipv6Addr = net_ip_v6!("2001:f1f0:4060:1::1");
2728/// A link-local IPv6 address.
29 ///
30 /// fe80::1
31pub const LINK_LOCAL_ADDR: net_types_ip::Ipv6Addr = net_ip_v6!("fe80::1");
3233/// The prefix length for the link-local subnet.
34pub const LINK_LOCAL_SUBNET_PREFIX: u8 = 64;
35}
3637/// Ethernet constants.
38pub mod eth {
39use net_declare::net_mac;
40use net_types::ethernet::Mac;
4142/// A MAC address.
43 ///
44 /// 02:00:00:00:00:01
45pub const MAC_ADDR: Mac = net_mac!("02:00:00:00:00:01");
4647/// Another MAC address.
48pub const MAC_ADDR2: Mac = net_mac!("02:FF:FF:FF:FF:FF");
49}