Skip to main content

Network

Struct Network 

Source
pub struct Network {
    pub cidr: String,
    pub internet: bool,
    pub gateway: Option<String>,
    pub docker: Option<NetworkDocker>,
    pub vlans: IndexMap<u16, Vlan>,
    pub switch: Option<String>,
    pub vlan: Option<(String, u16)>,
    pub tc: Option<Tc>,
    pub ipv6: Option<Ipv6>,
    pub external: Option<String>,
    pub bridged: Option<Bridged>,
    pub mtu: Option<u16>,
}
Expand description

A network: an address block, whether it reaches the internet, and what routes it.

Fields§

§cidr: String

The network’s private IPv4 block (inside 10.0.0.0/8, 172.16.0.0/12 or 192.168.0.0/16), a /24 to a /29, e.g. 10.20.0.0/24. A LAN split into vlans may be larger, from /8.

§internet: bool

Whether machines on it may reach the internet (default true).

§gateway: Option<String>

A machine of the environment that routes this network (an edge firewall): it takes the gateway address, and its own configuration decides what crosses it. Isoloom adds no router of its own here, so reach and internet on this network become expected behavior for the checks to verify.

§docker: Option<NetworkDocker>

How the Docker target lays this network out, when it differs from the other targets.

§vlans: IndexMap<u16, Vlan>

The VLANs this LAN is split into, by id (1-4094), each with its own block inside the LAN’s. Machines join one as <lan>.vlan<id> (office.vlan10); a reach rule naming the LAN covers all of its VLANs. Each VLAN becomes a network of its own, <lan>-vlan<id>; the LAN itself stays a network only when a machine joins it directly.

§switch: Option<String>

On a LAN split into vlans: a switch appliance of the environment (docker.appliance: cisco-iol-l2 or cisco-vios-l2) that switches it, instead of Isoloom’s own Linux switch. Its ports are derived, so the machine lists no networks: an access port per VLAN, then a trunk per machine on several of the LAN’s VLANs. Docker targets only.

§vlan: Option<(String, u16)>

Set by parsing on the networks a LAN’s VLANs become: that LAN and the VLAN’s id, so a target can carry them on one 802.1Q segment (a machine on several of them gets a trunk).

§tc: Option<Tc>

Link impairment on traffic entering this network through Isoloom’s router (a slow or lossy link): delay, jitter, loss, rate. Needs the router on the network (a reach rule touching it, no gateway machine).

§ipv6: Option<Ipv6>

The network’s IPv6 block: dual-stack beside cidr, or IPv6-only (only: true). Machines get an IPv6 address on it (derived from their octet, or handed out by the target) and routes to the other IPv6 blocks the reach rules open.

§external: Option<String>

An existing network, by its name on the target (a Docker network, a Proxmox bridge, an ESXi port group): the machines join it, and Isoloom never creates or deletes it. cidr is its block, and the machines keep fixed addresses in it.

§bridged: Option<Bridged>

Bridged to an interface of the host, so the machines sit on the host’s own LAN (fixed addresses in cidr, or DHCP from the LAN).

§mtu: Option<u16>

The largest packet the network carries, in bytes (576 to 9216): smaller to mimic a tunnel or a VPN link, jumbo frames (9000) for a storage network. A LAN’s VLANs carry the LAN’s. Default: the target’s own (1500 on most).

Implementations§

Source§

impl Network

Source

pub fn is_outside(&self) -> bool

Whether the network is outside the environment (external or bridged): Isoloom doesn’t make it, route it or put its own machines on it.

Source

pub fn is_dhcp(&self) -> bool

Whether its machines take their address from the LAN’s DHCP server.

Trait Implementations§

Source§

impl Clone for Network

Source§

fn clone(&self) -> Self

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Network

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for Network

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl JsonSchema for Network

Source§

fn schema_name() -> Cow<'static, str>

The name of the generated JSON Schema. Read more
Source§

fn schema_id() -> Cow<'static, str>

Returns a string that uniquely identifies the schema produced by this type. Read more
Source§

fn json_schema(generator: &mut SchemaGenerator) -> Schema

Generates a JSON Schema for this type. Read more
Source§

fn inline_schema() -> bool

Whether JSON Schemas generated for this type should be included directly in parent schemas, rather than being re-used where possible using the $ref keyword. Read more
Source§

impl PartialEq for Network

Source§

fn eq(&self, other: &Self) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for Network

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for Network

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = !

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, !>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.