Documentation
¶
Overview ¶
Package vpnkit allows a running VPNKit service to be reconfigured.
Features ¶
- expose/unexpose TCP and UDP ports
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection struct {
// contains filtered or unexported fields
}
Connection represents an open control connection to vpnkit
func NewConnection ¶
func NewConnection(ctx context.Context, path string) (*Connection, error)
NewConnection connects to a vpnkit Unix domain socket on the given path and returns the connection
type DhcpRequest ¶ added in v0.2.0
type DhcpRequest struct {
MAC net.HardwareAddr
}
DhcpRequest is a simple DHCP request
func NewDhcpRequest ¶ added in v0.2.0
func NewDhcpRequest(MAC net.HardwareAddr) *DhcpRequest
NewDhcpRequest constructs a DHCP request
func (*DhcpRequest) Bytes ¶ added in v0.2.0
func (d *DhcpRequest) Bytes() []byte
Bytes returns the marshalled DHCP request
type Ethernet ¶ added in v0.2.0
type Ethernet struct {
// contains filtered or unexported fields
}
Ethernet requests the creation of a network connection with a given uuid and optional IP
func NewEthernet ¶ added in v0.2.0
NewEthernet creates an Ethernet frame
type EthernetFrame ¶ added in v0.2.0
type EthernetFrame struct {
Dst net.HardwareAddr
Src net.HardwareAddr
Type uint16
Data []byte
}
EthernetFrame is an ethernet frame
func NewEthernetFrame ¶ added in v0.2.0
func NewEthernetFrame(Dst, Src net.HardwareAddr, Type uint16) *EthernetFrame
NewEthernetFrame constructs an Ethernet frame
func ParseEthernetFrame ¶ added in v0.2.0
func ParseEthernetFrame(frame []byte) (*EthernetFrame, error)
ParseEthernetFrame parses the ethernet frame
func (*EthernetFrame) Bytes ¶ added in v0.2.0
func (e *EthernetFrame) Bytes() []byte
Bytes returns the marshalled ethernet frame
type InitMessage ¶ added in v0.2.0
type InitMessage struct {
// contains filtered or unexported fields
}
InitMessage is used for the initial version exchange
func (*InitMessage) String ¶ added in v0.2.0
func (m *InitMessage) String() string
String returns a human-readable string.
type Ipv4 ¶ added in v0.2.0
Ipv4 is an IPv4 frame
func (*Ipv4) HeaderBytes ¶ added in v0.2.0
HeaderBytes returns the marshalled form of the IPv4 header
type PcapWriter ¶ added in v0.2.0
type PcapWriter struct {
// contains filtered or unexported fields
}
PcapWriter writes pcap-formatted packet streams
func NewPcapWriter ¶ added in v0.2.0
func NewPcapWriter(w io.Writer) (*PcapWriter, error)
NewPcapWriter creates a PcapWriter and writes the initial header
func (*PcapWriter) Write ¶ added in v0.2.0
func (p *PcapWriter) Write(packet []byte) error
Write appends a packet with a pcap-format header
type Port ¶
type Port struct {
// contains filtered or unexported fields
}
Port describes a UDP or TCP port forward
func ListExposed ¶ added in v0.2.0
func ListExposed(connection *Connection) ([]*Port, error)
ListExposed returns a list of currently exposed ports
func NewPort ¶
func NewPort(connection *Connection, proto string, outIP net.IP, outPort uint16, inIP net.IP, inPort uint16) *Port
NewPort constructs an instance of Port
type Udpv4 ¶ added in v0.2.0
Udpv4 is a Udpv4 frame
func ParseUdpv4 ¶ added in v0.2.0
ParseUdpv4 parses a Udpv4 packet
type Vif ¶ added in v0.2.0
type Vif struct {
MTU uint16
MaxPacketSize uint16
ClientMAC net.HardwareAddr
IP net.IP
// contains filtered or unexported fields
}
Vif represents an Ethernet device
type Vmnet ¶ added in v0.2.0
type Vmnet struct {
// contains filtered or unexported fields
}
Vmnet describes a "vmnet protocol" connection which allows ethernet frames to be sent to and received by vpnkit.
func (*Vmnet) ConnectVif ¶ added in v0.2.0
ConnectVif returns a connected network interface with the given uuid.