api

package
v0.0.0-...-36feecb Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2015 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewHostRegistrationEntry

func NewHostRegistrationEntry(vid uint16, ip net.IP) *nosw.FlowEntry

func NewL2FlowEntry

func NewL2FlowEntry(vid uint16, port uint32, mac net.HardwareAddr, flood bool) *nosw.FlowEntry

func NewL3UnicastEntry

func NewL3UnicastEntry(ipaddr net.IP, prefixlen int, gid uint32) *nosw.FlowEntry

func NewTerminationMacEntry

func NewTerminationMacEntry(vid uint16, mac net.HardwareAddr) *nosw.FlowEntry
func NewHostRegistrationEntry(vid uint16, mac net.HardwareAddr) *nosw.FlowEntry {
	//	v := int32(0x1000 | vid)
	//	v := int32(vid)
	inPort := int64(1)
	inPortMask := int64(0xffff0000)
	//	etype := int32(0x800)
	dstmac := mac.String()
	m := nosw.PolicyACLFlowMatch{
		InPort:     &inPort,
		InPortMask: &inPortMask,
		DstMac:     &dstmac,
		//		EtherType: &etype,
		//		VlanId:    &v,
	}
	p := nosw.PolicyACLFlowEntry{
		Match:        &m,
		OutputPort:   0xfffffffd,
		ClearActions: true,
	}
	d := nosw.FlowData{
		Policy: &p,
	}
	return &nosw.FlowEntry{
		TableId: nosw.TABLE_ID_ACL_POLICY,
		Data:    &d,
	}
}

func NewVLANFlowEntry

func NewVLANFlowEntry(vid uint16, port uint32, tagged bool) *nosw.FlowEntry

Types

type Request

type Request struct {
	Event RequestType
	Data  interface{}
	ResCh chan *Response
}

func NewAddFlowRequest

func NewAddFlowRequest(e *nosw.FlowEntry) *Request

func NewDeleteFlowRequest

func NewDeleteFlowRequest(e *nosw.FlowEntry) *Request

func NewGetFlowsRequest

func NewGetFlowsRequest(tableId nosw.TABLE_ID) *Request

func NewPacketOutRequest

func NewPacketOutRequest(port uint32, data *[]byte) *Request

type RequestType

type RequestType uint8
const (
	TOSS_PKT RequestType
	TABLE_SUPPORTED
	GET_FLOW_TABLE_INFO
	ADD_FLOW
	MOD_FLOW
	DEL_FLOW
	GET_FLOWS
	GET_FLOW_STAT
	GET_FLOW_BY_COOKIE
	DEL_FLOW_BY_COOKIE
	GET_GROUP_TABLE_INFO
	ADD_GROUP
	DEL_GROUP
	GET_GROUPS
	GET_GROUP_STAT
	ADD_BUCKET
	DEL_BUCKET
	MOD_BUCKET
	GET_BUCKETS
	GET_PORT_STATS
	CLEAR_PORT_STATS
)

type Requester

type Requester struct {
	ReqCh chan *Request
	// contains filtered or unexported fields
}

func NewRequester

func NewRequester(host string, reqCh chan *Request) (*Requester, error)

func (*Requester) AddBucket

func (r *Requester) AddBucket(bucket *nosw.GroupBucketEntry) error

func (*Requester) AddFlow

func (r *Requester) AddFlow(flow *nosw.FlowEntry) error

func (*Requester) AddGroup

func (r *Requester) AddGroup(group *nosw.GroupEntry) error

func (*Requester) AddHostRegistrationFlow

func (r *Requester) AddHostRegistrationFlow(vid uint16, ip net.IP) error

func (*Requester) AddL2FloodBucket

func (r *Requester) AddL2FloodBucket(fgid int64, gid int64, index int) error

func (*Requester) AddL2FloodFlow

func (r *Requester) AddL2FloodFlow(vid uint16) error

func (*Requester) AddL2FloodGroup

func (r *Requester) AddL2FloodGroup(vid uint16) (int64, error)

func (*Requester) AddL2Flow

func (r *Requester) AddL2Flow(vid uint16, port uint32, mac net.HardwareAddr) error

func (*Requester) AddL2InterfaceBucket

func (r *Requester) AddL2InterfaceBucket(gid int64, port uint32, pop bool) error

func (*Requester) AddL2InterfaceGroup

func (r *Requester) AddL2InterfaceGroup(vid uint16, port uint32) (int64, error)

func (*Requester) AddL3UnicastFlow

func (r *Requester) AddL3UnicastFlow(ipaddr net.IP, mask int, gid uint32) error

func (*Requester) AddL3UnicastGroup

func (r *Requester) AddL3UnicastGroup(vid uint16, port uint32, src net.HardwareAddr, dst net.HardwareAddr) (uint32, error)

func (*Requester) AddTerminationMacFlow

func (r *Requester) AddTerminationMacFlow(vid uint16, mac net.HardwareAddr) error

func (*Requester) AddVLANFlow

func (r *Requester) AddVLANFlow(vid uint16, port uint32, tagged bool) error

func (*Requester) DeleteBucket

func (r *Requester) DeleteBucket(bucket *nosw.GroupBucketEntry) error

func (*Requester) DeleteFlow

func (r *Requester) DeleteFlow(flow *nosw.FlowEntry) error

func (*Requester) DeleteGroup

func (r *Requester) DeleteGroup(group *nosw.GroupEntry) error

func (*Requester) DeleteL3UnicastFlow

func (r *Requester) DeleteL3UnicastFlow(ipaddr net.IP, mask int, gid uint32) error

func (*Requester) GetACLFlows

func (r *Requester) GetACLFlows() ([]*nosw.FlowEntry, error)

func (*Requester) GetBuckets

func (r *Requester) GetBuckets(group *nosw.GroupEntry) ([]*nosw.GroupBucketEntry, error)

func (*Requester) GetFlows

func (r *Requester) GetFlows(id nosw.TABLE_ID) ([]*nosw.FlowEntry, error)

func (*Requester) GetGroups

func (r *Requester) GetGroups() ([]*nosw.GroupEntry, error)

func (*Requester) GetL2Flows

func (r *Requester) GetL2Flows() ([]*nosw.FlowEntry, error)

func (*Requester) GetL3UnicastFlows

func (r *Requester) GetL3UnicastFlows() ([]*nosw.FlowEntry, error)

func (*Requester) GetTermMACFlows

func (r *Requester) GetTermMACFlows() ([]*nosw.FlowEntry, error)

func (*Requester) GetVLANFlows

func (r *Requester) GetVLANFlows() ([]*nosw.FlowEntry, error)

func (*Requester) PacketOut

func (r *Requester) PacketOut(port uint32, data *[]byte)

func (*Requester) Serve

func (r *Requester) Serve() error

type Response

type Response struct {
	Err  error
	Data interface{}
}

Jump to

Keyboard shortcuts

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