mirror of
https://github.com/NixOS/nixpkgs.git
synced 2024-11-24 07:53:19 +00:00
nixos/networkd: add HeavyHitterFilter options
This commit is contained in:
parent
88d99a3630
commit
493ed75418
@ -1386,6 +1386,16 @@ let
|
||||
"CeilBufferBytes"
|
||||
])
|
||||
];
|
||||
|
||||
sectionHeavyHitterFilter = checkUnitConfig "HeavyHitterFilter" [
|
||||
(assertOnlyFields [
|
||||
"Parent"
|
||||
"Handle"
|
||||
"PacketLimit"
|
||||
])
|
||||
(assertInt "PacketLimit")
|
||||
(assertRange "PacketLimit" 0 4294967294)
|
||||
];
|
||||
};
|
||||
};
|
||||
|
||||
@ -2296,6 +2306,17 @@ let
|
||||
'';
|
||||
};
|
||||
|
||||
heavyHitterFilterConfig = mkOption {
|
||||
default = {};
|
||||
example = { Parent = "root"; PacketLimit = 10000; };
|
||||
type = types.addCheck (types.attrsOf unitOption) check.network.sectionHeavyHitterFilter;
|
||||
description = lib.mdDoc ''
|
||||
Each attribute in this set specifies an option in the
|
||||
`[HeavyHitterFilter]` section of the unit. See
|
||||
{manpage}`systemd.network(5)` for details.
|
||||
'';
|
||||
};
|
||||
|
||||
name = mkOption {
|
||||
type = types.nullOr types.str;
|
||||
default = null;
|
||||
@ -2815,6 +2836,10 @@ let
|
||||
[HierarchyTokenBucketClass]
|
||||
${attrsToSection def.hierarchyTokenBucketClassConfig}
|
||||
''
|
||||
+ optionalString (def.heavyHitterFilterConfig != { }) ''
|
||||
[HeavyHitterFilter]
|
||||
${attrsToSection def.heavyHitterFilterConfig}
|
||||
''
|
||||
+ def.extraConfig;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user