hover

package
v0.0.0-...-6b04af2 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2017 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Overview

Copyright 2017 Politecnico di Torino

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	INGRESS = 0
	EGRESS  = 1
)

Variables

This section is empty.

Functions

func ExternalInterfacePrint

func ExternalInterfacePrint(externalInterface ExternalInterface)

func ExternalInterfacesListPrint

func ExternalInterfacesListPrint(externalInterfacesList map[string]ExternalInterface)

func LinkListPrint

func LinkListPrint(linkList map[string]Link)

func LinkPrint

func LinkPrint(link Link)

func ModuleListPrint

func ModuleListPrint(moduleList map[string]Module)

func ModulePrint

func ModulePrint(module Module)

func PrintFirstNLines

func PrintFirstNLines(s string, nlines int)

func TableEntryPrint

func TableEntryPrint(tableEntry TableEntry)

func TablePrint

func TablePrint(table map[string]TableEntry)

Types

type Client

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

func NewClient

func NewClient() *Client

func (*Client) ControllerPOST

func (d *Client) ControllerPOST(addr string) error

func (*Client) ExternalInterfacesListGET

func (d *Client) ExternalInterfacesListGET() (error, map[string]ExternalInterface)

it returns map[iface-name]iface provided by hover eg. map[veth1] = iface {Name:veth1, Id:42}

func (*Client) GetController

func (d *Client) GetController() *Controller

func (*Client) Init

func (d *Client) Init(baseUrl string) error

func (*Client) LinkDELETE

func (d *Client) LinkDELETE(linkId string) (error, Link)

func (*Client) LinkGET

func (d *Client) LinkGET(linkId string) (error, Link)

func (*Client) LinkListGet

func (d *Client) LinkListGet() (error, map[string]Link)

func (*Client) LinkPOST

func (d *Client) LinkPOST(from string, to string) (error, Link)
	LinkModule(Dataplane,from,to)
  LinkModule(d,i:veth0,m:12345ab)

func (*Client) ModuleDELETE

func (d *Client) ModuleDELETE(moduleId string) (error, Module)

func (*Client) ModuleGET

func (d *Client) ModuleGET(moduleId string) (error, Module)

func (*Client) ModuleListGET

func (d *Client) ModuleListGET() (error, map[string]Module)

it returns map[module-id]module provided by hover eg. map["m:12345ab"] = module {}

func (*Client) ModulePOST

func (d *Client) ModulePOST(moduleType string, displayName string, code string) (error, Module)

ModulePOST(d, "bpf", "myModuleName", l2switch.Modulename)

func (*Client) TableEntryDELETE

func (d *Client) TableEntryDELETE(moduleId string, tableId string, entryId string) (error, TableEntry)

func (*Client) TableEntryGET

func (d *Client) TableEntryGET(moduleId string, tableId string, entryId string) (error, TableEntry)

func (*Client) TableEntryPOST

func (d *Client) TableEntryPOST(moduleId string, tableId string, entryId string, entryValue string) (error, TableEntry)

func (*Client) TableEntryPUT

func (d *Client) TableEntryPUT(moduleId string, tableId string, entryId string, entryValue string) (error, TableEntry)

func (*Client) TableGET

func (d *Client) TableGET(moduleId string, tableId string) (error, map[string]TableEntry)

func (*Client) TableListGET

func (d *Client) TableListGET(moduleId string) (error, map[string]string)

type Controller

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

func (*Controller) Init

func (c *Controller) Init(listenaddr string) (err error)

func (*Controller) RegisterCallBack

func (c *Controller) RegisterCallBack(id uint16, cb SlowPathCallBack) (err error)

func (*Controller) Run

func (c *Controller) Run() (err error)

func (*Controller) SendPacketOut

func (c *Controller) SendPacketOut(p *PacketOut) (err error)

type ExternalInterface

type ExternalInterface struct {
	Id   string `json:"id"`
	Name string `json:"name"`
}
type Link struct {
	Id     string `json:"id"`
	From   string `json:"from"`
	To     string `json:"to"`
	FromId int    `json:"from-id"`
	ToId   int    `json:"to-id"`
}

type Module

type Module struct {
	Id          string                 `json:"id"`
	ModuleType  string                 `json:"module_type"`
	DisplayName string                 `json:"display_name"`
	Perm        string                 `json:"permissions"`
	Config      map[string]interface{} `json:"config"`
}

type PacketIn

type PacketIn struct {
	Md   PacketInMd
	Data []byte
}

func (*PacketIn) ToString

func (p *PacketIn) ToString() string

type PacketInMd

type PacketInMd struct {
	Module_id  uint16
	Port_id    uint16
	Packet_len uint32
	Reason     uint16
	Metadata   [3]uint32
}

type PacketOut

type PacketOut struct {
	Module_id uint16
	Port_id   uint16
	Sense     uint16 /* ingress = 0, egress = 1 */
	Data      []byte
}

type SlowPathCallBack

type SlowPathCallBack func(*PacketIn) error

type TableEntry

type TableEntry struct {
	Key   string `json:"key"`
	Value string `json:"value"`
}

Jump to

Keyboard shortcuts

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