From e9431c889e3af6df8a5c54aab8f1a5f26bcf19b0 Mon Sep 17 00:00:00 2001 From: John Crispin Date: Thu, 15 Apr 2021 16:57:47 +0200 Subject: [PATCH] ucentral-schema: add initial version of the reworked data model Signed-off-by: John Crispin --- .gitignore | 5 + new/config-raw.yml | 6 ++ new/definitions.yml | 11 +++ new/generate.sh | 5 + new/globals.yml | 17 ++++ new/interfaces.bridge.yml | 23 +++++ new/interfaces.ethernet.yml | 49 ++++++++++ new/interfaces.ipv4.yml | 41 ++++++++ new/interfaces.ssids.captive.yml | 39 ++++++++ new/interfaces.ssids.encryption.yml | 37 +++++++ new/interfaces.ssids.pass-point.yml | 60 ++++++++++++ new/interfaces.ssids.radius.local-users.yml | 24 +++++ new/interfaces.ssids.radius.server.yml | 34 +++++++ new/interfaces.ssids.radius.yml | 19 ++++ new/interfaces.ssids.rates.yml | 14 +++ new/interfaces.ssids.roaming.yml | 24 +++++ new/interfaces.ssids.rrm.yml | 24 +++++ new/interfaces.ssids.yml | 98 +++++++++++++++++++ new/interfaces.vlan.yml | 18 ++++ new/interfaces.yml | 56 +++++++++++ new/merge-schema.py | 40 ++++++++ new/metrics.yml | 36 +++++++ new/radios.he.yml | 16 +++ new/radios.yml | 102 ++++++++++++++++++++ new/services.lldp.yml | 10 ++ new/services.log.yml | 28 ++++++ new/services.mdns.yml | 9 ++ new/services.ntp.yml | 11 +++ new/services.rtty.yml | 21 ++++ new/services.ssh.yml | 26 +++++ new/services.wifi-steering.yml | 8 ++ new/services.yml | 19 ++++ new/ucentral.yml | 21 ++++ new/unit.yml | 19 ++++ 34 files changed, 970 insertions(+) create mode 100644 new/config-raw.yml create mode 100644 new/definitions.yml create mode 100755 new/generate.sh create mode 100644 new/globals.yml create mode 100644 new/interfaces.bridge.yml create mode 100644 new/interfaces.ethernet.yml create mode 100644 new/interfaces.ipv4.yml create mode 100644 new/interfaces.ssids.captive.yml create mode 100644 new/interfaces.ssids.encryption.yml create mode 100644 new/interfaces.ssids.pass-point.yml create mode 100644 new/interfaces.ssids.radius.local-users.yml create mode 100644 new/interfaces.ssids.radius.server.yml create mode 100644 new/interfaces.ssids.radius.yml create mode 100644 new/interfaces.ssids.rates.yml create mode 100644 new/interfaces.ssids.roaming.yml create mode 100644 new/interfaces.ssids.rrm.yml create mode 100644 new/interfaces.ssids.yml create mode 100644 new/interfaces.vlan.yml create mode 100644 new/interfaces.yml create mode 100755 new/merge-schema.py create mode 100644 new/metrics.yml create mode 100644 new/radios.he.yml create mode 100644 new/radios.yml create mode 100644 new/services.lldp.yml create mode 100644 new/services.log.yml create mode 100644 new/services.mdns.yml create mode 100644 new/services.ntp.yml create mode 100644 new/services.rtty.yml create mode 100644 new/services.ssh.yml create mode 100644 new/services.wifi-steering.yml create mode 100644 new/services.yml create mode 100644 new/ucentral.yml create mode 100644 new/unit.yml diff --git a/.gitignore b/.gitignore index 26198ef..76e2215 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ *.schema docs/ +new/ucentral.schema.json +new/ucentral.schema.pretty.json +new/docs/ +new/central.schema.json +new/ucentral.schema.pretty.json diff --git a/new/config-raw.yml b/new/config-raw.yml new file mode 100644 index 0000000..38472b6 --- /dev/null +++ b/new/config-raw.yml @@ -0,0 +1,6 @@ +description: + This object allows passing raw uci commands, that get applied after all the + other configuration was ben generated. +type: array +items: + type: string diff --git a/new/definitions.yml b/new/definitions.yml new file mode 100644 index 0000000..6271415 --- /dev/null +++ b/new/definitions.yml @@ -0,0 +1,11 @@ +description: + This section is used to define templates that can be reference by a + configuration. This avoids duplication of data. A RADIUS server can be + defined here for example and then referenced by several SSIDs. +type: object +properties: + wireless-encryption: + description: + A wireless encryption template. + type: object + $ref: "#/interfaces/ssids/encryption" diff --git a/new/generate.sh b/new/generate.sh new file mode 100755 index 0000000..8467110 --- /dev/null +++ b/new/generate.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +./merge-schema.py +mkdir -p docs +generate-schema-doc --config expand_buttons=true ucentral.schema.pretty.json docs/ucentral-schema.html diff --git a/new/globals.yml b/new/globals.yml new file mode 100644 index 0000000..f779381 --- /dev/null +++ b/new/globals.yml @@ -0,0 +1,17 @@ +description: + A device has certain global properties that are used to derive parts of + the final configuration that gets applied. +type: object +properties: + ipv4-network: + description: + Define the IPv4 range that is delegatable to the downstream interfaces + This is described as a CIDR block. (192.168.0.0/16, 172.16.128/17) + type: string + uc-example: 192.168.0.0/16 + ipv6-network: + description: + Define the IPv6 range that is delegatable to the downstream interfaces + This is described as a CIDR block. (fdca:1234:4567::/48) + type: string + uc-example: fdca:1234:4567::/48 diff --git a/new/interfaces.bridge.yml b/new/interfaces.bridge.yml new file mode 100644 index 0000000..c0b816f --- /dev/null +++ b/new/interfaces.bridge.yml @@ -0,0 +1,23 @@ +description: + This section describes the bridge behaviour of a logical network interface. +type: object +properties: + mtu: + description: + The MTU that shall be used by the network interface. + type: number + maximum: 65535 + minimum: 256 + uc-example: 1500 + tx-queue-len: + description: + The Transmit Queue Length is a TCP/IP stack network interface value that + sets the number of packets allowed per kernel transmit queue of a network + interface device. + type: number + uc-example: 5000 + isolate-ports: + description: + Isolates the bridge ports from each other. + type: boolean + default: false diff --git a/new/interfaces.ethernet.yml b/new/interfaces.ethernet.yml new file mode 100644 index 0000000..dd68a2c --- /dev/null +++ b/new/interfaces.ethernet.yml @@ -0,0 +1,49 @@ +description: + This section defines the physical copper/fiber ports that are members of the + interface. Network devices are referenced by their logical names. +type: array +items: + type: object + properties: + select-ports: + description: + The list of physical network devices that shall be added to the interface. + The names are logical ones and wildcardable. "WAN" will use whatever the + hardwares default upstream facing port is. "LANx" will use the "x'th" + downstream facing ethernet port. LAN* will use all downstream ports. + type: array + items: + type: string + uc-example: + - LAN1 + - LAN2* + multicast: + description: + Enable multicast support. + type: boolean + default: true + learning: + description: + Controls whether a given port will learn MAC addresses from received + traffic or not. If learning if off, the bridge will end up flooding + any traffic for which it has no FDB entry. By default this flag is on. + type: boolean + default: true + isolate: + description: + Only allow communication with non-isolated bridge ports when enabled. + type: boolean + default: false + macaddr: + description: + Enforce a specific MAC to these ports. + type: string + maxLength: 17 + minLength: 17 + uc-example: true + reverse-path-filter: + description: + Reverse Path filtering is a method used by the Linux Kernel to help + prevent attacks used by Spoofing IP Addresses. + type: boolean + default: false diff --git a/new/interfaces.ipv4.yml b/new/interfaces.ipv4.yml new file mode 100644 index 0000000..a0920ae --- /dev/null +++ b/new/interfaces.ipv4.yml @@ -0,0 +1,41 @@ +description: + This section describes the IPv4 properties of a logical interface. +type: object +properties: + addressing: + description: + This option defines the method by which the IPv4 address of the interface + is chosen. + type: string + enum: + - dynamic + - static + uc-example: static + subnet: + description: + This option defines the static IPv4 of the logical interface in CIDR notation. + auto/24 can be used, causing the configuration layer to automatically use + and address range from globals.ipv4-network. + type: string + uc-example: auto/24 + gateway: + description: + This option defines the static IPv4 gateway of the logical interface. + type: string + uc-example: 192.168.1.1 + send-hostname: + description: + include the devices hostname inside DHCP requests + type: boolean + default: true + uc-example: true + use-dns: + description: + Define which DNS servers shall be used. This can either be a list of + static IPv4 addresse or dhcp (use the server provided by the DHCP lease) + type: array + items: + type: string + uc-example: + - 8.8.8.8 + - 4.4.4.4 diff --git a/new/interfaces.ssids.captive.yml b/new/interfaces.ssids.captive.yml new file mode 100644 index 0000000..9f9ea9c --- /dev/null +++ b/new/interfaces.ssids.captive.yml @@ -0,0 +1,39 @@ +description: + This section can be used to setup a captive portal on the AP. +type: object +properties: + gateway-name: + description: + This name will be presented to connecting users in on the splash page. + type: string + default: uCentral - Captive Portal + gateway-fqdn: + description: + The fqdn used for the captive portal IP. + type: string + default: ucentral.splash + maxclients: + description: + The maximum number of clients that shall be accept. + type: number + uc-example: 32 + upload-rate: + description: + The maximum upload rate for a specific client. + type: number + uc-example: 10000 + download-rate: + description: + The maximum download rate for a specific client. + type: number + uc-example: 10000 + upload-quota: + description: + The maximum upload quota for a specific client. + type: number + uc-example: 10000 + download-quota: + description: + The maximum download quota for a specific client. + type: number + uc-example: 10000 diff --git a/new/interfaces.ssids.encryption.yml b/new/interfaces.ssids.encryption.yml new file mode 100644 index 0000000..6435b9d --- /dev/null +++ b/new/interfaces.ssids.encryption.yml @@ -0,0 +1,37 @@ +description: + A device has certain properties that describe its identity and location. + These properties are described inside this object. +type: object +properties: + proto: + description: + The wireless encryption protocol that shall be used for this BSS + type: string + enum: + - none + - psk + - psk2 + - psk-mixed + - wpa + - wpa2 + - wpa-mixed + - sae + - sae-mixed + - wpa3 + - wpa3-mixed + uc-example: psk2 + key: + description: + The Pre Shared Key (PSK) that is used for encryption on the BSS when + using any of the WPA-PSK modes. + type: string + maxLength: 63 + minLength: 8 + uc-example: aaaaaaaa + 80211w: + description: + Enable 802.11w Management Frame Protection (MFP) for this BSS. + type: number + maximum: 2 + minimum: 0 + uc-example: 2 diff --git a/new/interfaces.ssids.pass-point.yml b/new/interfaces.ssids.pass-point.yml new file mode 100644 index 0000000..582f1ea --- /dev/null +++ b/new/interfaces.ssids.pass-point.yml @@ -0,0 +1,60 @@ +description: + Enable Hotspot 2.0 support. +type: object +properties: + venue-name: + description: + This parameter can be used to configure one or more Venue Name Duples + for Venue Name ANQP information. + type: string + venue-group: + description: + The available values are defined in 802.11u. + type: number + maximum: 32 + venue-type: + description: + The available values are defined in IEEE Std 802.11u-2011, 7.3.1.34 + type: number + maximum: 32 + venue-url: + description: + This parameter can be used to configure one or more Venue URL Duples to + provide additional information corresponding to Venue Name information. + type: string + auth-type: + description: + This parameter indicates what type of network authentication is used in + the network. + type: string + minLength: 2 + maxLength: 2 + domain-name: + description: + The IEEE 802.11u Domain Name. + type: string + nai-realm: + description: + NAI Realm information + type: string + osen: + description: + OSU Server-Only Authenticated L2 Encryption Network; + type: boolean + anqp-domain: + description: + ANQP Domain ID, An identifier for a set of APs in an ESS that share the + same common ANQP information. + type: number + maximum: 65535 + friendly-name: + description: + This parameter can be used to configure one or more Operator Friendly + Name Duples. + type: string + icon: + description: + The operator icons. + type: array + items: + type: string diff --git a/new/interfaces.ssids.radius.local-users.yml b/new/interfaces.ssids.radius.local-users.yml new file mode 100644 index 0000000..8d6da34 --- /dev/null +++ b/new/interfaces.ssids.radius.local-users.yml @@ -0,0 +1,24 @@ +description: + Describe the local EAP user/psk/vid triplets. +type: array +items: + type: object + properties: + type: array + items: + type: object + properties: + mac: + type: string + maxLength: 17 + minLength: 17 + uc-example: 00:11:22:33:44:55 + key: + type: string + maxLength: 63 + minLength: 8 + uc-example: aaaaaaaa + vid: + type: number + maximum: 4096 + uc-example: 100 diff --git a/new/interfaces.ssids.radius.server.yml b/new/interfaces.ssids.radius.server.yml new file mode 100644 index 0000000..cdcda31 --- /dev/null +++ b/new/interfaces.ssids.radius.server.yml @@ -0,0 +1,34 @@ +description: + Describe the properties of a Radius server. +type: object +properties: + host: + description: + The URI of our Radius server. + type: string + uc-example: 192.168.1.10 + port: + description: + The network of our Radius server. + type: number + maximum: 65535 + minimum: 1024 + uc-example: 1812 + secret: + description: + The shared Radius authentication secret. + type: string + uc-example: secret + request-attribute: + description: + The additional Access-Request attributes that gets sent to the server. + type: array + items: + type: string + uc-example: + - 126:s:Operator + request-cui: + description: + This will enable support for Chargeable-User-Identity (RFC 4372). + type: boolean + default: false diff --git a/new/interfaces.ssids.radius.yml b/new/interfaces.ssids.radius.yml new file mode 100644 index 0000000..d0bad4a --- /dev/null +++ b/new/interfaces.ssids.radius.yml @@ -0,0 +1,19 @@ +description: + When using EAP encryption we need to provide the required information + allowing us to connect to the AAA servers. +type: object +properties: + local-users: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/radius/local-users/" + authentication: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/radius/server/" + accounting: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/radius/server/" + properties: + interval: + description: + The interim accounting update interval. This value is defined in seconds. + type: number + maximum: 600 + minimum: 60 + default: 60 diff --git a/new/interfaces.ssids.rates.yml b/new/interfaces.ssids.rates.yml new file mode 100644 index 0000000..34927cd --- /dev/null +++ b/new/interfaces.ssids.rates.yml @@ -0,0 +1,14 @@ +description: + The rate configuration of this BSS. +type: object +properties: + beacon: + description: + The beacon rate that shall be used by the BSS. Values are in Mbps. + type: number + default: 0 + multicast: + description: + The multicast rate that shall be used by the BSS. Values are in Mbps. + type: number + default: 0 diff --git a/new/interfaces.ssids.roaming.yml b/new/interfaces.ssids.roaming.yml new file mode 100644 index 0000000..fe86475 --- /dev/null +++ b/new/interfaces.ssids.roaming.yml @@ -0,0 +1,24 @@ +description: + Enable 802.11r Fast Roaming for this BSS. +type: object +properties: + message-exchange: + description: + Shall the pre authenticated message exchange happen over the air or + distribution system. + type: string + enum: + - air + - ds + uc-example: ds + generate-psk: + description: + Whether to generate FT response locally for PSK networks. This avoids + use of PMK-R1 push/pull from other APs with FT-PSK networks. + type: boolean + uc-example: true + domain-identifier: + description: + Mobility Domain identifier (dot11FTMobilityDomainID, MDID). + type: string + uc-example: abcd diff --git a/new/interfaces.ssids.rrm.yml b/new/interfaces.ssids.rrm.yml new file mode 100644 index 0000000..0a9557c --- /dev/null +++ b/new/interfaces.ssids.rrm.yml @@ -0,0 +1,24 @@ +description: + Enable 802.11k Radio Resource Management (RRM) for this BSS. +type: object +properties: + neighbor-reporting: + description: + Enable neighbor report via radio measurements (802.11k). + type: boolean + lci: + description: + The content of a LCI measurement subelement + type: string + civic-location: + description: + The content of a location civic measurement subelement + type: string + ftm-responder: + description: + Publish fine timing measurement (FTM) responder functionality on this BSS. + type: boolean + stationary-ap: + description: + Stationary AP config indicates that the AP doesn't move. + type: number diff --git a/new/interfaces.ssids.yml b/new/interfaces.ssids.yml new file mode 100644 index 0000000..79b2dbd --- /dev/null +++ b/new/interfaces.ssids.yml @@ -0,0 +1,98 @@ +description: + A device has certain properties that describe its identity and location. + These properties are described inside this object. +type: object +properties: + name: + description: + The broadcasted SSID of the wireless network and for for managed mode + the SSID of the network you’re connecting to + type: string + maxLength: 32 + minLength: 1 + wifi-bands: + description: + The band that the SSID should be broadcasted on. The configuration layer + will use the first matching band. + type: array + items: + type: string + enum: + - 2 + - 5 + - 5l + - 5u + - 6 + bss-mode: + description: + Selects the operation mode of the wireless network interface controller. + type: string + enum: + - ap + - sta + - mesh + bssid: + description: + Override the BSSID of the network, only applicable in adhoc or sta mode. + type: string + maxLength: 17 + minLength: 17 + beacon-interval: + description: + Beacon interval in kus (1.024 ms). + type: number + maximum: 1000 + minimum: 15 + dtim-period: + description: + Set the DTIM (delivery traffic information message) period. There will + be one DTIM per this many beacon frames. This may be set between 1 and + 255. This option only has an effect on ap wifi-ifaces. + type: number + maximum: 255 + minimum: 1 + hidden-ssid: + description: + Disables the broadcasting of beacon frames if set to 1 and,in doing so, + hides the ESSID. + type: boolean + isolate-clients: + description: + Isolates wireless clients from each other on this BSS. + type: boolean + power-save: + description: + Unscheduled Automatic Power Save Delivery. + type: boolean + rts-threshold: + description: + Set the RTS/CTS threshold of the BSS. + type: number + maximum: 65535 + minimum: 1 + broadcast-time: + description: + This option will make the unit braodcast the time inside its beacons. + type: boolean + unicast-conversion: + description: + Convert multicast traffic to unicast on this BSS. + type: boolean + encryption: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/encryption/" + captive: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/captive/" + rrm: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/rrm/" + rates: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/rates/" + roaming: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/roaming/" + radius: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/radius/" + hostapd-bss-raw: + description: + This array allows passing raw hostapd.conf lines. + type: array + items: + type: string diff --git a/new/interfaces.vlan.yml b/new/interfaces.vlan.yml new file mode 100644 index 0000000..f4fc5ef --- /dev/null +++ b/new/interfaces.vlan.yml @@ -0,0 +1,18 @@ +description: + This section describes the vlan behaviour of a logical network interface. +type: object +properties: + id: + description: + This is the pvid of the vlan that shall be assigned to the interface. + The individual physical network devices contained within the interface + need to be told explicitly if egress traffic shall be tagged. + type: number + maximum: 4096 + proto: + decription: + The L2 vlan tag that shall be added (1q,1ad) + type: string + enum: + - 802.1ad + - 802.1q diff --git a/new/interfaces.yml b/new/interfaces.yml new file mode 100644 index 0000000..61aac54 --- /dev/null +++ b/new/interfaces.yml @@ -0,0 +1,56 @@ +description: + This section describes the logical network interfaces of the device. + Interfaces as their primary have a role that is upstream, downstream, + guest, .... +type: object +properties: + name: + description: + This is a free text field, stating the administrative name of the + interface. It may contain spaces and special characters. + type: string + uc-example: LAN + role: + description: + The role defines if the interface is upstream or downstream facing. + type: string + enum: + - upstream + - downstream + uc-example: downstream + isolate-hosts: + description: + This option makes sure that any traffic leaving this interface is isolated + and all local IP ranges are blocked. It essentially enforces "guest network" + firewall settings. + type: boolean + uc-example: false + metric: + description: + The routing metric of this logical interface. Lower values have higher + priority. + type: boolean + default: 10 + uc-example: 10 + services: + description: + The services that shall be offered on this logical interface. These are + just strings such as "ssh", "lldp", "mdns" + type: array + items: + type: string + uc-example: + - ssh + - lldp + vlan: + $ref: "https://ucentral.io/schema/v1/interfaces/vlan/" + bridge: + $ref: "https://ucentral.io/schema/v1/interfaces/bridge/" + erthernet: + $ref: "https://ucentral.io/schema/v1/interfaces/ethernet/" + ipv4: + $ref: "https://ucentral.io/schema/v1/interfaces/ipv4/" + ipv6: + ref: "https://ucentral.io/schema/v1/interfaces/ipv6/" + ssids: + $ref: "https://ucentral.io/schema/v1/interfaces/ssids/" diff --git a/new/merge-schema.py b/new/merge-schema.py new file mode 100755 index 0000000..a3b515f --- /dev/null +++ b/new/merge-schema.py @@ -0,0 +1,40 @@ +#!/usr/bin/env python3 + +import yaml +import json + +def schema_filename(list): + file = list.split("v1/") + file.pop(0) + return file[0].replace("/", ".") + "yml" + +def schema_load(filename): + with open(filename) as stream: + try: + schema = yaml.safe_load(stream) + return schema + except yaml.YAMLError as exc: + print(exc) + +def schema_compile(input, output, tiny): + for k in input: + if tiny and k == "description": + continue + if isinstance(input[k], dict): + if k not in output: + output[k] = {} + schema_compile(input[k], output[k], tiny) + elif k == "$ref" and input[k].startswith("https://"): + output.update(schema_compile(schema_load(schema_filename(input[k])), {}, tiny)) + elif k == "$ref" and not tiny: + output["properties"] = {"reference": {"type": "string"}} + else: + output[k] = input[k] + return output + +def schema_generate(filename, tiny): + with open(filename, 'w') as outfile: + json.dump(schema_compile(schema_load("ucentral.yml"), {}, tiny), outfile, ensure_ascii = tiny and False or True, indent = tiny and 0 or 4) + +schema_generate('ucentral.schema.json', 1) +schema_generate('ucentral.schema.pretty.json', 0) diff --git a/new/metrics.yml b/new/metrics.yml new file mode 100644 index 0000000..e01ff46 --- /dev/null +++ b/new/metrics.yml @@ -0,0 +1,36 @@ +description: + There are several types of mertics that shall be reported in certain + intervals. This section provides a granual configuration. +type: object +properties: + statistics: + description: + Statistics are traffic counters, neighbor tables, ... + type: object + properties: + interval: + description: + The reporting interval defined in seconds. + type: number + types: + description: + A list of names of subsystems that shall be reported periodically. + type: array + items: + types: string + health: + description: + Health check gets executed periodically and will report a health value + between 0-100 indicating how healthy the device thinks it is + type: object + properties: + interval: + description: + The reporting interval defined in seconds. + type: number + types: + description: + A list of names of subsystems that shall be reported periodically. + type: array + items: + types: string diff --git a/new/radios.he.yml b/new/radios.he.yml new file mode 100644 index 0000000..75ddb56 --- /dev/null +++ b/new/radios.he.yml @@ -0,0 +1,16 @@ +description: + This section describes the HE specific configuration options of the BSS. +properties: + multiple-bssid: + description: + Enabling this option will make the PHY broadcast its BSSs using the multiple BSSID beacon IE. + type: boolean + ema: + description: + Enableing this option will make the PHY broadcast its multiple BSSID beacons using EMA. + type: boolean + bss-color: + description: + This enables BSS Coloring on the PHY. setting it to 0 disables the feature 1-63 sets the color + and 64 will make hostapd pick a random color. + type: boolean diff --git a/new/radios.yml b/new/radios.yml new file mode 100644 index 0000000..910bd76 --- /dev/null +++ b/new/radios.yml @@ -0,0 +1,102 @@ +description: + Describe a physical radio on the AP. A radio s be parent to several VAPs. + They all share the same physical properties. +type: array +items: + type: object + properties: + band: + type: string + enum: + - 2 + - 5 + - 5u + - 5l + - 6 + bandwidth: + description: + Specifies a narrow channel width in MHz, possible values are: 5, 10, 20. + type: number + enum: + - 5 + - 10 + - 20 + channel: + description: + Specifies the wireless channel to use. A value of 0 starts the ACS + algorithm. + type: number + maximum: 171 + minimum: 0 + country: + description: + Specifies the country code, affects the available channels and + transmission powers. + type: string + maxLength: 2 + minLength: 2 + channel-mode: + description: + Define the ideal channel mode that the radio shall use. This can be 802.11n, 802.11ac + or 802.11ax. This is just a hint for the AP. If the requested value is not supported + then the AP will use the highest common denominator. + type: string + enum: + - HT + - VHT + - HE + channel-width: + description: + The channel width that the radio shall use. This is just a hint for the AP. If the + requested value is not supported then the AP will use the highest common denominator. + type: string + enum: + - 20 + - 40 + - 80 + - 160 + - 8080 + require-mode: + description: + Sations that do no fulfill these HT modes will be rejected. + type: array + items: + type: string + enum: + - HT + - VHT + - HE + mimo: + description: + This option allows configuring the antenna pairs that shall be used. + This is just a hint for the AP. If the requested value is not supported + then the AP will use the highest common denominator. + type: string + enum: + - 1x1 + - 2x2 + - 3x3 + - 4x4 + - 5x5 + - 6x6 + - 7x7 + - 8x8 + tx-power: + description: + This option specifies the transmission power in dBm + type: number + maximum: 30 + minimum: 0 + legacy-rates: + description: + Allow legacy 802.11b data rates. + type: boolean + default: false + he-settings: + $ref: "https://ucentral.io/schema/v1/radios/he/" + hostapd-iface-raw: + description: + This array allows passing raw hostapd.conf lines. + type: array + items: + type: string diff --git a/new/services.lldp.yml b/new/services.lldp.yml new file mode 100644 index 0000000..c18b8bd --- /dev/null +++ b/new/services.lldp.yml @@ -0,0 +1,10 @@ +type: object +properties: + describe: + description: + The LLDP description field. If set to "auto" it will be derived from unit.name. + type: string + location: + description: + The LLDP location field. If set to "auto" it will be derived from unit.location. + type: string diff --git a/new/services.log.yml b/new/services.log.yml new file mode 100644 index 0000000..88ee28b --- /dev/null +++ b/new/services.log.yml @@ -0,0 +1,28 @@ +description: + This section can be used to configure remote syslog support. +type: object +properties: + host: + description: + IP address of a syslog server to which the log messages should be + sent in addition to the local destination. + type: string + port: + description: + Port number of the remote syslog server specified with log_ip. + type: number + maximum: 65535 + minimum: 100 + proto: + description: + Sets the protocol to use for the connection, either tcp or udp. + type: string + enum: + - tcp + - udp + size: + description: + Size of the file based log buffer in KiB. This value is used as the fallback + value for log_buffer_size if the latter is not specified. + type: number + minimum: 32 diff --git a/new/services.mdns.yml b/new/services.mdns.yml new file mode 100644 index 0000000..a5bed7f --- /dev/null +++ b/new/services.mdns.yml @@ -0,0 +1,9 @@ +description: + This section can be used to configure the MDNS server. +type: object +properties: + enable: + description: + Enable this option if you would like to enable the MDNS server on the unit. + type: boolean + default: false diff --git a/new/services.ntp.yml b/new/services.ntp.yml new file mode 100644 index 0000000..deeff23 --- /dev/null +++ b/new/services.ntp.yml @@ -0,0 +1,11 @@ +type: object +description: + This section can be used to setup the upstream NTP servers. +properties: + servers: + description: + This is an array of URL/IP of the upstream NTP servers that the unit shall use to + acquire its current time. + type: array + items: + type: string diff --git a/new/services.rtty.yml b/new/services.rtty.yml new file mode 100644 index 0000000..4b48b60 --- /dev/null +++ b/new/services.rtty.yml @@ -0,0 +1,21 @@ +description: + This section can be used to setup a SSH server on the AP. +type: object +properties: + enable: + description: + Shall the service be enabled. + type: boolean + host: + description: + The server that the AP shal to connect to. + type: string + port: + description: + This option defines the port that we connect to. + type: number + maximum: 65535 + token: + description: + The security token that we use to authenticate with the server. + type: string diff --git a/new/services.ssh.yml b/new/services.ssh.yml new file mode 100644 index 0000000..8013e28 --- /dev/null +++ b/new/services.ssh.yml @@ -0,0 +1,26 @@ +description: + This section can be used to setup a SSH server on the AP. +type: object +properties: + enable: + description: + Enable this option if you would like to enable the SSH server on the unit. + type: boolean + default: false + port: + description: + This option defines which port the SSH server shall be available on. + type: number + maximum: 65535 + authorized-keys: + description: + This allows the upload of public ssh keys. Keys need to be seperated by a + newline. + type: array + items: + type: string + password-authentication: + description: + This option defines if password authentication shall be enabled. If set + to false, only ssh key based authentication is possible. + type: boolean diff --git a/new/services.wifi-steering.yml b/new/services.wifi-steering.yml new file mode 100644 index 0000000..57d7b21 --- /dev/null +++ b/new/services.wifi-steering.yml @@ -0,0 +1,8 @@ +description: + This section describes the band steering behaviour of the unit. +type: object +properties: + network: + description: + The network that shall be used to communicate with the other peers. + type: string diff --git a/new/services.yml b/new/services.yml new file mode 100644 index 0000000..bf345fc --- /dev/null +++ b/new/services.yml @@ -0,0 +1,19 @@ +description: + This section describes all of the services that may be present on the AP. + Each service is then referenced via its name inside an interface, ssid, ... +type: object +properties: + lldp: + $ref: "https://ucentral.io/schema/v1/services/lldp/" + ssh: + $ref: "https://ucentral.io/schema/v1/services/ssh/" + ntp: + $ref: "https://ucentral.io/schema/v1/services/ntp/" + mdns: + $ref: "https://ucentral.io/schema/v1/services/mdns/" + rtty: + $ref: "https://ucentral.io/schema/v1/services/rtty/" + log: + $ref: "https://ucentral.io/schema/v1/services/log/" + wifi-steering: + $ref: "https://ucentral.io/schema/v1/services/wifi-steering/" diff --git a/new/ucentral.yml b/new/ucentral.yml new file mode 100644 index 0000000..62c0b6b --- /dev/null +++ b/new/ucentral.yml @@ -0,0 +1,21 @@ +$id: https://openwrt.org/ucentral.schema.json +$schema: http://json-schema.org/draft-07/schema# +description: OpenWrt uCentral schema +type: object +properties: + unit: + $ref: "https://ucentral.io/schema/v1/unit/" + globals: + $ref: "https://ucentral.io/schema/v1/globals/" + definitions: + $ref: "https://ucentral.io/schema/v1/definitions/" + radios: + $ref: "https://ucentral.io/schema/v1/radios/" + interfaces: + $ref: "https://ucentral.io/schema/v1/interfaces/" + services: + $ref: "https://ucentral.io/schema/v1/services/" + metrics: + $ref: "https://ucentral.io/schema/v1/metrics/" + config-raw: + $ref: "https://ucentral.io/schema/v1/config-raw/" diff --git a/new/unit.yml b/new/unit.yml new file mode 100644 index 0000000..e5bee3a --- /dev/null +++ b/new/unit.yml @@ -0,0 +1,19 @@ +description: + A device has certain properties that describe its identity and location. + These properties are described inside this object. +type: object +properties: + name: + description: + This is a free text field, stating the administrative name of the + device. It may contain spaces and special characters. + type: string + location: + description: + This is a free text field, stating the location of the device. It + may contain spaces and special characters. + type: string + timezone: + description: + This allows you to change the TZ of the device. + type: string