Documentation ¶
Index ¶
- Variables
- func BuildRawPacket(srcAddr *net.UDPAddr, dstAddr *net.UDPAddr, payload []byte) []byte
- func ConfigureDevice(devName string)
- func CreateTUN(ifaceName string, cidr net.IP) io.ReadCloser
- func InitLogging(levelString string)
- func SendRawPacket(packet []byte) error
- type Exchange
- type ExchangeConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var Log = logging.MustGetLogger("driftd")
Functions ¶
func BuildRawPacket ¶
Constructs a raw UDP+IPv6 packet
func ConfigureDevice ¶
func ConfigureDevice(devName string)
Configures the given serial device using AT commands TODO: Implement me!
func CreateTUN ¶
func CreateTUN(ifaceName string, cidr net.IP) io.ReadCloser
Creates a named TUN device and configures the device to handle packets with the given 64-bit CIDR prefix
func InitLogging ¶
func InitLogging(levelString string)
Initializes logging facilities at the given level
func SendRawPacket ¶
Sends a raw packet encoded as a byte array to the networking stack. Note that this may be platform dependent!
Types ¶
type Exchange ¶
type Exchange struct {
// contains filtered or unexported fields
}
The Drift packet exchange performs all vital protocol functions including routing, packet encapsulation and stripping, etc.
func NewExchange ¶
func NewExchange(cfg ExchangeConfig) *Exchange
Creates a new Drift packet exchange
type ExchangeConfig ¶
type ExchangeConfig struct { // The serial device for the exchange to use // for all TX/RX operations DeviceName string // The name of the TUN interface to create InterfaceName string // The IPv6 CIDR block for routing. Note that // this should be a 64-bit prefix, as the // remaining 64 bits will be consumed by the // serial device's MAC address CIDR net.IP }
Configuration for the Drift packet exchange
Click to show internal directories.
Click to hide internal directories.