summaryrefslogtreecommitdiffstats
path: root/static/network-types.js
diff options
context:
space:
mode:
authorPetri Hienonen <petri.hienonen@gmail.com>2025-09-28 16:25:48 +0300
committerPetri Hienonen <petri.hienonen@gmail.com>2025-09-28 16:25:48 +0300
commit38ac4db03560200df2517ed7e06e555828ce0a15 (patch)
tree7bd8cc7d08d352bea05490e81b230a9d418a8553 /static/network-types.js
parent8489f1f83da5dcc5818401393b1f6a430eea677c (diff)
downloadnetwork-38ac4db03560200df2517ed7e06e555828ce0a15.tar.zst
Update
Diffstat (limited to 'static/network-types.js')
-rw-r--r--static/network-types.js180
1 files changed, 180 insertions, 0 deletions
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,
+};