network

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jun 6, 2016 License: GPL-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClosedDevice = errors.New("already closed device")
)

Functions

This section is empty.

Types

type Controller

type Controller struct {
	// contains filtered or unexported fields
}

func NewController

func NewController(log log.Logger, db database, conf *goconf.ConfigFile) *Controller

func (*Controller) AddConnection

func (r *Controller) AddConnection(ctx context.Context, c net.Conn)

func (*Controller) SetEventListener

func (r *Controller) SetEventListener(l EventListener)

func (*Controller) String

func (r *Controller) String() string

type ControllerEventListener

type ControllerEventListener interface {
	OnPacketIn(Finder, *Port, *protocol.Ethernet) error
	OnPortUp(Finder, *Port) error
	OnPortDown(Finder, *Port) error
	OnDeviceUp(Finder, *Device) error
	OnDeviceDown(Finder, *Device) error
}

type Descriptions

type Descriptions struct {
	Manufacturer string
	Hardware     string
	Software     string
	Serial       string
	Description  string
}

type Device

type Device struct {
	// contains filtered or unexported fields
}

func (*Device) Close

func (r *Device) Close()

func (*Device) Descriptions

func (r *Device) Descriptions() Descriptions

func (*Device) Factory

func (r *Device) Factory() openflow.Factory

func (*Device) Features

func (r *Device) Features() Features

func (*Device) FlowTableID

func (r *Device) FlowTableID() uint8

func (*Device) ID

func (r *Device) ID() string

func (*Device) IsClosed

func (r *Device) IsClosed() bool

func (*Device) Port

func (r *Device) Port(num uint32) *Port

Port may return nil if there is no port whose number is num

func (*Device) Ports

func (r *Device) Ports() []*Port

func (*Device) RemoveAllFlows

func (r *Device) RemoveAllFlows() error

func (*Device) RemoveFlow

func (r *Device) RemoveFlow(match openflow.Match, port openflow.OutPort) error

func (*Device) SendARPAnnouncement

func (r *Device) SendARPAnnouncement(ip net.IP, mac net.HardwareAddr) error

func (*Device) SendMessage

func (r *Device) SendMessage(msg encoding.BinaryMarshaler) error

func (*Device) String

func (r *Device) String() string

type EventListener

type EventListener interface {
	ControllerEventListener
	TopologyEventListener
}

type Features

type Features struct {
	DPID       uint64
	NumBuffers uint32
	NumTables  uint8
}

type Finder

type Finder interface {
	Device(id string) *Device
	Devices() []*Device
	// IsEnabledBySTP returns whether p is disabled by spanning tree protocol
	IsEnabledBySTP(p *Port) bool
	// IsEdge returns whether p is an edge among two switches
	IsEdge(p *Port) bool
	Node(mac net.HardwareAddr) (*Node, error)
	Path(srcDeviceID, dstDeviceID string) [][2]*Port
}

type Host

type Host struct {
	ID          string `json:"id"`
	IP          string `json:"ip"`
	Port        string `json:"port"`
	MAC         string `json:"mac"`
	Description string `json:"description"`
}

type HostParam

type HostParam struct {
	IPID        uint64 `json:"ip_id"`
	PortID      uint64 `json:"port_id"`
	MAC         string `json:"mac"`
	Description string `json:"description"`
}

type IP

type IP struct {
	ID      uint64 `json:"id"`
	Address string `json:"address"`
	Used    bool   `json:"used"`
	Port    string `json:"port"`
	Host    string `json:"host"`
}

type Network

type Network struct {
	ID uint64 `json:"id"`
	NetworkParam
}

type NetworkParam

type NetworkParam struct {
	Address string `json:"address"`
	Mask    uint8  `json:"mask"`
}

type Node

type Node struct {
	// contains filtered or unexported fields
}

func NewNode

func NewNode(p *Port, mac net.HardwareAddr) *Node

func (*Node) MAC

func (r *Node) MAC() net.HardwareAddr

func (*Node) Port

func (r *Node) Port() *Port

func (*Node) String

func (r *Node) String() string

type Port

type Port struct {
	// contains filtered or unexported fields
}

func NewPort

func NewPort(d *Device, num uint32) *Port

func (*Port) Device

func (r *Port) Device() *Device

func (*Port) ID

func (r *Port) ID() string

func (*Port) Number

func (r *Port) Number() uint32

func (*Port) SetValue

func (r *Port) SetValue(p openflow.Port)

func (*Port) String

func (r *Port) String() string

func (*Port) Value

func (r *Port) Value() openflow.Port

func (*Port) Vertex

func (r *Port) Vertex() graph.Vertex

type Switch

type Switch struct {
	ID uint64 `json:"id"`
	SwitchParam
}

type SwitchParam

type SwitchParam struct {
	DPID        uint64 `json:"dpid"`
	NumPorts    uint16 `json:"n_ports"`
	FirstPort   uint16 `json:"first_port"`
	Description string `json:"description"`
}

type SwitchPort

type SwitchPort struct {
	ID     uint64 `json:"id"`
	Number uint   `json:"number"`
}

type TopologyEventListener

type TopologyEventListener interface {
	OnTopologyChange(Finder) error
}

type VIP

type VIP struct {
	ID          uint64 `json:"id"`
	IP          string `json:"ip"`
	ActiveHost  Host   `json:"active_host"`
	StandbyHost Host   `json:"standby_host"`
	Description string `json:"description"`
}

type VIPParam

type VIPParam struct {
	IPID          uint64 `json:"ip_id"`
	ActiveHostID  uint64 `json:"active_host_id"`
	StandbyHostID uint64 `json:"standby_host_id"`
	Description   string `json:"description"`
}

Jump to

Keyboard shortcuts

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