add more gateway info to hostnameInfo (#3019)

This commit is contained in:
Aiden McClelland
2025-09-10 18:16:35 +00:00
committed by GitHub
parent c4419ed31f
commit 723dea100f
16 changed files with 87 additions and 60 deletions

View File

@@ -38,7 +38,7 @@
}, },
"../sdk/dist": { "../sdk/dist": {
"name": "@start9labs/start-sdk", "name": "@start9labs/start-sdk",
"version": "0.4.0-beta.37", "version": "0.4.0-beta.38",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@iarna/toml": "^3.0.0", "@iarna/toml": "^3.0.0",

View File

@@ -14,12 +14,14 @@ impl GatewayId {
&*self.0 &*self.0
} }
} }
impl<T> From<T> for GatewayId impl From<InternedString> for GatewayId {
where fn from(value: InternedString) -> Self {
T: Into<InternedString>, Self(value)
{ }
fn from(value: T) -> Self { }
Self(value.into()) impl From<GatewayId> for InternedString {
fn from(value: GatewayId) -> Self {
value.0
} }
} }
impl FromStr for GatewayId { impl FromStr for GatewayId {

View File

@@ -219,7 +219,7 @@ pub struct NetworkInterfaceInfo {
impl NetworkInterfaceInfo { impl NetworkInterfaceInfo {
pub fn loopback() -> (&'static GatewayId, &'static Self) { pub fn loopback() -> (&'static GatewayId, &'static Self) {
lazy_static! { lazy_static! {
static ref LO: GatewayId = GatewayId::from("lo"); static ref LO: GatewayId = GatewayId::from(InternedString::intern("lo"));
static ref LOOPBACK: NetworkInterfaceInfo = NetworkInterfaceInfo { static ref LOOPBACK: NetworkInterfaceInfo = NetworkInterfaceInfo {
name: Some(InternedString::from_static("Loopback")), name: Some(InternedString::from_static("Loopback")),
public: Some(false), public: Some(false),
@@ -250,7 +250,8 @@ impl NetworkInterfaceInfo {
} }
pub fn lxc_bridge() -> (&'static GatewayId, &'static Self) { pub fn lxc_bridge() -> (&'static GatewayId, &'static Self) {
lazy_static! { lazy_static! {
static ref LXCBR0: GatewayId = GatewayId::from(START9_BRIDGE_IFACE); static ref LXCBR0: GatewayId =
GatewayId::from(InternedString::intern(START9_BRIDGE_IFACE));
static ref LXC_BRIDGE: NetworkInterfaceInfo = NetworkInterfaceInfo { static ref LXC_BRIDGE: NetworkInterfaceInfo = NetworkInterfaceInfo {
name: Some(InternedString::from_static("LXC Bridge Interface")), name: Some(InternedString::from_static("LXC Bridge Interface")),
public: Some(false), public: Some(false),

View File

@@ -982,7 +982,7 @@ impl NetworkInterfaceController {
info info
} }
}, },
[START9_BRIDGE_IFACE.into()], [InternedString::from_static(START9_BRIDGE_IFACE).into()],
); );
let mut ip_info_watch = watcher.subscribe(); let mut ip_info_watch = watcher.subscribe();
ip_info_watch.mark_seen(); ip_info_watch.mark_seen();

View File

@@ -24,7 +24,7 @@ use crate::net::gateway::{
use crate::net::host::address::HostAddress; use crate::net::host::address::HostAddress;
use crate::net::host::binding::{AddSslOptions, BindId, BindOptions}; use crate::net::host::binding::{AddSslOptions, BindId, BindOptions};
use crate::net::host::{host_for, Host, Hosts}; use crate::net::host::{host_for, Host, Hosts};
use crate::net::service_interface::{HostnameInfo, IpHostname, OnionHostname}; use crate::net::service_interface::{GatewayInfo, HostnameInfo, IpHostname, OnionHostname};
use crate::net::socks::SocksController; use crate::net::socks::SocksController;
use crate::net::tor::{OnionAddress, TorController, TorSecretKey}; use crate::net::tor::{OnionAddress, TorController, TorSecretKey};
use crate::net::utils::ipv6_is_local; use crate::net::utils::ipv6_is_local;
@@ -427,10 +427,19 @@ impl NetServiceData {
} }
let mut bind_hostname_info: Vec<HostnameInfo> = let mut bind_hostname_info: Vec<HostnameInfo> =
hostname_info.remove(port).unwrap_or_default(); hostname_info.remove(port).unwrap_or_default();
for (interface, info) in net_ifaces for (gateway_id, info) in net_ifaces
.iter() .iter()
.filter(|(id, info)| bind.net.filter(id, info)) .filter(|(id, info)| bind.net.filter(id, info))
{ {
let gateway = GatewayInfo {
id: gateway_id.clone(),
name: info
.name
.clone()
.or_else(|| info.ip_info.as_ref().map(|i| i.name.clone()))
.unwrap_or_else(|| gateway_id.clone().into()),
public: info.public(),
};
let port = bind.net.assigned_port.filter(|_| { let port = bind.net.assigned_port.filter(|_| {
bind.options.secure.map_or(false, |s| { bind.options.secure.map_or(false, |s| {
!(s.ssl && bind.options.add_ssl.is_some()) || info.secure() !(s.ssl && bind.options.add_ssl.is_some()) || info.secure()
@@ -442,7 +451,7 @@ impl NetServiceData {
}) })
{ {
bind_hostname_info.push(HostnameInfo::Ip { bind_hostname_info.push(HostnameInfo::Ip {
gateway_id: interface.clone(), gateway: gateway.clone(),
public: false, public: false,
hostname: IpHostname::Local { hostname: IpHostname::Local {
value: InternedString::from_display(&{ value: InternedString::from_display(&{
@@ -462,7 +471,8 @@ impl NetServiceData {
} = address } = address
{ {
let private = private && !info.public(); let private = private && !info.public();
let public = public.as_ref().map_or(false, |p| &p.gateway == interface); let public =
public.as_ref().map_or(false, |p| &p.gateway == gateway_id);
if public || private { if public || private {
if bind if bind
.options .options
@@ -471,7 +481,7 @@ impl NetServiceData {
.map_or(false, |ssl| ssl.preferred_external_port == 443) .map_or(false, |ssl| ssl.preferred_external_port == 443)
{ {
bind_hostname_info.push(HostnameInfo::Ip { bind_hostname_info.push(HostnameInfo::Ip {
gateway_id: interface.clone(), gateway: gateway.clone(),
public, public,
hostname: IpHostname::Domain { hostname: IpHostname::Domain {
value: address.clone(), value: address.clone(),
@@ -481,7 +491,7 @@ impl NetServiceData {
}); });
} else { } else {
bind_hostname_info.push(HostnameInfo::Ip { bind_hostname_info.push(HostnameInfo::Ip {
gateway_id: interface.clone(), gateway: gateway.clone(),
public, public,
hostname: IpHostname::Domain { hostname: IpHostname::Domain {
value: address.clone(), value: address.clone(),
@@ -497,7 +507,7 @@ impl NetServiceData {
let public = info.public(); let public = info.public();
if let Some(wan_ip) = ip_info.wan_ip { if let Some(wan_ip) = ip_info.wan_ip {
bind_hostname_info.push(HostnameInfo::Ip { bind_hostname_info.push(HostnameInfo::Ip {
gateway_id: interface.clone(), gateway: gateway.clone(),
public: true, public: true,
hostname: IpHostname::Ipv4 { hostname: IpHostname::Ipv4 {
value: wan_ip, value: wan_ip,
@@ -511,7 +521,7 @@ impl NetServiceData {
IpNet::V4(net) => { IpNet::V4(net) => {
if !public { if !public {
bind_hostname_info.push(HostnameInfo::Ip { bind_hostname_info.push(HostnameInfo::Ip {
gateway_id: interface.clone(), gateway: gateway.clone(),
public, public,
hostname: IpHostname::Ipv4 { hostname: IpHostname::Ipv4 {
value: net.addr(), value: net.addr(),
@@ -523,7 +533,7 @@ impl NetServiceData {
} }
IpNet::V6(net) => { IpNet::V6(net) => {
bind_hostname_info.push(HostnameInfo::Ip { bind_hostname_info.push(HostnameInfo::Ip {
gateway_id: interface.clone(), gateway: gateway.clone(),
public: public && !ipv6_is_local(net.addr()), public: public && !ipv6_is_local(net.addr()),
hostname: IpHostname::Ipv6 { hostname: IpHostname::Ipv6 {
value: net.addr(), value: net.addr(),

View File

@@ -12,8 +12,7 @@ use ts_rs::TS;
#[serde(tag = "kind")] #[serde(tag = "kind")]
pub enum HostnameInfo { pub enum HostnameInfo {
Ip { Ip {
#[ts(type = "string")] gateway: GatewayInfo,
gateway_id: GatewayId,
public: bool, public: bool,
hostname: IpHostname, hostname: IpHostname,
}, },
@@ -30,6 +29,15 @@ impl HostnameInfo {
} }
} }
#[derive(Clone, Debug, Deserialize, Serialize, TS)]
#[ts(export)]
#[serde(rename_all = "camelCase")]
pub struct GatewayInfo {
pub id: GatewayId,
pub name: InternedString,
pub public: bool,
}
#[derive(Clone, Debug, Deserialize, Serialize, TS)] #[derive(Clone, Debug, Deserialize, Serialize, TS)]
#[ts(export)] #[ts(export)]
#[serde(rename_all = "camelCase")] #[serde(rename_all = "camelCase")]

View File

@@ -47,7 +47,7 @@ pub async fn add_tunnel(
}: AddTunnelParams, }: AddTunnelParams,
) -> Result<GatewayId, Error> { ) -> Result<GatewayId, Error> {
let ifaces = ctx.net_controller.net_iface.watcher.subscribe(); let ifaces = ctx.net_controller.net_iface.watcher.subscribe();
let mut iface = GatewayId::from("wg0"); let mut iface = GatewayId::from(InternedString::intern("wg0"));
if !ifaces.send_if_modified(|i| { if !ifaces.send_if_modified(|i| {
for id in 1..256 { for id in 1..256 {
if !i.contains_key(&iface) { if !i.contains_key(&iface) {

View File

@@ -6,7 +6,7 @@ use models::GatewayId;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use super::v0_3_5::V0_3_0_COMPAT; use super::v0_3_5::V0_3_0_COMPAT;
use super::{VersionT, v0_3_6_alpha_9}; use super::{v0_3_6_alpha_9, VersionT};
use crate::net::host::address::PublicDomainConfig; use crate::net::host::address::PublicDomainConfig;
use crate::net::tor::OnionAddress; use crate::net::tor::OnionAddress;
use crate::prelude::*; use crate::prelude::*;
@@ -75,7 +75,7 @@ impl VersionT for Version {
domains.insert( domains.insert(
address.clone(), address.clone(),
PublicDomainConfig { PublicDomainConfig {
gateway: GatewayId::from("lo"), gateway: GatewayId::from(InternedString::intern("lo")),
acme: None, acme: None,
}, },
); );

View File

@@ -0,0 +1,4 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { GatewayId } from "./GatewayId"
export type GatewayInfo = { id: GatewayId; name: string; public: boolean }

View File

@@ -1,7 +1,8 @@
// This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually. // This file was generated by [ts-rs](https://github.com/Aleph-Alpha/ts-rs). Do not edit this file manually.
import type { GatewayInfo } from "./GatewayInfo"
import type { IpHostname } from "./IpHostname" import type { IpHostname } from "./IpHostname"
import type { OnionHostname } from "./OnionHostname" import type { OnionHostname } from "./OnionHostname"
export type HostnameInfo = export type HostnameInfo =
| { kind: "ip"; gatewayId: string; public: boolean; hostname: IpHostname } | { kind: "ip"; gateway: GatewayInfo; public: boolean; hostname: IpHostname }
| { kind: "onion"; hostname: OnionHostname } | { kind: "onion"; hostname: OnionHostname }

View File

@@ -80,6 +80,7 @@ export { ForgetGatewayParams } from "./ForgetGatewayParams"
export { FullIndex } from "./FullIndex" export { FullIndex } from "./FullIndex"
export { FullProgress } from "./FullProgress" export { FullProgress } from "./FullProgress"
export { GatewayId } from "./GatewayId" export { GatewayId } from "./GatewayId"
export { GatewayInfo } from "./GatewayInfo"
export { GetActionInputParams } from "./GetActionInputParams" export { GetActionInputParams } from "./GetActionInputParams"
export { GetContainerIpParams } from "./GetContainerIpParams" export { GetContainerIpParams } from "./GetContainerIpParams"
export { GetHostInfoParams } from "./GetHostInfoParams" export { GetHostInfoParams } from "./GetHostInfoParams"

View File

@@ -1,12 +1,12 @@
{ {
"name": "@start9labs/start-sdk", "name": "@start9labs/start-sdk",
"version": "0.4.0-beta.37", "version": "0.4.0-beta.38",
"lockfileVersion": 3, "lockfileVersion": 3,
"requires": true, "requires": true,
"packages": { "packages": {
"": { "": {
"name": "@start9labs/start-sdk", "name": "@start9labs/start-sdk",
"version": "0.4.0-beta.37", "version": "0.4.0-beta.38",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@iarna/toml": "^3.0.0", "@iarna/toml": "^3.0.0",

View File

@@ -1,6 +1,6 @@
{ {
"name": "@start9labs/start-sdk", "name": "@start9labs/start-sdk",
"version": "0.4.0-beta.37", "version": "0.4.0-beta.38",
"description": "Software development kit to facilitate packaging services for StartOS", "description": "Software development kit to facilitate packaging services for StartOS",
"main": "./package/lib/index.js", "main": "./package/lib/index.js",
"types": "./package/lib/index.d.ts", "types": "./package/lib/index.d.ts",

View File

@@ -92,7 +92,7 @@ function cmpClearnet(
return cmpWithRankedPredicates(a, b, [ return cmpWithRankedPredicates(a, b, [
x => x =>
x.info.hostname.kind === 'domain' && x.info.hostname.kind === 'domain' &&
x.info.gatewayId === host.publicDomains[x.info.hostname.value]?.gateway, // public domain for this gateway x.info.gateway.id === host.publicDomains[x.info.hostname.value]?.gateway, // public domain for this gateway
x => x.gateway?.public ?? false, // public gateway x => x.gateway?.public ?? false, // public gateway
x => x.info.hostname.kind === 'ipv4', // ipv4 x => x.info.hostname.kind === 'ipv4', // ipv4
x => x.info.hostname.kind === 'ipv6', // ipv6 x => x.info.hostname.kind === 'ipv6', // ipv6
@@ -136,7 +136,7 @@ export class InterfaceService {
utils.addressHostToUrl(serviceInterface.addressInfo, h).map(url => ({ utils.addressHostToUrl(serviceInterface.addressInfo, h).map(url => ({
url, url,
info: h, info: h,
gateway: gateways.find(g => h.kind === 'ip' && h.gatewayId === g.id), gateway: gateways.find(g => h.kind === 'ip' && h.gateway.id === g.id),
})), })),
) )
@@ -306,7 +306,7 @@ export class InterfaceService {
h.kind === 'ip' && h.kind === 'ip' &&
((h.hostname.kind === 'ipv6' && ((h.hostname.kind === 'ipv6' &&
utils.IPV6_LINK_LOCAL.contains(h.hostname.value)) || utils.IPV6_LINK_LOCAL.contains(h.hostname.value)) ||
h.gatewayId === 'lo') h.gateway.id === 'lo')
), ),
) || [] ) || []
) )
@@ -360,7 +360,7 @@ export class InterfaceService {
// ** Not Tor ** // ** Not Tor **
} else { } else {
const port = info.hostname.sslPort || info.hostname.port const port = info.hostname.sslPort || info.hostname.port
const gateway = gateways.find(g => g.id === info.gatewayId)! const gateway = gateways.find(g => g.id === info.gateway.id)!
gatewayName = gateway.name gatewayName = gateway.name
const gatewayLanIpv4 = gateway.lanIpv4[0] const gatewayLanIpv4 = gateway.lanIpv4[0]

View File

@@ -385,7 +385,7 @@ export namespace Mock {
docsUrl: 'https://bitcoin.org', docsUrl: 'https://bitcoin.org',
releaseNotes: 'Even better support for Bitcoin and wallets!', releaseNotes: 'Even better support for Bitcoin and wallets!',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: BTC_ICON, icon: BTC_ICON,
sourceVersion: null, sourceVersion: null,
@@ -420,7 +420,7 @@ export namespace Mock {
docsUrl: 'https://bitcoinknots.org', docsUrl: 'https://bitcoinknots.org',
releaseNotes: 'Even better support for Bitcoin and wallets!', releaseNotes: 'Even better support for Bitcoin and wallets!',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: BTC_ICON, icon: BTC_ICON,
sourceVersion: null, sourceVersion: null,
@@ -465,7 +465,7 @@ export namespace Mock {
docsUrl: 'https://bitcoin.org', docsUrl: 'https://bitcoin.org',
releaseNotes: 'Even better support for Bitcoin and wallets!', releaseNotes: 'Even better support for Bitcoin and wallets!',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: BTC_ICON, icon: BTC_ICON,
sourceVersion: null, sourceVersion: null,
@@ -500,7 +500,7 @@ export namespace Mock {
docsUrl: 'https://bitcoinknots.org', docsUrl: 'https://bitcoinknots.org',
releaseNotes: 'Even better support for Bitcoin and wallets!', releaseNotes: 'Even better support for Bitcoin and wallets!',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: BTC_ICON, icon: BTC_ICON,
sourceVersion: null, sourceVersion: null,
@@ -547,7 +547,7 @@ export namespace Mock {
docsUrl: 'https://lightning.engineering/', docsUrl: 'https://lightning.engineering/',
releaseNotes: 'Upstream release to 0.17.5', releaseNotes: 'Upstream release to 0.17.5',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: LND_ICON, icon: LND_ICON,
sourceVersion: null, sourceVersion: null,
@@ -595,7 +595,7 @@ export namespace Mock {
docsUrl: 'https://lightning.engineering/', docsUrl: 'https://lightning.engineering/',
releaseNotes: 'Upstream release to 0.17.4', releaseNotes: 'Upstream release to 0.17.4',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: LND_ICON, icon: LND_ICON,
sourceVersion: null, sourceVersion: null,
@@ -647,7 +647,7 @@ export namespace Mock {
docsUrl: 'https://bitcoin.org', docsUrl: 'https://bitcoin.org',
releaseNotes: 'Even better support for Bitcoin and wallets!', releaseNotes: 'Even better support for Bitcoin and wallets!',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: BTC_ICON, icon: BTC_ICON,
sourceVersion: null, sourceVersion: null,
@@ -682,7 +682,7 @@ export namespace Mock {
docsUrl: 'https://bitcoinknots.org', docsUrl: 'https://bitcoinknots.org',
releaseNotes: 'Even better support for Bitcoin and wallets!', releaseNotes: 'Even better support for Bitcoin and wallets!',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: BTC_ICON, icon: BTC_ICON,
sourceVersion: null, sourceVersion: null,
@@ -727,7 +727,7 @@ export namespace Mock {
docsUrl: 'https://lightning.engineering/', docsUrl: 'https://lightning.engineering/',
releaseNotes: 'Upstream release and minor fixes.', releaseNotes: 'Upstream release and minor fixes.',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: LND_ICON, icon: LND_ICON,
sourceVersion: null, sourceVersion: null,
@@ -775,7 +775,7 @@ export namespace Mock {
marketingSite: '', marketingSite: '',
releaseNotes: 'Upstream release and minor fixes.', releaseNotes: 'Upstream release and minor fixes.',
osVersion: '0.3.6', osVersion: '0.3.6',
sdkVersion: '0.4.0-beta.37', sdkVersion: '0.4.0-beta.38',
gitHash: 'fakehash', gitHash: 'fakehash',
icon: PROXY_ICON, icon: PROXY_ICON,
sourceVersion: null, sourceVersion: null,
@@ -2041,7 +2041,7 @@ export namespace Mock {
80: [ 80: [
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'local', kind: 'local',
@@ -2052,7 +2052,7 @@ export namespace Mock {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'local', kind: 'local',
@@ -2063,7 +2063,7 @@ export namespace Mock {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv4', kind: 'ipv4',
@@ -2074,7 +2074,7 @@ export namespace Mock {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv4', kind: 'ipv4',
@@ -2085,7 +2085,7 @@ export namespace Mock {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv6', kind: 'ipv6',
@@ -2097,7 +2097,7 @@ export namespace Mock {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv6', kind: 'ipv6',

View File

@@ -59,7 +59,7 @@ export const mockPatchData: DataModel = {
80: [ 80: [
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'local', kind: 'local',
@@ -70,7 +70,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'local', kind: 'local',
@@ -81,7 +81,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv4', kind: 'ipv4',
@@ -92,7 +92,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv4', kind: 'ipv4',
@@ -103,7 +103,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv6', kind: 'ipv6',
@@ -115,7 +115,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv6', kind: 'ipv6',
@@ -356,7 +356,7 @@ export const mockPatchData: DataModel = {
80: [ 80: [
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'local', kind: 'local',
@@ -367,7 +367,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'local', kind: 'local',
@@ -378,7 +378,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv4', kind: 'ipv4',
@@ -389,7 +389,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv4', kind: 'ipv4',
@@ -400,7 +400,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'eth0', gateway: { id: 'eth0', name: 'Ethernet', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv6', kind: 'ipv6',
@@ -412,7 +412,7 @@ export const mockPatchData: DataModel = {
}, },
{ {
kind: 'ip', kind: 'ip',
gatewayId: 'wlan0', gateway: { id: 'wlan0', name: 'Wireless', public: false },
public: false, public: false,
hostname: { hostname: {
kind: 'ipv6', kind: 'ipv6',