netboot

package
v0.0.0-...-430ae03 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2018 License: BSD-3-Clause Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ConfigureInterface

func ConfigureInterface(ifname string, netconf *NetConf) error

ConfigureInterface configures a network interface with the configuration held by a NetConf structure

func IfUp

func IfUp(ifname string, timeout time.Duration) (netlink.Link, error)

IfUp brings up an interface by name, and waits for it to come up until a timeout expires

func RequestNetbootv6

func RequestNetbootv6(ifname string, timeout time.Duration, retries int, modifiers ...dhcpv6.Modifier) ([]dhcpv6.DHCPv6, error)

RequestNetbootv6 sends a netboot request via DHCPv6 and returns the exchanged packets. Additional modifiers can be passed to manipulate both solicit and advertise packets.

Types

type AddrConf

type AddrConf struct {
	IPNet             net.IPNet
	PreferredLifetime int
	ValidLifetime     int
}

AddrConf holds a single IP address configuration for a NIC

type NetConf

type NetConf struct {
	Addresses     []AddrConf
	DNSServers    []net.IP
	DNSSearchList []string
}

NetConf holds multiple IP configuration for a NIC, and DNS configuration

func ConversationToNetconf

func ConversationToNetconf(conversation []dhcpv6.DHCPv6) (*NetConf, string, error)

ConversationToNetconf extracts network configuration and boot file URL from a DHCPv6 4-way conversation and returns them, or an error if any.

func GetNetConfFromPacketv6

func GetNetConfFromPacketv6(d *dhcpv6.DHCPv6Message) (*NetConf, error)

GetNetConfFromPacketv6 extracts network configuration information from a DHCPv6 Reply packet and returns a populated NetConf structure

Jump to

Keyboard shortcuts

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