Documentation
¶
Index ¶
- func CreateMatchSection(m *configfile.Meta, link string) error
- func CreateNetDevNetworkFile(link string, kind string) error
- func CreateNetworkFile(link string) (*configfile.Meta, error)
- func CreateOrParseLinkFile(link string) (*configfile.Meta, error)
- func CreateOrParseNetDevFile(link string, kind string) (*configfile.Meta, string, error)
- func CreateOrParseNetworkFile(l string) (*configfile.Meta, error)
- func ParseLinkActivationPolicy(ifindex int) (string, error)
- func ParseLinkAddressState(ifindex int) (string, error)
- func ParseLinkCarrierState(ifindex int) (string, error)
- func ParseLinkDNS(ifindex int) ([]string, error)
- func ParseLinkDomains(ifindex int) ([]string, error)
- func ParseLinkIPv4AddressState(ifindex int) (string, error)
- func ParseLinkIPv6AddressState(ifindex int) (string, error)
- func ParseLinkNTP(ifindex int) ([]string, error)
- func ParseLinkNetworkFile(ifindex int) (string, error)
- func ParseLinkOnlineState(ifindex int) (string, error)
- func ParseLinkOperationalState(ifindex int) (string, error)
- func ParseLinkSetupState(ifindex int) (string, error)
- func ParseLinkString(ifindex int, key string) (string, error)
- func ParseNetworkAddressState() (string, error)
- func ParseNetworkCarrierState() (string, error)
- func ParseNetworkDNS() ([]string, error)
- func ParseNetworkDomains() ([]string, error)
- func ParseNetworkIPv4AddressState() (string, error)
- func ParseNetworkIPv6AddressState() (string, error)
- func ParseNetworkNTP() ([]string, error)
- func ParseNetworkOnlineState() (string, error)
- func ParseNetworkOperationalState() (string, error)
- func ParseNetworkRouteDomains() ([]string, error)
- func ParseNetworkState(key string) (string, error)
- func RegisterRouterNetworkd(router *mux.Router)
- func RemoveNetDev(link string, kind string) error
- func RemoveNetDevNetworkFile(link string, kind string) error
- type AddressSection
- type Bond
- type Bridge
- type DHCPv4Section
- type DHCPv4ServerSection
- type DHCPv6Section
- type IPv6PrefixSection
- type IPv6RoutePrefixSection
- type IPv6SendRASection
- type IpVLan
- type Link
- type LinkDescribe
- type LinkSection
- type LinksDescribe
- type MacVLan
- type MatchSection
- type NetDev
- func (n *NetDev) BuildKindInLinkNetworkFile() error
- func (n *NetDev) BuildKindSection(m *configfile.Meta) error
- func (n *NetDev) BuildNetDevSection(m *configfile.Meta) error
- func (n *NetDev) ConfigureNetDev(ctx context.Context, w http.ResponseWriter) error
- func (n *NetDev) RemoveNetDev(ctx context.Context, w http.ResponseWriter) error
- type Network
- type NetworkDescribe
- type NetworkSection
- type RouteSection
- type RoutingPolicyRuleSection
- type SDConnection
- type VLan
- type VxLan
- type WireGuard
- type WireGuardPeer
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CreateMatchSection ¶
func CreateMatchSection(m *configfile.Meta, link string) error
func CreateNetDevNetworkFile ¶
func CreateNetworkFile ¶
func CreateNetworkFile(link string) (*configfile.Meta, error)
func CreateOrParseLinkFile ¶
func CreateOrParseLinkFile(link string) (*configfile.Meta, error)
func CreateOrParseNetDevFile ¶
func CreateOrParseNetworkFile ¶
func CreateOrParseNetworkFile(l string) (*configfile.Meta, error)
func ParseLinkAddressState ¶
func ParseLinkCarrierState ¶
func ParseLinkDNS ¶
func ParseLinkDomains ¶
func ParseLinkNTP ¶
func ParseLinkNetworkFile ¶
func ParseLinkOnlineState ¶
func ParseLinkSetupState ¶
func ParseNetworkDNS ¶
func ParseNetworkDomains ¶
func ParseNetworkNTP ¶
func ParseNetworkOnlineState ¶
func ParseNetworkState ¶
func RegisterRouterNetworkd ¶
func RemoveNetDev ¶
func RemoveNetDevNetworkFile ¶
Types ¶
type AddressSection ¶
type Bond ¶
type Bond struct {
Mode string `json:"Mode"`
TransmitHashPolicy string `json:"TransmitHashPolicy"`
LACPTransmitRate string `json:"LACPTransmitRate"`
MIIMonitorSec string `json:"MIIMonitorSec"`
UpDelaySec int `json:"UpDelaySec"`
DownDelaySec int `json:"DownDelaySec"`
LearnPacketIntervalSec int `json:"LearnPacketIntervalSec"`
AdSelect string `json:"AdSelect"`
AdActorSystemPriority int `json:"AdActorSystemPriority"`
AdUserPortKey int `json:"AdUserPortKey"`
AdActorSystem string `json:"AdActorSystem"`
FailOverMACPolicy string `json:"FailOverMACPolicy"`
ARPValidate string `json:"ARPValidate"`
ARPIntervalSec int `json:"ARPIntervalSec"`
ARPIPTargets string `json:"ARPIPTargets"`
ARPAllTargets string `json:"ARPAllTargets"`
PrimaryReselectPolicy string `json:"PrimaryReselectPolicy"`
ResendIGMP int `json:"ResendIGMP"`
PacketsPerSlave int `json:"PacketsPerSlave"`
GratuitousARP int `json:"GratuitousARP"`
AllSlavesActive bool `json:"AllSlavesActive"`
DynamicTransmitLoadBalancing bool `json:"DynamicTransmitLoadBalancing"`
MinLinks int `json:"MinLinks"`
}
type Bridge ¶
type Bridge struct {
HelloTimeSec string `json:"HelloTimeSec"`
MaxAgeSec string `json:"MaxAgeSec"`
ForwardDelaySec string `json:"ForwardDelaySec"`
AgeingTimeSec string `json:"AgeingTimeSec"`
Priority int `json:"Priority"`
GroupForwardMask int `json:"GroupForwardMask"`
DefaultPVID int `json:"DefaultPVID"`
MulticastQuerier bool `json:"MulticastQuerier"`
MulticastSnooping bool `json:"MulticastSnooping"`
VLANFiltering bool `json:"VLANFiltering"`
VLANProtocol string `json:"VLANProtocol"`
STP string `json:"STP"`
MulticastIGMPVersion int `json:"MulticastIGMPVersion"`
}
type DHCPv4Section ¶
type DHCPv4Section struct {
ClientIdentifier string `json:"ClientIdentifier"`
VendorClassIdentifier string `json:"VendorClassIdentifier"`
DUIDType string `json:"DUIDType"`
DUIDRawData string `json:"DUIDRawData"`
IAID string `json:"IAID"`
RequestOptions []string `json:"RequestOptions"`
SendOption string `json:"SendOption"`
UseDNS string `json:"UseDNS"`
UseNTP string `json:"UseNTP"`
UseSIP string `json:"UseSIP"`
UseMTU string `json:"UseMTU"`
UseHostname string `json:"UseHostname"`
UseDomains string `json:"UseDomains"`
UseRoutes string `json:"UseRoutes"`
UseGateway string `json:"UseGateway"`
UseTimezone string `json:"UseTimezone"`
}
type DHCPv4ServerSection ¶
type DHCPv4ServerSection struct {
PoolOffset string `json:"PoolOffset"`
PoolSize string `json:"PoolSize"`
DefaultLeaseTimeSec string `json:"DefaultLeaseTimeSec"`
MaxLeaseTimeSec string `json:"MaxLeaseTimeSec"`
DNS []string `json:"DNS"`
EmitDNS string `json:"EmitDNS"`
EmitNTP string `json:"EmitNTP"`
EmitRouter string `json:"EmitRouter"`
}
type DHCPv6Section ¶
type DHCPv6Section struct {
MUDURL string `json:"MUDURL"`
IAID string `json:"IAID"`
DUIDType string `json:"DUIDType"`
DUIDRawData string `json:"DUIDRawData"`
RequestOptions []string `json:"RequestOptions"`
SendOption string `json:"SendOption"`
SendVendorOption string `json:"SendVendorOption"`
UserClass []string `json:"UserClass"`
VendorClass []string `json:"VendorClass"`
PrefixDelegationHint string `json:"PrefixDelegationHint"`
UseAddress string `json:"UseAddress"`
UseDelegatedPrefix string `json:"UseDelegatedPrefix"`
UseDNS string `json:"UseDNS"`
UseNTP string `json:"UseNTP"`
UseHostname string `json:"UseHostname"`
UseDomains string `json:"UseDomains"`
WithoutRA string `json:"WithoutRA"`
}
type IPv6PrefixSection ¶
type IPv6RoutePrefixSection ¶
type IPv6SendRASection ¶
type Link ¶
type Link struct {
Link string `json:"Link"`
MatchSection MatchSection `json:"MatchSection"`
// [Link]
Description string `json:"Description"`
Alias string `json:"Alias"`
MACAddressPolicy string `json:"MACAddressPolicy"`
MACAddress string `json:"MACAddress"`
NamePolicy []string `json:"NamePolicy"`
Name string `json:"Name"`
AlternativeNamesPolicy []string `json:"AlternativeNamesPolicy"`
AlternativeName string `json:"AlternativeName"`
TransmitQueues uint `json:"TransmitQueues"`
ReceiveQueues uint `json:"ReceiveQueues"`
TransmitQueueLength uint `json:"TransmitQueueLength"`
MTUBytes string `json:"MTUBytes"`
BitsPerSecond string `json:"BitsPerSecond"`
Duplex string `json:"Duplex"`
AutoNegotiation string `json:"AutoNegotiation"`
WakeOnLan []string `json:"WakeOnLan"`
WakeOnLanPassword string `json:"WakeOnLanPassword"`
Port string `json:"Port"`
Advertise []string `json:"Advertise"`
ReceiveChecksumOffload string `json:"ReceiveChecksumOffload"`
TransmitChecksumOffload string `json:"TransmitChecksumOffload"`
TCPSegmentationOffload string `json:"TCPSegmentationOffload"`
TCP6SegmentationOffload string `json:"TCP6SegmentationOffload"`
GenericSegmentationOffload string `json:"GenericSegmentationOffload"`
GenericReceiveOffload string `json:"GenericReceiveOffload"`
GenericReceiveOffloadHardware string `json:"GenericReceiveOffloadHardware"`
LargeReceiveOffload string `json:"LargeReceiveOffload"`
ReceiveVLANCTAGHardwareAcceleration string `json:"ReceiveVLANCTAGHardwareAcceleration"`
TransmitVLANCTAGHardwareAcceleration string `json:"TransmitVLANCTAGHardwareAcceleration"`
ReceiveVLANCTAGFilter string `json:"ReceiveVLANCTAGFilter"`
TransmitVLANSTAGHardwareAcceleration string `json:"TransmitVLANSTAGHardwareAcceleration"`
NTupleFilter string `json:"NTupleFilter"`
RxChannels string `json:"RxChannels"` // range 1…4294967295 or "max
TxChannels string `json:"TxChannels"` // range 1…4294967295 or "max
OtherChannels string `json:"OtherChannels"` // range 1…4294967295 or "max
CombinedChannels string `json:"CombinedChannels"` // range 1…4294967295 or "max
RxBufferSize string `json:"RxBufferSize"` // range 1…4294967295 or "max
RxMiniBufferSize string `json:"RxMiniBufferSize"` // range 1…4294967295 or "max
RxJumboBufferSize string `json:"RxJumboBufferSize"` // range 1…4294967295 or "max
TxBufferSize string `json:"TxBufferSize"` // range 1…4294967295 or "max
RxFlowControl string `json:"RxFlowControl"`
TxFlowControl string `json:"TxFlowControl"`
AutoNegotiationFlowControl string `json:"AutoNegotiationFlowControl"`
GenericSegmentOffloadMaxBytes uint `json:"GenericSegmentOffloadMaxBytes"`
GenericSegmentOffloadMaxSegments uint `json:"GenericSegmentOffloadMaxSegments"`
UseAdaptiveRxCoalesce string `json:"UseAdaptiveRxCoalesce"`
UseAdaptiveTxCoalesce string `json:"UseAdaptiveTxCoalesce"`
RxCoalesceSec uint `json:"RxCoalesceSec"`
RxCoalesceIrqSec uint `json:"RxCoalesceIrqSec"`
RxCoalesceLowSec uint `json:"RxCoalesceLowSec"`
RxCoalesceHighSec uint `json:"RxCoalesceHighSec"`
TxCoalesceSec uint `json:"TxCoalesceSec"`
TxCoalesceIrqSec uint `json:"TxCoalesceIrqSec"`
TxCoalesceLowSec uint `json:"TxCoalesceLowSec"`
TxCoalesceHighSec uint `json:"TxCoalesceHighSec"`
RxMaxCoalescedFrames uint `json:"RxMaxCoalescedFrames"`
RxMaxCoalescedIrqFrames uint `json:"RxMaxCoalescedIrqFrames"`
RxMaxCoalescedLowFrames uint `json:"RxMaxCoalescedLowFrames"`
RxMaxCoalescedHighFrames uint `json:"RxMaxCoalescedHighFrames"`
TxMaxCoalescedFrames uint `json:"TxMaxCoalescedFrames"`
TxMaxCoalescedIrqFrames uint `json:"TxMaxCoalescedIrqFrames"`
TxMaxCoalescedLowFrames uint `json:"TxMaxCoalescedLowFrames"`
TxMaxCoalescedHighFrames uint `json:"TxMaxCoalescedHighFrames"`
CoalescePacketRateLow uint `json:"CoalescePacketRateLow"`
CoalescePacketRateHigh uint `json:"CoalescePacketRateHigh"`
CoalescePacketRateSampleIntervalSec uint `json:"CoalescePacketRateSampleIntervalSec"`
StatisticsBlockCoalesceSec uint `json:"StatisticsBlockCoalesceSec"`
}
func (*Link) BuildLinkSection ¶
func (l *Link) BuildLinkSection(m *configfile.Meta) error
func (*Link) ConfigureLink ¶
type LinkDescribe ¶
type LinkDescribe struct {
AddressState string `json:"AddressState"`
AlternativeNames []string `json:"AlternativeNames"`
CarrierState string `json:"CarrierState"`
Driver string `json:"Driver"`
IPv4AddressState string `json:"IPv4AddressState"`
IPv6AddressState string `json:"IPv6AddressState"`
Index int `json:"Index"`
LinkFile string `json:"LinkFile"`
Model string `json:"Model"`
Name string `json:"Name"`
OnlineState string `json:"OnlineState"`
OperationalState string `json:"OperationalState"`
Path string `json:"Path"`
SetupState string `json:"SetupState"`
Type string `json:"Type"`
Vendor string `json:"Vendor"`
Manufacturer string `json:"Manufacturer"`
NetworkFile string `json:"NetworkFile,omitempty"`
}
type LinkSection ¶
type LinkSection struct {
MTUBytes string `json:"MTUBytes"`
MACAddress string `json:"MACAddress"`
ARP string `json:"ARP"`
Multicast string `json:"Multicast"`
AllMulticast string `json:"AllMulticast"`
Promiscuous string `json:"Promiscuous"`
Unmanaged string `json:"Unmanaged"`
Group string `json:"Group"`
RequiredForOnline string `json:"RequiredForOnline"`
RequiredFamilyForOnline string `json:"RequiredFamilyForOnline"`
ActivationPolicy string `json:"ActivationPolicy"`
}
type LinksDescribe ¶
type LinksDescribe struct {
Interfaces []LinkDescribe
}
func AcquireLinks ¶
func AcquireLinks(ctx context.Context) (*LinksDescribe, error)
type MatchSection ¶
type MatchSection struct {
Name string `json:"Name"`
}
type NetDev ¶
type NetDev struct {
Links []string `json:"Link"` // Master device
MatchSection MatchSection `json:"MatchSection"`
// [NetDev]
Name string `json:"Name"`
Description string `json:"Description"`
Kind string `json:"Kind"`
MTUBytes string `json:"MTUBytes"`
MACAddress string `json:"MACAddress"`
// [VLAN]
VLanSection VLan `json:"VLanSection"`
// [MACVLAN]
MacVLanSection MacVLan `json:"MacVLanSection"`
// [IPVLAN]
IpVLanSection IpVLan `json:"IpVLanSection"`
// [VXVLAN]
VxLanSection VxLan `json:"VxLanSection"`
// [BOND]
BondSection Bond `json:"BondSection"`
// [BRIDGE]
BridgeSection Bridge `json:"BridgeSection"`
// [WIREGUARD]
WireGuardSection WireGuard `json:"WireGuardSection"`
// [WIREGUARDPEER]
WireGuardPeerSection WireGuardPeer `json:"WireGuardPeerSection"`
}
func (*NetDev) BuildKindInLinkNetworkFile ¶
func (*NetDev) BuildKindSection ¶
func (n *NetDev) BuildKindSection(m *configfile.Meta) error
func (*NetDev) BuildNetDevSection ¶
func (n *NetDev) BuildNetDevSection(m *configfile.Meta) error
func (*NetDev) ConfigureNetDev ¶
func (*NetDev) RemoveNetDev ¶
type Network ¶
type Network struct {
Link string `json:"Link"`
LinkSection LinkSection `json:"LinkSection"`
MatchSection MatchSection `json:"MatchSection"`
NetworkSection NetworkSection `json:"NetworkSection"`
DHCPv4Section DHCPv4Section `json:"DHCPv4Section"`
DHCPv4ServerSection DHCPv4ServerSection `json:"DHCPv4ServerSection"`
DHCPv6Section DHCPv6Section `json:"DHCPv6Section"`
AddressSections []AddressSection `json:"AddressSections"`
RouteSections []RouteSection `json:"RouteSections"`
RoutingPolicyRuleSections []RoutingPolicyRuleSection `json:"RoutingPolicyRuleSections"`
IPv6SendRASection IPv6SendRASection `json:"IPv6SendRASection"`
IPv6PrefixSections []IPv6PrefixSection `json:"IPv6PrefixSections"`
IPv6RoutePrefixSections []IPv6RoutePrefixSection `json:"IPv6RoutePrefixSections"`
}
func (*Network) ConfigureNetwork ¶
func (*Network) RemoveNetwork ¶
type NetworkDescribe ¶
type NetworkDescribe struct {
AddressState string `json:"AddressState"`
CarrierState string `json:"CarrierState"`
OperationalState string `json:"OperationalState"`
OnlineState string `json:"OnlineState"`
IPv4AddressState string `json:"IPv4AddressState"`
IPv6AddressState string `json:"IPv6AddressState"`
DNS []string `json:"DNS"`
Domains []string `json:"Domains"`
RouteDomains []string `json:"RouteDomains"`
NTP []string `json:"NTP"`
}
func AcquireNetworkState ¶
func AcquireNetworkState(ctx context.Context) (*NetworkDescribe, error)
type NetworkSection ¶
type NetworkSection struct {
DHCP string `json:"DHCP"`
DHCPServer string `json:"DHCPServer"`
Address string `json:"Address"`
Gateway string `json:"Gateway"`
DNS []string `json:"DNS"`
Domains []string `json:"Domains"`
NTP []string `json:"NTP"`
IPv6AcceptRA string `json:"IPv6AcceptRA"`
IPv6SendRA string `json:"IPv6SendRA"`
LinkLocalAddressing string `json:"LinkLocalAddressing"`
MulticastDNS string `json:"MulticastDNS"`
VLAN string `json:"VLAN"`
}
type RouteSection ¶
type RoutingPolicyRuleSection ¶
type RoutingPolicyRuleSection struct {
TypeOfService string `json:"TypeOfService"`
From string `json:"From"`
To string `json:"To"`
FirewallMark string `json:"FirewallMark"`
Table string `json:"Table"`
Priority string `json:"Priority"`
IncomingInterface string `json:"IncomingInterface"`
OutgoingInterface string `json:"OutgoingInterface"`
SourcePort string `json:"SourcePort"`
DestinationPort string `json:"DestinationPort"`
IPProtocol string `json:"IPProtocol"`
InvertRule string `json:"InvertRule"`
Family string `json:"Family"`
User string `json:"User"`
SuppressPrefixLength string `json:"SuppressPrefixLength"`
SuppressInterfaceGroup string `json:"SuppressInterfaceGroup"`
Type string `json:"Type"`
}
type SDConnection ¶
type SDConnection struct {
// contains filtered or unexported fields
}
func NewSDConnection ¶
func NewSDConnection() (*SDConnection, error)
func (*SDConnection) Close ¶
func (c *SDConnection) Close()
func (*SDConnection) DBusLinkDescribe ¶
func (c *SDConnection) DBusLinkDescribe(ctx context.Context) (*LinksDescribe, error)
func (*SDConnection) DBusNetworkReconfigureLink ¶
func (c *SDConnection) DBusNetworkReconfigureLink(ctx context.Context, index int) error
func (*SDConnection) DBusNetworkReload ¶
func (c *SDConnection) DBusNetworkReload(ctx context.Context) error
Click to show internal directories.
Click to hide internal directories.