tap

package
v0.0.0-...-3a69abc Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2017 License: MIT Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EngineStart

func EngineStart()

EngineStart triggers the init function in the package tap

func PcapReaderLoop

func PcapReaderLoop()

func SetIpAddress

func SetIpAddress()

Types

type TapConn

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

func (*TapConn) Close

func (tap_conn *TapConn) Close()

func (*TapConn) Open

func (tap_conn *TapConn) Open(mtu uint, name string) (err error)

func (*TapConn) Read

func (tap_conn *TapConn) Read(b []byte) (n int, err error)

func (*TapConn) Write

func (tap_conn *TapConn) Write(b []byte) (n int, err error)

type Vswitchdevice

type Vswitchdevice struct {
	Realif *TapConn // this is a pointed to the syscall tap RAW connection
	// contains filtered or unexported fields
}

Vswitchdevice describes the new TAP device to be created.

var VDev Vswitchdevice

This will represent the tap device when exported.

func (*Vswitchdevice) GetTapMac

func (vd *Vswitchdevice) GetTapMac() string

GetTapMac returns mac address of the device we created

func (*Vswitchdevice) ReadFrameThread

func (vd *Vswitchdevice) ReadFrameThread()

ReadFrameThread the thread which reads the frames from tap device. creates a TAP device with name specified as argument just do ; sudo ip addr add 10.1.0.10/24 dev <tapname> sudo ip link set dev <tapname> up ping -c1 -b 10.1.0.255

func (*Vswitchdevice) SetDeviceConf

func (vd *Vswitchdevice) SetDeviceConf()

SetDeviceConf pupulates the switch with configuration taken from the config file.

func (*Vswitchdevice) WriteFrameThread

func (vd *Vswitchdevice) WriteFrameThread()

WriteFrameThread writes a frame into the tap device.

Jump to

Keyboard shortcuts

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