dpport

package
v0.4.0 Latest Latest
Warning

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

Go to latest
Published: Jun 26, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var EMPTY_TUPLE = errors.New("EMPTY_TUPLE")

Functions

func ParsePortLine added in v0.4.0

func ParsePortLine(s string) (uint, []uint, error)

func PortMap

func PortMap(name string) (map[uint]uint, error)

Types

type L2SWAccessConfig added in v0.4.0

type L2SWAccessConfig struct {
	Eth uint
	Vid uint
}

func NewL2SWAccessConfig added in v0.4.0

func NewL2SWAccessConfig(eth, vid uint) *L2SWAccessConfig

func ParseL2SWAccessConfig added in v0.4.0

func ParseL2SWAccessConfig(s string) (*L2SWAccessConfig, error)

func (*L2SWAccessConfig) String added in v0.4.0

func (c *L2SWAccessConfig) String() string

type L2SWConfig added in v0.4.0

type L2SWConfig struct {
	Access []string `yaml:"access"`
	Trunk  []string `yaml:"trunk"`
}

type L2SWTrunkConfig added in v0.4.0

type L2SWTrunkConfig struct {
	Eth  uint
	Vids []uint
}

func NewL2SWTrunkConfig added in v0.4.0

func NewL2SWTrunkConfig(eth uint, vids []uint) *L2SWTrunkConfig

func ParseL2SWTrunkConfig added in v0.4.0

func ParseL2SWTrunkConfig(s string) (*L2SWTrunkConfig, error)

func (*L2SWTrunkConfig) String added in v0.4.0

func (c *L2SWTrunkConfig) String() string

type PortConfig

type PortConfig struct {
	Eth  []uint      `yaml:"eth"`
	Vlan []string    `yaml:"vlan"`
	L2sw *L2SWConfig `yaml:"l2sw"`
}

func NewPortConfig

func NewPortConfig() *PortConfig

func (*PortConfig) Devices

func (c *PortConfig) Devices() []*VlanConfig

func (*PortConfig) Filter

func (c *PortConfig) Filter(src map[uint]uint) map[uint]uint

func (*PortConfig) L2SWAccessPorts added in v0.4.0

func (c *PortConfig) L2SWAccessPorts() []*L2SWAccessConfig

func (*PortConfig) L2SWTrunkPorts added in v0.4.0

func (c *PortConfig) L2SWTrunkPorts() []*L2SWTrunkConfig

func (*PortConfig) Vlans

func (c *PortConfig) Vlans() []*VlanConfig

type PortsConfig

type PortsConfig struct {
	Ports map[string]*PortConfig `yaml:"ports"`
}

func NewPortsConfig

func NewPortsConfig() *PortsConfig

func ReadConfig

func ReadConfig(path string) *PortsConfig

func (*PortsConfig) PortConfig

func (c *PortsConfig) PortConfig(name string) (*PortConfig, bool)

type VlanConfig

type VlanConfig struct {
	Eth uint
	Vid uint
}

func NewVlanConfig

func NewVlanConfig(eth, vid uint) *VlanConfig

func ParseVlanConfig

func ParseVlanConfig(s string) (*VlanConfig, error)

func (*VlanConfig) String

func (c *VlanConfig) String() string

Jump to

Keyboard shortcuts

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