From 38ac4db03560200df2517ed7e06e555828ce0a15 Mon Sep 17 00:00:00 2001 From: Petri Hienonen Date: Sun, 28 Sep 2025 16:25:48 +0300 Subject: Update --- static/network-types.js | 180 ++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 180 insertions(+) create mode 100644 static/network-types.js (limited to 'static/network-types.js') diff --git a/static/network-types.js b/static/network-types.js new file mode 100644 index 0000000..a37e7a6 --- /dev/null +++ b/static/network-types.js @@ -0,0 +1,180 @@ +/* jshint esversion: 2024, module: true */ + +/** + * Network configuration types and enumerations + * @module NetworkTypes + */ + +// Field types +const FieldType = { + STRING: Symbol("string"), + MAC_ADDRESS: Symbol("mac-address"), + IPV4_ADDRESS: Symbol("ipv4-address"), + IPV6_ADDRESS: Symbol("ipv6-address"), + IP_PREFIX: Symbol("ip-prefix"), + BOOLEAN: Symbol("boolean"), + NUMBER: Symbol("number"), + PORT: Symbol("port"), + MTU: Symbol("mtu"), + STRINGS: Symbol("strings"), + IP_ADDRESSES: Symbol("ip-addresses"), + DHCP_MODE: Symbol("dhcp-mode"), + IP_FORWARD: Symbol("ip-forward"), + PRIVACY_EXTENSIONS: Symbol("privacy-extensions"), + LLMNR: Symbol("llmnr"), + MDNS: Symbol("mdns"), + DNSSEC: Symbol("dnssec"), + USE_DOMAINS: Symbol("use-domains"), + CLIENT_IDENTIFIER: Symbol("client-identifier"), + ROUTE_SCOPE: Symbol("route-scope"), + ROUTE_TYPE: Symbol("route-type"), + SLAAC: Symbol("slaac"), +}; +Object.freeze(FieldType); + +// DHCP modes +const DHCPMode = { + YES: "yes", + NO: "no", + IPV4: "ipv4", + IPV6: "ipv6", +}; +Object.freeze(DHCPMode); + +// Boolean values +const BooleanYesNo = { + YES: "yes", + NO: "no", +}; +Object.freeze(BooleanYesNo); + +// IP forwarding options +const IPForward = { + YES: "yes", + NO: "no", + IPV4: "ipv4", + IPV6: "ipv6", +}; +Object.freeze(IPForward); + +// IPv6 privacy extensions +const IPv6PrivacyExtensions = { + YES: "yes", + NO: "no", + PREFER_PUBLIC: "prefer-public", +}; +Object.freeze(IPv6PrivacyExtensions); + +// LLMNR options +const LLMNROptions = { + YES: "yes", + NO: "no", + RESOLVE: "resolve", +}; +Object.freeze(LLMNROptions); + +// Multicast DNS options +const MulticastDNS = { + YES: "yes", + NO: "no", + RESOLVE: "resolve", +}; +Object.freeze(MulticastDNS); + +// DNSSEC options +const DNSSECOptions = { + YES: "yes", + NO: "no", + ALLOW_DOWNGRADE: "allow-downgrade", +}; +Object.freeze(DNSSECOptions); + +// Use domains options +const UseDomains = { + YES: "yes", + NO: "no", + ROUTE: "route", +}; +Object.freeze(UseDomains); + +// Client identifier options +const ClientIdentifier = { + MAC: "mac", + DUID: "duid", +}; +Object.freeze(ClientIdentifier); + +// Route scope options +const RouteScope = { + GLOBAL: "global", + LINK: "link", + HOST: "host", +}; +Object.freeze(RouteScope); + +// Route type options +const RouteType = { + UNICAST: "unicast", + LOCAL: "local", + BROADCAST: "broadcast", + ANYCAST: "anycast", + MULTICAST: "multicast", + BLACKHOLE: "blackhole", + UNREACHABLE: "unreachable", + PROHIBIT: "prohibit", +}; +Object.freeze(RouteType); + +// Wake-on-LAN options +const WakeOnLAN = { + PHY: "phy", + UNICAST: "unicast", + BROADCAST: "broadcast", + ARP: "arp", + MAGIC: "magic", +}; +Object.freeze(WakeOnLAN); + +// Port types +const PortType = { + TP: "tp", + AUI: "aui", + BNC: "bnc", + MII: "mii", + FIBRE: "fibre", +}; +Object.freeze(PortType); + +// Duplex modes +const DuplexMode = { + HALF: "half", + FULL: "full", +}; +Object.freeze(DuplexMode); + +// SLAAC options +const SLAACOptions = { + YES: "yes", + NO: "no", + PREFER_TEMPORARY: "prefer-temporary", +}; +Object.freeze(SLAACOptions); + +export { + FieldType, + DHCPMode, + BooleanYesNo, + IPForward, + IPv6PrivacyExtensions, + LLMNROptions, + MulticastDNS, + DNSSECOptions, + UseDomains, + ClientIdentifier, + RouteScope, + RouteType, + WakeOnLAN, + PortType, + DuplexMode, + SLAACOptions, +}; -- cgit v1.2.3-70-g09d2