iomodules

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: 5 Imported by: 0

README

IOModules

This folder contains the different IOModules that are implemented. Each IOModule is composed of two source files, the xxx.go file contains the datapath implementation while the xxxAPI.go contains the management functions.

IOModules API

Inside each IOModule package there is defined the Create() function that returns an instance of such module. That instance implements the functions defined in the IOModule interface (defined in iomodules.go) that can be used to perform actions over the module:

  • GetModuleId() Returns the ID assgined to the module by Hover.

  • Deploy() Loads the IOModule into the system.

  • Destroy() Unloads the IOModule. Before calling this function all the links to external interfaces and other modules should be removed.

  • AttachExternalInterface(name string) Attaches the IOModule to a given external interface.

  • DetachExternalInterface(name string) Dettaches the IOModule from a network interface.

  • AttachToIoModule(IfaceId int, name string) This function is used by a upper layer to create a link between two IOModules. The creation of the link in this case is responsability of the upper layer, the module should only configure its internal data structures.

  • DetachFromIoModule(name string) Removes the connection to another IOModule.

  • Configure(conf interface{}) Performs the configuration of the parameters of the IOModule. The data structure to be passed is defined by each IOModule.

Additional to those functions, the iomodules package defines:

  • AttachIoModules() Creates a link between the two modules and then calls the AttachToIoModule() function on each module to update its internal sctructures.

  • DetachIoModules() TBD

#How to use

IOModules can be deployed in two different ways:

  • Using IOModules APIs, and importing the correspondent package it's possible to write your own program that exploit the APIs to Deploy, Destroy, Attach, Configure an IOModule.

  • Using iovisorovnd in standalone mode it's possible to deploy a single or a chain of IOModules using a YAML configuration file.
    Please read README_STANDALONE.

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AttachIoModules

func AttachIoModules(c *hover.Client,
	m1 IoModule, ifaceName1 string, m2 IoModule, ifaceName2 string) (err error)

this function attaches to modules together. It performs the reques to hover and then it calls the AttachToIoModule of each module to register the interface

func IpToHex

func IpToHex(ip net.IP) string

func IpToHexBigEndian

func IpToHexBigEndian(ip net.IP) string

func MacToHexadecimalString

func MacToHexadecimalString(mac net.HardwareAddr) string

func MacToHexadecimalStringBigEndian

func MacToHexadecimalStringBigEndian(mac net.HardwareAddr) string

func NetmaskToHexBigEndian

func NetmaskToHexBigEndian(netmask net.IPMask) string

func ParseIPv4Mask

func ParseIPv4Mask(s string) net.IPMask

Types

type IoModule

type IoModule interface {
	GetModuleId() string
	Deploy() (err error)
	Destroy() (err error)
	AttachExternalInterface(name string) (err error)
	DetachExternalInterface(name string) (err error)
	AttachToIoModule(IfaceId int, name string) (err error)
	DetachFromIoModule(name string) (err error)
	Configure(conf interface{}) (err error)
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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