Documentation ¶
Index ¶
- Constants
- func GetIP(version int, netcidr string, uid uint32) (net.IP, net.IPMask, error)
- func IsNotUnicast(mac_in MacAddress) bool
- func Mac2charForm(m []byte) byte
- type Device
- func CreateDummyTAP() (tapdev Device, err error)
- func CreateFdTAP(iconfig mtypes.InterfaceConf, NodeID mtypes.Vertex) (tapdev Device, err error)
- func CreateSockTAP(iconfig mtypes.InterfaceConf, protocol string, NodeID mtypes.Vertex, ...) (tapdev Device, err error)
- func CreateStdIOTAP(iconfig mtypes.InterfaceConf, NodeID mtypes.Vertex) (tapdev Device, err error)
- func CreateTAP(iconfig mtypes.InterfaceConf, NodeID mtypes.Vertex) (Device, error)
- func CreateTAPFromFile(file *os.File, iconfig mtypes.InterfaceConf, NodeID mtypes.Vertex) (Device, error)
- func CreateUDPSockTAP(iconfig mtypes.InterfaceConf, NodeID mtypes.Vertex) (tapdev Device, err error)
- func CreateUnmonitoredTUNFromFD(fd int) (Device, string, error)
- func CreateVppTAP(iconfig mtypes.InterfaceConf, NodeID mtypes.Vertex, loglevel string) (tapdev Device, err error)
- type DummyTap
- func (tap *DummyTap) Close() error
- func (tap *DummyTap) Events() chan Event
- func (tap *DummyTap) Flush() error
- func (tap *DummyTap) MTU() (int, error)
- func (tap *DummyTap) Name() (string, error)
- func (tap *DummyTap) Read([]byte, int) (int, error)
- func (tap *DummyTap) Write(packet []byte, size int) (int, error)
- type Event
- type FdTap
- func (tap *FdTap) Close() error
- func (tap *FdTap) Events() chan Event
- func (tap *FdTap) Flush() error
- func (tap *FdTap) MTU() (int, error)
- func (tap *FdTap) Name() (string, error)
- func (tap *FdTap) Read(buf []byte, offset int) (int, error)
- func (tap *FdTap) Write(buf []byte, offset int) (size int, err error)
- type L2MODE
- type MacAddress
- type NativeTap
- func (tap *NativeTap) Close() error
- func (tap *NativeTap) Events() chan Event
- func (tap *NativeTap) File() *os.File
- func (tap *NativeTap) Flush() error
- func (tap *NativeTap) MTU() (int, error)
- func (tap *NativeTap) Name() (string, error)
- func (tap *NativeTap) Read(buf []byte, offset int) (n int, err error)
- func (tap *NativeTap) Write(buf []byte, offset int) (int, error)
- type SockServerTap
- func (tap *SockServerTap) Close() error
- func (tap *SockServerTap) Events() chan Event
- func (tap *SockServerTap) Flush() error
- func (tap *SockServerTap) MTU() (int, error)
- func (tap *SockServerTap) Name() (string, error)
- func (tap *SockServerTap) Read(buf []byte, offset int) (size int, err error)
- func (tap *SockServerTap) RoutineAcceptConnection()
- func (tap *SockServerTap) Write(buf []byte, offset int) (size int, err error)
- type StdIOTap
- func (tap *StdIOTap) Close() error
- func (tap *StdIOTap) Events() chan Event
- func (tap *StdIOTap) Flush() error
- func (tap *StdIOTap) MTU() (int, error)
- func (tap *StdIOTap) Name() (string, error)
- func (tap *StdIOTap) Read(buf []byte, offset int) (int, error)
- func (tap *StdIOTap) Write(buf []byte, offset int) (size int, err error)
- type UdpSockTap
- func (tap *UdpSockTap) Close() error
- func (tap *UdpSockTap) Events() chan Event
- func (tap *UdpSockTap) Flush() error
- func (tap *UdpSockTap) MTU() (int, error)
- func (tap *UdpSockTap) Name() (string, error)
- func (tap *UdpSockTap) Read(buf []byte, offset int) (int, error)
- func (tap *UdpSockTap) Write(buf []byte, offset int) (size int, err error)
- type VppTap
Constants ¶
View Source
const ( EventUp = 1 << iota EventDown EventMTUUpdate )
View Source
const (
VPP_SUPPORT = "VPP support disabled"
)
Variables ¶
This section is empty.
Functions ¶
func IsNotUnicast ¶
func IsNotUnicast(mac_in MacAddress) bool
func Mac2charForm ¶
Types ¶
type Device ¶
type Device interface { Read([]byte, int) (int, error) // read a packet from the device (without any additional headers) Write([]byte, int) (int, error) // writes a packet to the device (without any additional headers) Flush() error // flush all previous writes to the device MTU() (int, error) // returns the MTU of the device Name() (string, error) // fetches and returns the current name Events() chan Event // returns a constant channel of events related to the device Close() error // stops the device and closes the event channel }
func CreateDummyTAP ¶
New creates and returns a new TUN interface for the application.
func CreateFdTAP ¶
New creates and returns a new TUN interface for the application.
func CreateSockTAP ¶
func CreateSockTAP(iconfig mtypes.InterfaceConf, protocol string, NodeID mtypes.Vertex, loglevel mtypes.LoggerInfo) (tapdev Device, err error)
New creates and returns a new TUN interface for the application.
func CreateStdIOTAP ¶
New creates and returns a new TUN interface for the application.
func CreateTAPFromFile ¶
func CreateUDPSockTAP ¶
func CreateUDPSockTAP(iconfig mtypes.InterfaceConf, NodeID mtypes.Vertex) (tapdev Device, err error)
New creates and returns a new TUN interface for the application.
func CreateVppTAP ¶
func CreateVppTAP(iconfig mtypes.InterfaceConf, NodeID mtypes.Vertex, loglevel string) (tapdev Device, err error)
New creates and returns a new TUN interface for the application.
type MacAddress ¶
type MacAddress [6]byte
func Charform2mac ¶
func Charform2mac(b byte) MacAddress
func GetDstMacAddr ¶
func GetDstMacAddr(packet []byte) (dstMacAddr MacAddress)
func GetMacAddr ¶
func GetMacAddr(prefix string, uid uint32) (mac MacAddress, err error)
func GetSrcMacAddr ¶
func GetSrcMacAddr(packet []byte) (srcMacAddr MacAddress)
func (*MacAddress) String ¶
func (mac *MacAddress) String() string
type SockServerTap ¶
type SockServerTap struct {
// contains filtered or unexported fields
}
func (*SockServerTap) Close ¶
func (tap *SockServerTap) Close() error
func (*SockServerTap) Events ¶
func (tap *SockServerTap) Events() chan Event
func (*SockServerTap) Flush ¶
func (tap *SockServerTap) Flush() error
func (*SockServerTap) MTU ¶
func (tap *SockServerTap) MTU() (int, error)
func (*SockServerTap) Name ¶
func (tap *SockServerTap) Name() (string, error)
func (*SockServerTap) Read ¶
func (tap *SockServerTap) Read(buf []byte, offset int) (size int, err error)
func (*SockServerTap) RoutineAcceptConnection ¶
func (tap *SockServerTap) RoutineAcceptConnection()
type UdpSockTap ¶
type UdpSockTap struct {
// contains filtered or unexported fields
}
func (*UdpSockTap) Close ¶
func (tap *UdpSockTap) Close() error
func (*UdpSockTap) Events ¶
func (tap *UdpSockTap) Events() chan Event
func (*UdpSockTap) Flush ¶
func (tap *UdpSockTap) Flush() error
func (*UdpSockTap) MTU ¶
func (tap *UdpSockTap) MTU() (int, error)
func (*UdpSockTap) Name ¶
func (tap *UdpSockTap) Name() (string, error)
Click to show internal directories.
Click to hide internal directories.