mirror of
https://github.com/Telecominfraproject/ols-ucentral-schema.git
synced 2025-11-02 11:08:00 +00:00
schema: add igmp proxy support
Signed-off-by: John Crispin <john@phrozen.org>
This commit is contained in:
17
renderer/templates/services/igmp.uc
Normal file
17
renderer/templates/services/igmp.uc
Normal file
@@ -0,0 +1,17 @@
|
|||||||
|
|
||||||
|
# IGMP service configuration
|
||||||
|
|
||||||
|
{% if (igmp.enable): %}
|
||||||
|
{% let interfaces = services.lookup_interfaces("igmp") %}
|
||||||
|
{% for (let interface in interfaces): %}
|
||||||
|
{% if (!interface.ipv4) continue; %}
|
||||||
|
{% let name = ethernet.calculate_name(interface) %}
|
||||||
|
add igmpproxy phyint
|
||||||
|
set igmpproxy.@phyint[-1].network={{ name }}
|
||||||
|
set igmpproxy.@phyint[-1].zone={{ s((interface.role == "usptream") ? "wan" : name) }}
|
||||||
|
set igmpproxy.@phyint[-1].direction={{ s(interface.role) }}
|
||||||
|
{% if (interface.role == "upstream"): %}
|
||||||
|
set igmpproxy.@phyint[-1].altnet='0.0.0.0/0'
|
||||||
|
{% endif %}
|
||||||
|
{% endfor %}
|
||||||
|
{% endif %}
|
||||||
9
schema/service.igmp.yml
Normal file
9
schema/service.igmp.yml
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
description:
|
||||||
|
This section allows enabling the IGMP/Multicast proxy
|
||||||
|
type: object
|
||||||
|
properties:
|
||||||
|
enable:
|
||||||
|
description:
|
||||||
|
This option defines if the IGMP/Multicast proxy shall be enabled on the device.
|
||||||
|
type: boolean
|
||||||
|
default: false
|
||||||
@@ -17,5 +17,7 @@ properties:
|
|||||||
$ref: "https://ucentral.io/schema/v1/service/log/"
|
$ref: "https://ucentral.io/schema/v1/service/log/"
|
||||||
http:
|
http:
|
||||||
$ref: "https://ucentral.io/schema/v1/service/http/"
|
$ref: "https://ucentral.io/schema/v1/service/http/"
|
||||||
|
igmp:
|
||||||
|
$ref: "https://ucentral.io/schema/v1/service/igmp/"
|
||||||
wifi-steering:
|
wifi-steering:
|
||||||
$ref: "https://ucentral.io/schema/v1/service/wifi-steering/"
|
$ref: "https://ucentral.io/schema/v1/service/wifi-steering/"
|
||||||
|
|||||||
@@ -1397,6 +1397,22 @@ function instantiateServiceHttp(value) {
|
|||||||
return obj;
|
return obj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function instantiateServiceIgmp(value) {
|
||||||
|
assert(type(value) == "object", "Property service.igmp must be of type object");
|
||||||
|
|
||||||
|
let obj = {};
|
||||||
|
|
||||||
|
if (exists(value, "enable")) {
|
||||||
|
assert(type(value["enable"]) == "bool", "Property service.igmp.enable must be of type boolean");
|
||||||
|
obj.enable = value["enable"];
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
obj.enable = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
return obj;
|
||||||
|
}
|
||||||
|
|
||||||
function instantiateServiceWifiSteering(value) {
|
function instantiateServiceWifiSteering(value) {
|
||||||
assert(type(value) == "object", "Property service.wifi-steering must be of type object");
|
assert(type(value) == "object", "Property service.wifi-steering must be of type object");
|
||||||
|
|
||||||
@@ -1454,6 +1470,10 @@ function instantiateService(value) {
|
|||||||
obj.http = instantiateServiceHttp(value["http"]);
|
obj.http = instantiateServiceHttp(value["http"]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (exists(value, "igmp")) {
|
||||||
|
obj.igmp = instantiateServiceIgmp(value["igmp"]);
|
||||||
|
}
|
||||||
|
|
||||||
if (exists(value, "wifi-steering")) {
|
if (exists(value, "wifi-steering")) {
|
||||||
obj.wifi_steering = instantiateServiceWifiSteering(value["wifi-steering"]);
|
obj.wifi_steering = instantiateServiceWifiSteering(value["wifi-steering"]);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1176,6 +1176,15 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"service.igmp": {
|
||||||
|
"type": "object",
|
||||||
|
"properties": {
|
||||||
|
"enable": {
|
||||||
|
"type": "boolean",
|
||||||
|
"default": false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
"service.wifi-steering": {
|
"service.wifi-steering": {
|
||||||
"type": "object",
|
"type": "object",
|
||||||
"properties": {
|
"properties": {
|
||||||
@@ -1227,6 +1236,9 @@
|
|||||||
"http": {
|
"http": {
|
||||||
"$ref": "#/$defs/service.http"
|
"$ref": "#/$defs/service.http"
|
||||||
},
|
},
|
||||||
|
"igmp": {
|
||||||
|
"$ref": "#/$defs/service.igmp"
|
||||||
|
},
|
||||||
"wifi-steering": {
|
"wifi-steering": {
|
||||||
"$ref": "#/$defs/service.wifi-steering"
|
"$ref": "#/$defs/service.wifi-steering"
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user