hostdhcp

package
v0.3.10-0-alpha2 Latest Latest
Warning

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

Go to latest
Published: Dec 15, 2022 License: Apache-2.0 Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const DEFAULT_DHCP_CLIENT_PORT = 68
View Source
const DEFAULT_DHCP_RELAY_PORT = 68

Variables

This section is empty.

Functions

func GetMainNic

func GetMainNic(nics []*desc.SGuestNetwork) (*desc.SGuestNetwork, error)

Types

type SDHCPRelay

type SDHCPRelay struct {
	OnRecv recvFunc
	// contains filtered or unexported fields
}

func NewDHCPRelay

func NewDHCPRelay(guestDHCPConn *dhcp.Conn, addrs []string) (*SDHCPRelay, error)

func (*SDHCPRelay) Relay

func (r *SDHCPRelay) Relay(pkt dhcp.Packet, addr *net.UDPAddr, intf *net.Interface) (dhcp.Packet, error)

func (*SDHCPRelay) ServeDHCP

func (r *SDHCPRelay) ServeDHCP(pkt dhcp.Packet, addr *net.UDPAddr, intf *net.Interface) (dhcp.Packet, []string, error)

func (*SDHCPRelay) Setup

func (r *SDHCPRelay) Setup(addr string) error

type SGuestDHCPServer

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

func NewGuestDHCPServer

func NewGuestDHCPServer(iface string, port int, relay []string) (*SGuestDHCPServer, error)

func (*SGuestDHCPServer) IsDhcpPacket

func (s *SGuestDHCPServer) IsDhcpPacket(pkt dhcp.Packet) bool

func (*SGuestDHCPServer) RelaySetup

func (s *SGuestDHCPServer) RelaySetup(addr string) error

func (*SGuestDHCPServer) ServeDHCP

func (s *SGuestDHCPServer) ServeDHCP(pkt dhcp.Packet, addr *net.UDPAddr, intf *net.Interface) (dhcp.Packet, []string, error)

func (*SGuestDHCPServer) Start

func (s *SGuestDHCPServer) Start(blocking bool)

type SRelayCache

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

Jump to

Keyboard shortcuts

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