Module ip¶
License: Apache 2.0
Version: 1.1.0
Author: Inmanta <code@inmanta.com>
This module requires compiler version 2016.5 or higher
Upstream project: https://github.com/inmanta/ip.git
Typedefs¶
-
typedef
ip::cidr
¶ Base type
string
Type constraint
(ip::is_valid_cidr(self) == true)
-
typedef
ip::cidr_v10
¶ Base type
string
Type constraint
(ip::is_valid_cidr_v10(self) == true)
-
typedef
ip::cidr_v6
¶ Base type
string
Type constraint
(ip::is_valid_cidr_v6(self) == true)
-
typedef
ip::ip
¶ Base type
string
Type constraint
(ip::is_valid_ip(self) == true)
-
typedef
ip::ip_v10
¶ Base type
string
Type constraint
(ip::is_valid_ip_v10(self) == true)
-
typedef
ip::ip_v6
¶ Base type
string
Type constraint
(ip::is_valid_ip_v6(self) == true)
-
typedef
ip::port
¶ Base type
number
Type constraint
((self >= 0) and (self < 65536))
-
typedef
ip::protocol
¶ Base type
string
Type constraint
(((((self == 'tcp') or (self == 'udp')) or (self == 'icmp')) or (self == 'sctp')) or (self == 'all'))
Entities¶
-
entity
ip::Address
¶ Parents:
ip::Alias
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
entity
ip::Alias
¶ Parents:
ip::IP
-
attribute ip::ip
netmask
='0.0.0.0'¶
-
attribute number
alias
=0¶
-
attribute bool
dhcp
=false¶
-
relation ip::services::Server
server
[0:*]¶ other end:
ip::services::Server.ips [0:*]
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute ip::ip
-
entity
ip::DstService
¶ Parents:
ip::Service
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
entity
ip::Host
¶ Parents:
std::Host
A host that has an ip attribute for easy ip address access in the configuration model.
-
attribute ip::ip
ip
¶ The ipaddress of this node
-
attribute bool
remote_agent
=false¶ Start the mgmt agent for this node on the server and use remote io (ssh)
-
attribute string
remote_user
='root'¶ The remote user for the remote agent to login with
-
attribute ip::port
remote_port
=22¶ The remote port for this remote agent to use.
-
relation ip::services::Server
servers
[0:*]¶ other end:
ip::services::Server.host [1]
-
relation ip::services::Client
clients
[0:*]¶ other end:
ip::services::Client.host [1]
The following implements statements select implementations for this entity:
std::hostDefaults
constrainttrue
-
attribute ip::ip
-
entity
ip::IP
¶ Parents:
std::Entity
Base class for all ip addresses
-
attribute ip::ip
v4
='0.0.0.0'¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute ip::ip
-
entity
ip::Network
¶ Parents:
std::Entity
A network in this infrastructure.
-
attribute string
network
¶
-
attribute string
netmask
¶
-
attribute string
name
¶
-
attribute bool
dhcp
¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute string
-
entity
ip::Port
¶ Parents:
ip::PortRange
-
attribute ip::port
high
=0¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute ip::port
-
entity
ip::PortRange
¶ Parents:
std::Entity
-
attribute ip::port
low
¶
-
attribute ip::port
high
¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute ip::port
-
entity
ip::Service
¶ Parents:
std::Entity
Define a service as a protocol and a source and destination port range
-
attribute ip::protocol
proto
¶
-
relation ip::PortRange
dst_range
[0:*]¶
-
relation ip::PortRange
src_range
[0:*]¶
-
relation ip::services::BaseServer
listening_servers
[0:*]¶ other end:
ip::services::BaseServer.services [0:*]
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute ip::protocol
-
entity
ip::services::BaseClient
¶ Parents:
std::Entity
Base client class that connects to a server
-
relation ip::services::BaseServer
servers
[0:*]¶ other end:
ip::services::BaseServer.clients [0:*]
-
relation ip::services::BaseServer
-
entity
ip::services::BaseServer
¶ Parents:
std::Entity
Base class for servers that accept connections from clients
-
relation ip::Service
services
[0:*]¶ other end:
ip::Service.listening_servers [0:*]
-
relation ip::services::BaseClient
clients
[0:*]¶ other end:
ip::services::BaseClient.servers [0:*]
-
relation ip::Service
-
entity
ip::services::Client
¶ Parents:
ip::services::BaseClient
This interface models a client that is linked to a host
-
relation ip::Host
host
[1]¶ other end:
ip::Host.clients [0:*]
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
relation ip::Host
-
entity
ip::services::Server
¶ Parents:
ip::services::BaseServer
This interface models a server that accepts connections from a client
-
relation ip::Host
host
[1]¶ other end:
ip::Host.servers [0:*]
-
relation ip::Alias
ips
[0:*]¶ other end:
ip::Alias.server [0:*]
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
relation ip::Host
-
entity
ip::services::VirtualClient
¶ Parents:
ip::services::BaseClient
,ip::services::VirtualSide
This interface models a virtual client. It can for example represent all clients that exist on the internet.
-
attribute string
name
¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute string
-
entity
ip::services::VirtualHost
¶ Parents:
ip::services::VirtualScope
An address represented by a hostname
-
attribute std::hoststring
hostname
¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute std::hoststring
-
entity
ip::services::VirtualIp
¶ Parents:
ip::services::VirtualScope
Only one ip
-
attribute ip::ip
address
¶
-
attribute ip::ip
-
entity
ip::services::VirtualNetwork
¶ Parents:
ip::services::VirtualScope
Define a virtual network segment
-
attribute ip::ip
network
¶
-
attribute ip::ip
netmask
¶
-
attribute ip::ip
-
entity
ip::services::VirtualRange
¶ Parents:
ip::services::VirtualScope
A range defined by from/to
-
attribute ip::ip
from
¶
-
attribute ip::ip
to
¶
The following implements statements select implementations for this entity:
std::none
constrainttrue
-
attribute ip::ip
-
entity
ip::services::VirtualScope
¶ Parents:
std::Entity
This interface represents a scope to determine what a virtual client or server is.
-
relation ip::services::VirtualSide
side
[0:*]¶ other end:
ip::services::VirtualSide.scope [0:*]
-
relation ip::services::VirtualSide
-
entity
ip::services::VirtualServer
¶ Parents:
ip::services::BaseServer
,ip::services::VirtualSide
Same as VirtualClient but then for a server
-
attribute string
name
¶
-
attribute string
-
entity
ip::services::VirtualSide
¶ Parents:
std::Entity
A base class for a virtual server or client
-
relation ip::services::VirtualScope
scope
[0:*]¶ other end:
ip::services::VirtualScope.side [0:*]
-
relation ip::services::VirtualScope
Plugins¶
-
ip.
add
(addr: ip::ip_v10, n: number) → ip::ip_v10¶ Add a number to the given ip.
-
ip.
cidr_to_network
(cidr: string) → string¶ Given cidr return the network address
-
ip.
concat
(host: std::hoststring, domain: std::hoststring) → std::hoststring¶ Concat host and domain
-
ip.
hostname
(fqdn: string) → string¶ Return the hostname part of the fqdn
-
ip.
ipindex
(addr: ip::cidr_v10, position: number) → string¶ Return the address at position in the network.
-
ip.
ipnet
(addr: ip::cidr_v10, what: string) → string¶
-
ip.
is_valid_cidr
(addr: string) → bool¶
-
ip.
is_valid_cidr_v10
(addr: string) → bool¶ Validate if the string matches a v6 or a v4 network in CIDR notation
-
ip.
is_valid_cidr_v6
(addr: string) → bool¶
-
ip.
is_valid_ip
(addr: string) → bool¶
-
ip.
is_valid_ip_v10
(addr: string) → bool¶ Validate if the string matches a v6 or v4 address
-
ip.
is_valid_ip_v6
(addr: string) → bool¶
-
ip.
net_to_nm
(network_addr: string) → string¶
-
ip.
netmask
(cidr: number) → ip::ip¶ Given the cidr, return the netmask
-
ip.
network
(ip: ip::ip, cidr: string) → string¶ Given the ip and the cidr, return the network address