nixos/networkd: add HierarchyTokenBucketClass options
This commit is contained in:
parent
24df07c786
commit
88d99a3630
@ -1371,6 +1371,21 @@ let
|
|||||||
])
|
])
|
||||||
(assertInt "RateToQuantum")
|
(assertInt "RateToQuantum")
|
||||||
];
|
];
|
||||||
|
|
||||||
|
sectionHierarchyTokenBucketClass = checkUnitConfig "HierarchyTokenBucketClass" [
|
||||||
|
(assertOnlyFields [
|
||||||
|
"Parent"
|
||||||
|
"ClassId"
|
||||||
|
"Priority"
|
||||||
|
"QuantumBytes"
|
||||||
|
"MTUBytes"
|
||||||
|
"OverheadBytes"
|
||||||
|
"Rate"
|
||||||
|
"CeilRate"
|
||||||
|
"BufferBytes"
|
||||||
|
"CeilBufferBytes"
|
||||||
|
])
|
||||||
|
];
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
@ -2270,6 +2285,17 @@ let
|
|||||||
'';
|
'';
|
||||||
};
|
};
|
||||||
|
|
||||||
|
hierarchyTokenBucketClassConfig = mkOption {
|
||||||
|
default = {};
|
||||||
|
example = { Parent = "root"; Rate = "10M"; };
|
||||||
|
type = types.addCheck (types.attrsOf unitOption) check.network.sectionHierarchyTokenBucketClass;
|
||||||
|
description = lib.mdDoc ''
|
||||||
|
Each attribute in this set specifies an option in the
|
||||||
|
`[HierarchyTokenBucketClass]` section of the unit. See
|
||||||
|
{manpage}`systemd.network(5)` for details.
|
||||||
|
'';
|
||||||
|
};
|
||||||
|
|
||||||
name = mkOption {
|
name = mkOption {
|
||||||
type = types.nullOr types.str;
|
type = types.nullOr types.str;
|
||||||
default = null;
|
default = null;
|
||||||
@ -2785,6 +2811,10 @@ let
|
|||||||
[HierarchyTokenBucket]
|
[HierarchyTokenBucket]
|
||||||
${attrsToSection def.hierarchyTokenBucketConfig}
|
${attrsToSection def.hierarchyTokenBucketConfig}
|
||||||
''
|
''
|
||||||
|
+ optionalString (def.hierarchyTokenBucketClassConfig != { }) ''
|
||||||
|
[HierarchyTokenBucketClass]
|
||||||
|
${attrsToSection def.hierarchyTokenBucketClassConfig}
|
||||||
|
''
|
||||||
+ def.extraConfig;
|
+ def.extraConfig;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user