network

package
v0.0.0-...-eb49f3c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

Package network provides structs and functions pertaining to network resources.

Index

Constants

This section is empty.

Variables

View Source
var ErrIPEmpty = errors.New("ip address is nil")
View Source
var ErrInvalidRange = errors.New("range bounds are invalid, start is greater than end")
View Source
var ErrMaskEmpty = errors.New("mask is nil")
View Source
var ErrModelEmpty = errors.New("model is empty")
View Source
var ErrNumPortsEmpty = errors.New("number of ports is 0")
View Source
var ErrSerialNumberEmpty = errors.New("serial number is empty")

Functions

This section is empty.

Types

type IPAddressPool

type IPAddressPool struct {
	zebra.BaseResource
	Subnets []net.IPNet `json:"subnets"`
}

An IPAddressPool represents a range of consecutive IP addresses belonging to the same network.

func (*IPAddressPool) Validate

func (p *IPAddressPool) Validate(ctx context.Context) error

Validate returns an error if the given IPAddressPool object has incorrect values. Else, it returns nil.

type Switch

type Switch struct {
	zebra.BaseResource
	Credentials  zebra.Credentials `json:"credentials"`
	ManagementIP net.IP            `json:"managementIP"` //nolint:tagliatelle
	SerialNumber string            `json:"serialNumber"`
	Model        string            `json:"model"`
	NumPorts     uint32            `json:"numPorts"`
}

A Switch represents a switching device which has an ID, an associated IP address, a serial number, model, and ports.

func (*Switch) Validate

func (s *Switch) Validate(ctx context.Context) error

Validate returns an error if the given Switch object has incorrect values. Else, it returns nil.

type VLANPool

type VLANPool struct {
	zebra.BaseResource
	RangeStart uint16 `json:"rangeStart"`
	RangeEnd   uint16 `json:"rangeEnd"`
}

A VLANPool represents a pool of VLANs belonging to the same network.

func (*VLANPool) Validate

func (v *VLANPool) Validate(ctx context.Context) error

Validate returns an error if the given VLANPool object has incorrect values. Else, it returns nil.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL