Documentation ¶
Overview ¶
Package device contains the structs and logic to create, configure, and maintain virtual multi-queue network devices. Each network device type is represented by a struct adhering to the included Device interface, which describes a generic multi-queue virtual network device.
Currently supported devices:
- TUN device
Index ¶
Constants ¶
View Source
const ( // TUNDevice creates and manages a TUN based network device. TUNDevice = "tun" // MOCKDevice creates and manages a mocked out network device for testing. MOCKDevice = "mock" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Device ¶
type Device interface { // Should return the name of the virual network device. Name() string // Read should return a formatted *common.Payload, based on the provided byte slice, off the specified device queue. Read(queue int, buf []byte) (*common.Payload, bool) // Write should handle being passed a formatted *common.Payload, and write the underlying raw data to the specified device queue. Write(queue int, payload *common.Payload) bool // Close should gracefully destroy the virtual network device. Close() error // Queues should return all underlying queue file descriptors to pass along during a rolling restart. Queues() []int }
Device interface for a generic multi-queue network device.
type Mock ¶
type Mock struct { }
Mock device struct to use for testing.
type Tun ¶
type Tun struct {
// contains filtered or unexported fields
}
Tun device struct for managing a multi-queue TUN networking device.
Click to show internal directories.
Click to hide internal directories.