network

package
v0.0.0-...-568464f Latest Latest
Warning

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

Go to latest
Published: Feb 10, 2021 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func StartDHCPServers

func StartDHCPServers(guest api.Guest, dhcpIfaces []DHCPInterface, dnsServers []string, ntpServers []string) error

Types

type DHCPInterface

type DHCPInterface struct {
	VMIPNet   *net.IPNet
	GatewayIP *net.IP
	Routes    []netlink.Route
	VMTAP     string
	Bridge    string
	Hostname  string
	MACFilter string
	// contains filtered or unexported fields
}

DHCPInterface describes the NIC of container

func SetupInterfaces

func SetupInterfaces(guest *api.Guest) ([]DHCPInterface, error)

func (*DHCPInterface) ServeDHCP

func (i *DHCPInterface) ServeDHCP(p dhcp.Packet, msgType dhcp.MessageType, options dhcp.Options) dhcp.Packet

ServeDHCP responds to a DHCP request

func (*DHCPInterface) SetDNSServers

func (i *DHCPInterface) SetDNSServers(dns []string)

Parse the DNS servers for the DHCP server

func (*DHCPInterface) SetNTPServers

func (i *DHCPInterface) SetNTPServers(ntp []string)

Parse the NTP servers for the DHCP server

func (*DHCPInterface) StartBlockingServer

func (i *DHCPInterface) StartBlockingServer() error

StartBlockingServer starts a blocking DHCP server on port 67

Jump to

Keyboard shortcuts

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