Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions renderer/templates/services/natlog.uc
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
{% if (!services.is_present("natlog")) return; %}
{% services.set_enabled("natlog", natlog.enabled); %}

add natlog defaults
set natlog.@defaults[0].enabled={{ b(natlog.enabled) }}
9 changes: 9 additions & 0 deletions schema/service.natlog.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
description:
Whether should device enable NAT logging.
type: object
properties:
enabled:
description:
If the kernel module should be enabled, default to false
type: boolean
default: false
4 changes: 3 additions & 1 deletion schema/service.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,4 +52,6 @@ properties:
snmpd:
$ref: 'https://ucentral.io/schema/v1/service/snmpd/'
dhcp-inject:
$ref: 'https://ucentral.io/schema/v1/service/dhcp-inject/'
$ref: 'https://ucentral.io/schema/v1/service/dhcp-inject/'
natlog:
$ref: 'https://ucentral.io/schema/v1/service/natlog/'
31 changes: 31 additions & 0 deletions schemareader.uc
Original file line number Diff line number Diff line change
Expand Up @@ -10502,6 +10502,33 @@ function instantiateServiceDhcpInject(location, value, errors) {
return value;
}

function instantiateServiceNatlog(location, value, errors) {
if (type(value) == "object") {
let obj = {};

function parseEnabled(location, value, errors) {
if (type(value) != "bool")
push(errors, [ location, "must be of type boolean" ]);

return value;
}

if (exists(value, "enabled")) {
obj.enabled = parseEnabled(location + "/enabled", value["enabled"], errors);
}
else {
obj.enabled = false;
}

return obj;
}

if (type(value) != "object")
push(errors, [ location, "must be of type object" ]);

return value;
}

function instantiateService(location, value, errors) {
if (type(value) == "object") {
let obj = {};
Expand Down Expand Up @@ -10606,6 +10633,10 @@ function instantiateService(location, value, errors) {
obj.dhcp_inject = instantiateServiceDhcpInject(location + "/dhcp-inject", value["dhcp-inject"], errors);
}

if (exists(value, "natlog")) {
obj.natlog = instantiateServiceNatlog(location + "/natlog", value["natlog"], errors);
}

return obj;
}

Expand Down
11 changes: 11 additions & 0 deletions ucentral.schema.full.json
Original file line number Diff line number Diff line change
Expand Up @@ -4774,6 +4774,17 @@
}
}
}
},
"natlog": {
"description": "Whether should device enable NAT logging.",
"type": "object",
"properties": {
"enabled": {
"description": "If the kernel module should be enabled, default to false",
"type": "boolean",
"default": false
}
}
}
}
},
Expand Down
12 changes: 12 additions & 0 deletions ucentral.schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3678,6 +3678,15 @@
}
}
},
"service.natlog": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": false
}
}
},
"service": {
"type": "object",
"properties": {
Expand Down Expand Up @@ -3755,6 +3764,9 @@
},
"dhcp-inject": {
"$ref": "#/$defs/service.dhcp-inject"
},
"natlog": {
"$ref": "#/$defs/service.natlog"
}
}
},
Expand Down
14 changes: 14 additions & 0 deletions ucentral.schema.pretty.json
Original file line number Diff line number Diff line change
Expand Up @@ -4245,6 +4245,17 @@
}
}
},
"service.natlog": {
"description": "Whether should device enable NAT logging.",
"type": "object",
"properties": {
"enabled": {
"description": "If the kernel module should be enabled, default to false",
"type": "boolean",
"default": false
}
}
},
"service": {
"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",
Expand Down Expand Up @@ -4323,6 +4334,9 @@
},
"dhcp-inject": {
"$ref": "#/$defs/service.dhcp-inject"
},
"natlog": {
"$ref": "#/$defs/service.natlog"
}
}
},
Expand Down