Coverage for src/birdplan/bird_config/sections/tables/master/master_attributes.py: 100%
13 statements
« prev ^ index » next coverage.py v7.15.2, created at 2026-07-25 07:38 +0000
« prev ^ index » next coverage.py v7.15.2, created at 2026-07-25 07:38 +0000
1#
2# SPDX-License-Identifier: GPL-3.0-or-later
3#
4# Copyright (c) 2019-2025, AllWorldIT
5#
6# This program is free software: you can redistribute it and/or modify
7# it under the terms of the GNU General Public License as published by
8# the Free Software Foundation, either version 3 of the License, or
9# (at your option) any later version.
10#
11# This program is distributed in the hope that it will be useful,
12# but WITHOUT ANY WARRANTY; without even the implied warranty of
13# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14# GNU General Public License for more details.
15#
16# You should have received a copy of the GNU General Public License
17# along with this program. If not, see <http://www.gnu.org/licenses/>.
19"""BIRD master table attributes."""
21__all__ = ["MasterTableAttributes", "MasterTableRoutePolicyExport", "MasterTableRoutePolicyExportKernel"]
24class MasterTableRoutePolicyExportKernel: # pylint: disable=too-few-public-methods
25 """
26 Master table route policy for exporting of routes to the kernel.
28 Attributes
29 ----------
30 bgp : bool
31 Export BGP routes to the kernel table. Defaults to `False`.
32 ospf : bool
33 Export OSPF routes to the kernel table. Defaults to `False`.
34 rip : bool
35 Export RIP routes to the kernel table. Defaults to `False`.
36 static : bool
37 Export static routes to the kernel table. Defaults to `False`.
39 """
41 bgp: bool
42 ospf: bool
43 rip: bool
44 static: bool
46 def __init__(self) -> None:
47 """Initialize object."""
48 self.bgp = True
49 self.ospf = True
50 self.rip = True
51 self.static = True
54class MasterTableRoutePolicyExport: # pylint: disable=too-few-public-methods
55 """
56 Master table route policy for exporting of routes to the kernel.
58 Attributes
59 ----------
60 kernel : MasterTableRoutePolicyExportKernel
61 Route policies for exporting routes to the kernel table.
63 """
65 kernel: MasterTableRoutePolicyExportKernel
67 def __init__(self) -> None:
68 """Initialize object."""
69 self.kernel = MasterTableRoutePolicyExportKernel()
72class MasterTableAttributes: # pylint: disable=too-few-public-methods
73 """
74 RIP attributes.
76 Attributes
77 ----------
78 route_policy_export : MasterTableRoutePolicyExport
79 Route policy for exporting of routes from the master table.
81 """
83 route_policy_export: MasterTableRoutePolicyExport
85 def __init__(self) -> None:
86 """Initialize object."""
88 self.route_policy_export = MasterTableRoutePolicyExport()