Documentation ¶
Index ¶
- Constants
- Variables
- func ExeclineDefine(param, value string) string
- func ExeclineExport(param, value string) string
- func ExeclineImportas(name string, strict bool, def string) string
- func ExeclineXDGConfig() string
- func ExeclineXDGEnvdirConfig(name S6SvcName) string
- func NNDLibExec(name string) string
- func NetdevIPAddrVer(IP netip.Addr) int
- func NetdevIsDummy(s S6SvcName) (r bool)
- func NetdevOnlyMAC(x net.HardwareAddr, _ error) net.HardwareAddr
- func S6Pipe(src, dst *S6Svc)
- type DHCP_IP
- type IfMap
- type Iface
- func (i *Iface) NetdevIfaceAddAddr(addr string) (err error)
- func (i *Iface) NetdevIfaceAddRoute(def bool, route, r_type, via string, vrf *Iface, table *RouteTable, ...) (err error)
- func (i *Iface) NetdevIfaceEnslave(s ...*Iface)
- func (i *Iface) NetdevIfaceMAC(mac string) (err error)
- func (i *Iface) NetdevIfaceProperty(key, value, def string)
- func (i *Iface) NetdevIfaceSysctl(ipv int, key, value, def string)
- type Metric
- type NetdevIfType
- type Property
- type Route
- type RouteTable
- type S6Svc
- type S6SvcName
- type S6SvcTree
- func (t *S6SvcTree) ConfigureServices(i Iface) (r []*S6Svc)
- func (t *S6SvcTree) CreateIfaceService(iface string) *S6Svc
- func (t *S6SvcTree) LinkIfaceService(iface string) *S6Svc
- func (t *S6SvcTree) NetdevConfigureIfaceMAC(iface Iface, addr net.HardwareAddr) *S6Svc
- func (t *S6SvcTree) NetdevDependBundleStage(iface, stage string, svcs ...*S6Svc) *S6Svc
- func (t *S6SvcTree) NetdevEnslaveInterface(iface, master string) *S6Svc
- func (t *S6SvcTree) NetdevIfaceAddr(iface Iface, addr netip.Prefix) *S6Svc
- func (t *S6SvcTree) NetdevIfaceCreate(iface Iface, iftype *NetdevIfType) *S6Svc
- func (t *S6SvcTree) NetdevIfaceDHCP(iface Iface, ipv int) *S6Svc
- func (t *S6SvcTree) NetdevIfaceIpSysctl(iface Iface, ipv int, p Property) *S6Svc
- func (t *S6SvcTree) NetdevIfaceProp(iface Iface, p Property) *S6Svc
- func (t *S6SvcTree) NetdevRoute(iface Iface, route Route) *S6Svc
- func (t *S6SvcTree) NetdevWireguardConfig(iface Iface) *S6Svc
- func (t *S6SvcTree) ReadyServices(i Iface) (r []*S6Svc)
- func (t *S6SvcTree) S6AddSvc(s *S6Svc)
- func (t *S6SvcTree) S6CommitService(s *S6Svc) (err error)
- func (t *S6SvcTree) S6GetSvc(name S6SvcName) *S6Svc
- func (t *S6SvcTree) S6New(name S6SvcName, svc_type S6SvcType) *S6Svc
- func (t *S6SvcTree) S6Services() (r []*S6Svc)
- func (t *S6SvcTree) Services(i Iface) (r []*S6Svc)
- type S6SvcType
- type Sysctl_IP
- type VLAN
Constants ¶
View Source
const (
NETDEV_EXECLINE_HEADER = "#!/bin/execlineb -P"
)
Variables ¶
View Source
var NetdevIfTypes = struct { Phys, Loopback, Bridge, Vlan, Wireguard, Bond, Vrf NetdevIfType }{ Phys: NetdevIfType{"", []S6SvcName{"bundle.hw-coldplug"}}, Loopback: NetdevIfType{"loopback", []S6SvcName{}}, Bridge: NetdevIfType{"bridge", []S6SvcName{"module.bridge"}}, Vlan: NetdevIfType{"vlan", []S6SvcName{"module.8021q"}}, Wireguard: NetdevIfType{"wireguard", []S6SvcName{"module.wireguard"}}, Bond: NetdevIfType{"bond", []S6SvcName{"module.bonding"}}, Vrf: NetdevIfType{"vrf", []S6SvcName{"module.vrf"}}, }
View Source
var S6SvcTypes = struct { Oneshot, Longrun, Bundle string }{ Oneshot: "oneshot", Longrun: "longrun", Bundle: "bundle", }
Functions ¶
func ExeclineDefine ¶
func ExeclineExport ¶
func ExeclineXDGConfig ¶
func ExeclineXDGConfig() string
func ExeclineXDGEnvdirConfig ¶
func NNDLibExec ¶
func NetdevIPAddrVer ¶
func NetdevIsDummy ¶
func NetdevOnlyMAC ¶
func NetdevOnlyMAC(x net.HardwareAddr, _ error) net.HardwareAddr
Types ¶
type Iface ¶
type Iface struct { Name string // Interface name Type *NetdevIfType // Type of interface Slaves []*Iface // Slaves for VRFs, Bridges and Bonds etc... VlanId VLAN // VLAN id for VLAN interfaces Parent *Iface // Parent interface for VLAN interfaces Table RouteTable // Routing table, for VRF MACAddr net.HardwareAddr // MAC address of interface (only valid for physical, bridges and VLAN) Addresses []netip.Prefix // Addresses to be assigned to interface Routes []Route // Routes to be assigned to interface DHCP DHCP_IP // Should we start dhcp on this interface? Properties []Property // List of properties of the interface, valid for many Sysctls Sysctl_IP // Sysctls associated with this interface }
func (*Iface) NetdevIfaceAddAddr ¶
func (*Iface) NetdevIfaceAddRoute ¶
func (*Iface) NetdevIfaceEnslave ¶
func (*Iface) NetdevIfaceMAC ¶
func (*Iface) NetdevIfaceProperty ¶
func (*Iface) NetdevIfaceSysctl ¶
type NetdevIfType ¶
type NetdevIfType struct {
// contains filtered or unexported fields
}
type Route ¶
type Route struct { Default bool // VRF would be a field but it can be derived from parent Type string // unicast default, can be others IPver int // if 0, will guess based on Net Net netip.Prefix Via netip.Addr Vrf *Iface Table *RouteTable Metric Metric // Should be explicitly initialised to 1024 }
type RouteTable ¶
type RouteTable uint16
type S6Svc ¶
type S6Svc struct { Name S6SvcName Type S6SvcType Children []*S6Svc // Either dependencies or contents depending on type ProducerFor, ConsumerFor *S6Svc NotifFd int FlagEssential bool Up, Down, Run string // contains filtered or unexported fields }
func (*S6Svc) S6Children ¶
type S6SvcTree ¶
type S6SvcTree struct {
// contains filtered or unexported fields
}
func (*S6SvcTree) ConfigureServices ¶
func (*S6SvcTree) CreateIfaceService ¶
func (*S6SvcTree) LinkIfaceService ¶
func (*S6SvcTree) NetdevConfigureIfaceMAC ¶
func (t *S6SvcTree) NetdevConfigureIfaceMAC(iface Iface, addr net.HardwareAddr) *S6Svc
func (*S6SvcTree) NetdevDependBundleStage ¶
func (*S6SvcTree) NetdevEnslaveInterface ¶
func (*S6SvcTree) NetdevIfaceAddr ¶
func (*S6SvcTree) NetdevIfaceCreate ¶
func (t *S6SvcTree) NetdevIfaceCreate(iface Iface, iftype *NetdevIfType) *S6Svc
func (*S6SvcTree) NetdevIfaceDHCP ¶
func (*S6SvcTree) NetdevIfaceIpSysctl ¶
func (*S6SvcTree) NetdevIfaceProp ¶
func (*S6SvcTree) NetdevWireguardConfig ¶
func (*S6SvcTree) ReadyServices ¶
func (*S6SvcTree) S6CommitService ¶
func (*S6SvcTree) S6Services ¶
Click to show internal directories.
Click to hide internal directories.