Documentation ¶
Index ¶
- func ConfigureInterface(ifname string, netconf *NetConf) (err error)
- func IfUp(ifname string, timeout time.Duration) (_ *net.Interface, err error)
- func RequestNetbootv4(ifname string, timeout time.Duration, retries int, ...) ([]*dhcpv4.DHCPv4, error)
- func RequestNetbootv6(ifname string, timeout time.Duration, retries int, ...) ([]dhcpv6.DHCPv6, error)
- type AddrConf
- type NetConf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ConfigureInterface ¶
ConfigureInterface configures a network interface with the configuration held by a NetConf structure
func IfUp ¶
IfUp brings up an interface by name, and waits for it to come up until a timeout expires
func RequestNetbootv4 ¶
func RequestNetbootv4(ifname string, timeout time.Duration, retries int, modifiers ...dhcpv4.Modifier) ([]*dhcpv4.DHCPv4, error)
RequestNetbootv4 sends a netboot request via DHCPv4 and returns the exchanged packets. Additional modifiers can be passed to manipulate both the discover and offer packets.
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 NetConf ¶
type NetConf struct { Addresses []AddrConf DNSServers []net.IP DNSSearchList []string Routers []net.IP }
NetConf holds multiple IP configuration for a NIC, and DNS configuration
func ConversationToNetconf ¶
ConversationToNetconf extracts network configuration and boot file URL from a DHCPv6 4-way conversation and returns them, or an error if any.
func ConversationToNetconfv4 ¶
ConversationToNetconfv4 extracts network configuration and boot file URL from a DHCPv4 4-way conversation and returns them, or an error if any.
func GetNetConfFromPacketv4 ¶
GetNetConfFromPacketv4 extracts network configuration information from a DHCPv4 Reply packet and returns a populated NetConf structure