Documentation ¶
Index ¶
- Constants
- Variables
- type Address
- type Netctl
- type Profile
- func (p Profile) BringUp() (err error)
- func (p Profile) Down() (err error)
- func (p *Profile) PopulateFromDHCP(idx int, a *Address) (err error)
- func (p Profile) SetAddress(a Address) (err error)
- func (p Profile) SetGateway(a Address) (err error)
- func (p Profile) Up() (err error)
- func (p Profile) UpLoopback() (err error)
Constants ¶
const DefaultPath = "/etc/vinyl/network.d"
DefautPath is the directory in which we look for profiles, should one not be specified
Variables ¶
var ( // ResolvFile is the location of dns resolver config ResolvFile = "/etc/resolv.conf" // Verbose allows us to log calls, operations Verbose = false )
Functions ¶
This section is empty.
Types ¶
type Address ¶
type Address struct { Address string `toml:"address,omitempty"` AddressParsed net.IP `toml:"-"` Netmask string `toml:"netmask,omitempty"` NetmaskParsed net.IPMask `toml:"-"` Gateway string `toml:"gateway,omitempty"` GatewayParsed net.IP `toml:"-"` // Enable needs to be true in order to configure Enable bool `toml:"enable,omitempty"` // DHCP true means Address/ Netmask/ Gateway can be ignored // (if set, they're ignored anyway) DHCP bool `toml:"dhcp,omitempty"` }
Address holds the configuration necessary for setting an interface's IP address, including both manual and dhcp settings
type Netctl ¶
type Netctl struct {
Profiles []Profile
}
Netctl provides access to the files at /etc/vinyl/network which govern network connections on vinyl systems
func NewDefaults ¶
NewDefaults calls New with all of the default values
type Profile ¶
type Profile struct { Interface string `toml:"interface"` IPv4 Address `toml:",omitempty"` IPv6 Address `toml:",omitempty"` // contains filtered or unexported fields }
Profile contains configuration and data for an interface
func (*Profile) PopulateFromDHCP ¶
PopulateFromDHCP accepts an index (where 0 is IPv4, and 1 is IPv6) and a pointer to an Address. It will:
1. Bring up the interface 2. Request either an IPv4 address or an IPv6 address (from index) 3. Update address with this data 4. Take the interface back down (to allow netlink to control the iface) 5. Return
func (Profile) SetAddress ¶
SetAddress uses netlink to set the address of an interface
func (Profile) SetGateway ¶
SetGateway uses netlink to set the gateway of an interface
func (Profile) UpLoopback ¶
UpLoopback brings a loopback device up