ipmininet.host.config package¶
This module holds the configuration generators for daemons that can be used in a host.
-
class
ipmininet.host.config.
HostConfig
(node: IPNode, daemons: Iterable[Union[Daemon, Type[Daemon], Tuple[Union[Daemon, Type[Daemon]], Dict[KT, VT]]]] = (), sysctl: Optional[Dict[str, Union[str, int]]] = None, *args, **kwargs)¶ Bases:
ipmininet.router.config.base.NodeConfig
Initialize our config builder
Parameters: - node – The node for which this object will build configurations
- daemons – an iterable of active routing daemons for this node
- sysctl – A dictionary of sysctl to set for this node. By default, it enables IPv4/IPv6 forwarding on all interfaces.
-
class
ipmininet.host.config.
HostDaemon
(node, template_lookup=<mako.lookup.TemplateLookup object>, **kwargs)¶
-
class
ipmininet.host.config.
Named
(node, **kwargs)¶ Bases:
ipmininet.host.config.base.HostDaemon
-
KILL_PATTERNS
= ('named',)¶
-
NAME
= 'named'¶
-
build
()¶ Build the configuration tree for this daemon
Returns: ConfigDict-like object describing this configuration
-
build_largest_reverse_zone
(cfg_zones: ipmininet.router.config.utils.ConfigDict, records: List[Union[PTRRecord, NSRecord]])¶ Create the ConfigDict object representing a new reverse zone whose prefix is the largest one that includes all the PTR records. Then it adds it to the cfg_zones dict.
Parameters: - cfg_zones – The dict of ConfigDict representing existing zones
- records – The list of PTR records to place a new reverse zone
-
build_reverse_zone
(cfg_zones: ipmininet.router.config.utils.ConfigDict)¶ Build non-existing PTR records. Then, adds them to an existing reverse zone if any. The remaining ones are inserted in a new reverse zone that is added to cfg_zones dictionary.
-
build_zone
(zone: ipmininet.host.config.named.DNSZone) → ipmininet.router.config.utils.ConfigDict¶
-
cfg_filenames
¶ Return the list of filenames in which this daemon config should be stored
-
dry_run
¶ The startup line to use to check that the daemon is well-configured
-
set_defaults
(defaults)¶ Parameters: - log_severity – It controls the logging levels and may take the values defined. Logging will occur for any message equal to or higher than the level specified (=>) lower levels will not be logged. These levels are ‘critical’, ‘error’, ‘warning’, ‘notice’, ‘info’, ‘debug’ and ‘dynamic’.
- dns_server_port – The port number of the dns server
- hint_root_zone – Add hints to root dns servers if this is not the root server
-
startup_line
¶ Return the corresponding startup_line for this daemon
-
template_filenames
¶
-
zone_filename
(domain_name: str) → str¶
-
-
class
ipmininet.host.config.
DNSZone
(name: str, dns_master: str, dns_slaves: Sequence[str] = (), records: Sequence[ipmininet.host.config.named.DNSRecord] = (), nodes: Sequence[str] = (), refresh_time=86400, retry_time=7200, expire_time=3600000, min_ttl=172800, ns_domain_name: Optional[str] = None, subdomain_delegation=True, delegated_zones: Sequence[DNSZone] = ())¶ Bases:
ipmininet.overlay.Overlay
Parameters: - name – The domain name of the zone
- dns_master – The name of the master DNS server
- dns_slaves – The list of names of DNS slaves
- records – The list of DNS Records to be included in the zone
- nodes – The list of nodes for which one A/AAAA record has to be created for each of their IPv4/IPv6 addresses
- refresh_time – The number of seconds before the zone should be refreshed
- retry_time – The number of seconds before a failed refresh should be retried
- expire_time – The upper limit in seconds before a zone is considered no longer authoritative
- min_ttl – The negative result TTL
- ns_domain_name – If it is defined, it is the suffix of the domain of the name servers, otherwise, parameter ‘name’ is used.
- subdomain_delegation – If set, additional records for subdomain name servers are added to guarantee correct delegation
- delegated_zones – Additional delegated zones
-
add_record
(record: ipmininet.host.config.named.DNSRecord)¶
-
apply
(topo)¶ Apply the Overlay properties to the given topology
-
check_consistency
(topo)¶ Check that this overlay is consistent
-
ns_records
¶
-
records
¶
-
class
ipmininet.host.config.
ARecord
(domain_name, address: Union[str, ipaddress.IPv4Address, ipaddress.IPv6Address], ttl=60)¶ Bases:
ipmininet.host.config.named.DNSRecord
-
rdata
¶
-
-
class
ipmininet.host.config.
NSRecord
(domain_name, name_server: str, ttl=60)¶ Bases:
ipmininet.host.config.named.DNSRecord
-
rdata
¶
-
-
class
ipmininet.host.config.
AAAARecord
(domain_name, address: Union[str, ipaddress.IPv4Address, ipaddress.IPv6Address], ttl=60)¶
-
class
ipmininet.host.config.
SOARecord
(domain_name, refresh_time=86400, retry_time=7200, expire_time=3600000, min_ttl=172800)¶ Bases:
ipmininet.host.config.named.DNSRecord
-
rdata
¶
-
-
class
ipmininet.host.config.
PTRRecord
(address: Union[str, ipaddress.IPv4Address, ipaddress.IPv6Address], domain_name: str, ttl=60)¶ Bases:
ipmininet.host.config.named.DNSRecord
-
rdata
¶
-
v6
¶
-