2024-12-16 09:34:15 +01:00
|
|
|
# SPDX-FileCopyrightText: 2024 Lubin Bailly <lubin.bailly@dgnum.eu>
|
|
|
|
#
|
|
|
|
# SPDX-License-Identifier: EUPL-1.2
|
|
|
|
|
2024-12-09 11:55:57 +01:00
|
|
|
{ config, lib, ... }:
|
|
|
|
|
|
|
|
let
|
|
|
|
inherit (lib) concatMapStringsSep mkOption;
|
|
|
|
|
|
|
|
inherit (lib.types) listOf str;
|
|
|
|
in
|
|
|
|
|
|
|
|
{
|
|
|
|
options = {
|
|
|
|
protocols.rstp = mkOption {
|
|
|
|
type = listOf str;
|
|
|
|
description = ''
|
|
|
|
List of interfaces on which Rapid Spanning Tree Protocol should be enabled.
|
|
|
|
'';
|
|
|
|
};
|
|
|
|
netconf.xmls.protocols = mkOption {
|
|
|
|
type = str;
|
|
|
|
visible = false;
|
|
|
|
readOnly = true;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
config.netconf.xmls.protocols = ''
|
|
|
|
<protocols>
|
|
|
|
<rstp operation="replace">
|
|
|
|
${
|
|
|
|
concatMapStringsSep "" (intf: "<interface><name>${intf}</name></interface>") config.protocols.rstp
|
|
|
|
}
|
|
|
|
</rstp>
|
|
|
|
</protocols>
|
|
|
|
'';
|
|
|
|
}
|