Documentation
¶
Index ¶
- Constants
- func RegisterItems(registry *reconciler.DefaultRegistry, macLookup *maclookup.MacLookup) error
- type Bond
- type BondConfigurator
- func (c *BondConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *BondConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *BondConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *BondConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type Bridge
- type BridgeConfigurator
- func (c *BridgeConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *BridgeConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *BridgeConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *BridgeConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type DhcpClient
- type DhcpClientConfigurator
- func (c *DhcpClientConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *DhcpClientConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *DhcpClientConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *DhcpClientConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type DhcpServer
- type DhcpServerConfigurator
- func (c *DhcpServerConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *DhcpServerConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *DhcpServerConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *DhcpServerConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type DnsEntry
- type DnsServer
- type DnsServerConfigurator
- func (c *DnsServerConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *DnsServerConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *DnsServerConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *DnsServerConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type HttpProxy
- type HttpProxyConfigurator
- func (c *HttpProxyConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *HttpProxyConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *HttpProxyConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *HttpProxyConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type HttpServer
- type HttpServerConfigurator
- func (c *HttpServerConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *HttpServerConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *HttpServerConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *HttpServerConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type IPRange
- type IPRule
- type IPRuleConfigurator
- func (c *IPRuleConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *IPRuleConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *IPRuleConfigurator) Modify(_ context.Context, _, _ depgraph.Item) (err error)
- func (c *IPRuleConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type IfHandle
- type IfHandleConfigurator
- func (c *IfHandleConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *IfHandleConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *IfHandleConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *IfHandleConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type IfUsage
- type IptablesChain
- func (ch IptablesChain) Dependencies() (deps []depgraph.Dependency)
- func (ch IptablesChain) Equal(other depgraph.Item) bool
- func (ch IptablesChain) External() bool
- func (ch IptablesChain) Label() string
- func (ch IptablesChain) Name() string
- func (ch IptablesChain) String() string
- func (ch IptablesChain) Type() string
- type IptablesChainConfigurator
- func (c *IptablesChainConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *IptablesChainConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *IptablesChainConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *IptablesChainConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type IptablesRule
- type MACToIP
- type MasterBridge
- type NetNamespace
- func (n NetNamespace) Dependencies() (deps []depgraph.Dependency)
- func (n NetNamespace) Equal(other depgraph.Item) bool
- func (n NetNamespace) External() bool
- func (n NetNamespace) Label() string
- func (n NetNamespace) Name() string
- func (n NetNamespace) String() string
- func (n NetNamespace) Type() string
- type NetNamespaceConfigurator
- func (c *NetNamespaceConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *NetNamespaceConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *NetNamespaceConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *NetNamespaceConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type PhysIf
- type ResolvConf
- type Route
- type RouteConfigurator
- func (c *RouteConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *RouteConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *RouteConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *RouteConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type RouteOutIf
- type Sysctl
- type SysctlConfigurator
- func (c *SysctlConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *SysctlConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *SysctlConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) error
- func (c *SysctlConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type TrafficControl
- func (t TrafficControl) Dependencies() (deps []depgraph.Dependency)
- func (t TrafficControl) Equal(other depgraph.Item) bool
- func (t TrafficControl) External() bool
- func (t TrafficControl) Label() string
- func (t TrafficControl) Name() string
- func (t TrafficControl) String() string
- func (t TrafficControl) Type() string
- type TrafficControlConfigurator
- func (c *TrafficControlConfigurator) Create(_ context.Context, item depgraph.Item) error
- func (c *TrafficControlConfigurator) Delete(_ context.Context, item depgraph.Item) error
- func (c *TrafficControlConfigurator) Modify(_ context.Context, _, _ depgraph.Item) (err error)
- func (c *TrafficControlConfigurator) NeedsRecreate(_, _ depgraph.Item) (recreate bool)
- type Veth
- type VethConfigurator
- func (c *VethConfigurator) Create(ctx context.Context, item depgraph.Item) error
- func (c *VethConfigurator) Delete(ctx context.Context, item depgraph.Item) error
- func (c *VethConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
- func (c *VethConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
- type VethPeer
Constants ¶
const ( // PhysIfTypename : typename for physical network interfaces. PhysIfTypename = "Physical-Interface" // IfHandleTypename : typename for network interface handle. IfHandleTypename = "Interface-Handle" // NetNamespaceTypename : typename for network namespaces. NetNamespaceTypename = "Network-Namespace" // BondTypename : typename for bond interface. BondTypename = "Bond" // BridgeTypename : typename for bridges. BridgeTypename = "Bridge" // BridgeTypename : typename for veths. VethTypename = "Veth" // SysctlTypename : typename for item representing kernel // parameters set using sysctl for a given net namespace. SysctlTypename = "Sysctl" // DhcpClientTypename : typename for DHCP/DHCPv6 client. DhcpClientTypename = "DHCP-Client" // DhcpServerTypename : typename for DHCP/DHCPv6 server. DhcpServerTypename = "DHCP-Server" // DnsServerTypename : typename for DNS server. DnsServerTypename = "DNS-Server" // RouteTypename : typename for IP route. RouteTypename = "Route" // IPRuleTypename : typename for IP rule. IPRuleTypename = "IP-Rule" // IPtablesChainTypename : typename for a single iptables chain (IPv4). IPtablesChainTypename = "Iptables-Chain" // IP6tablesChainTypename : typename for a single ip6tables chain (IPv6). IP6tablesChainTypename = "Ip6tables-Chain" // HTTPProxyTypename : typename for HTTP proxy. HTTPProxyTypename = "HTTP-Proxy" // HTTPServerTypename : typename for HTTP server. HTTPServerTypename = "HTTP-Server" // TrafficControlTypename : typename for TC rules applied to physical interface. TrafficControlTypename = "Traffic-Control" )
const (
// Symbolic name for the main network namespace (where SDN agent operates).
MainNsName = "main"
)
Variables ¶
This section is empty.
Functions ¶
func RegisterItems ¶
func RegisterItems( registry *reconciler.DefaultRegistry, macLookup *maclookup.MacLookup) error
RegisterItems : register all configurators implemented by this package.
Types ¶
type Bond ¶
type Bond struct { api.Bond // IfName : name of the Bond interface in the OS. IfName string // AggregatedPhysIfs : list of physical interfaces aggregated by this bond. AggregatedPhysIfs []PhysIf // MTU : Maximum transmission unit size. MTU uint16 }
Bond : Bond interface.
func (Bond) Dependencies ¶
func (b Bond) Dependencies() (deps []depgraph.Dependency)
Dependencies lists all aggregated interfaces as dependencies.
type BondConfigurator ¶
BondConfigurator implements Configurator interface for bond interfaces.
func (*BondConfigurator) Modify ¶
Modify is able to change the set of aggregated interfaces and MTU.
func (*BondConfigurator) NeedsRecreate ¶
func (c *BondConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true if Bond attributes have changed. The set of aggregated interfaces and MTU can be changed without recreating Bond.
type Bridge ¶
type Bridge struct { // IfName : name of the Bridge in the OS. IfName string // LogicalLabel : label used within the network model. LogicalLabel string // PhysIfs : physical interfaces to put under the bridge. PhysIfs []PhysIf // BondIfs : *interface names* of bonds to put under the bridge. BondIfs []string // VLANs : list of VLANs used with this bridge. // If empty then this bridge is used without VLAN filtering. VLANs []uint16 // MTU : Maximum transmission unit size. MTU uint16 // WithSTP: enable to run the Spanning Tree Protocol (STP). WithSTP bool }
Bridge : Linux bridge.
func (Bridge) Dependencies ¶
func (b Bridge) Dependencies() (deps []depgraph.Dependency)
Dependencies lists all bridged interfaces as dependencies.
type BridgeConfigurator ¶
BridgeConfigurator implements Configurator interface for bond interfaces.
func (*BridgeConfigurator) Modify ¶
func (c *BridgeConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify is able to change the set of bridged interfaces.
func (*BridgeConfigurator) NeedsRecreate ¶
func (c *BridgeConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns false. The set of bridged interfaces can be changed without recreating bridge.
type DhcpClient ¶
type DhcpClient struct { // PhysIf : physical interface to associate the client with. PhysIf PhysIf // LogFile : where to put dhcpcd logs. LogFile string }
DhcpClient : DHCP client (this one: https://wiki.archlinux.org/title/dhcpcd). Can be only used with physical network interface (not with virtual interfaces like VETH).
func (DhcpClient) Dependencies ¶
func (c DhcpClient) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the IfHandle as the only dependency of the DHCP client.
func (DhcpClient) Equal ¶
func (c DhcpClient) Equal(other depgraph.Item) bool
Equal is a comparison method for two equally-named DhcpClient instances.
func (DhcpClient) String ¶
func (c DhcpClient) String() string
String describes the DHCP client config.
type DhcpClientConfigurator ¶
DhcpClientConfigurator implements Configurator interface for DhcpClient.
func (*DhcpClientConfigurator) Modify ¶
func (c *DhcpClientConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify is not implemented.
func (*DhcpClientConfigurator) NeedsRecreate ¶
func (c *DhcpClientConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate always returns true - Modify is not implemented.
type DhcpServer ¶
type DhcpServer struct { // ServerName : logical name for the DHCP server. ServerName string // NetNamespace : network namespace where the server should be running. NetNamespace string // VethName : logical name of the veth pair on which the server operates. // (other types of interfaces are currently not supported) VethName string // VethPeerIfName : interface name of that side of the veth pair on which // the server should listen. It should be inside NetNamespace. VethPeerIfName string // Subnet : network address + netmask (IPv4 or IPv6). Subnet *net.IPNet // IPRange : a range of IP addresses to allocate from. // Not applicable for IPv6 (SLAAC is used instead). IPRange IPRange // StaticEntries : list of MAC->IP entries statically configured for the DHCP server. StaticEntries []MACToIP // GatewayIP : address of the default gateway to advertise (DHCP option 3). GatewayIP net.IP // DomainName : name of the domain assigned to the network. // It is propagated to clients using the DHCP option 15 (24 in DHCPv6). DomainName string // DNSServers : list of IP addresses of DNS servers to announce via DHCP option 6. DNSServers []net.IP // NTP server to announce via DHCP option 42 (56 in DHCPv6). // Optional argument, leave empty to disable. NTPServer string // WPAD : URL with a location of a PAC file, announced using the Web Proxy Auto-Discovery // Protocol (WPAD) and DHCP. // The client will learn the PAC file location using the DHCP option 252. // Optional argument, leave empty to disable. WPAD string }
DhcpServer : DHCP server.
func (DhcpServer) Dependencies ¶
func (s DhcpServer) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the veth and network namespace as dependencies.
func (DhcpServer) Equal ¶
func (s DhcpServer) Equal(other depgraph.Item) bool
Equal is a comparison method for two equally-named DhcpServer instances.
func (DhcpServer) String ¶
func (s DhcpServer) String() string
String describes the DHCP server config.
type DhcpServerConfigurator ¶
type DhcpServerConfigurator struct{}
DhcpServerConfigurator implements Configurator interface for DhcpServer.
func (*DhcpServerConfigurator) Modify ¶
func (c *DhcpServerConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify is not implemented.
func (*DhcpServerConfigurator) NeedsRecreate ¶
func (c *DhcpServerConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate always returns true - Modify is not implemented.
type DnsServer ¶
type DnsServer struct { // ServerName : logical name for the DNS server. ServerName string // NetNamespace : network namespace where the server should be running. NetNamespace string // VethName : logical name of the veth pair on which the server operates. // (other types of interfaces are currently not supported) VethName string // VethPeerIfName : interface name of that side of the veth pair on which // the server should listen. It should be inside NetNamespace. VethPeerIfName string // StaticEntries : list of FQDN->IP entries statically configured for the server. StaticEntries []DnsEntry // UpstreamServers : list of IP addresses of public DNS servers to forward // requests to (unless there is a static entry). UpstreamServers []net.IP }
DnsServer : DNS server.
func (DnsServer) Dependencies ¶
func (s DnsServer) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the veth and network namespace as dependencies.
type DnsServerConfigurator ¶
type DnsServerConfigurator struct{}
DnsServerConfigurator implements Configurator interface for DnsServer.
func (*DnsServerConfigurator) Modify ¶
func (c *DnsServerConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify is not implemented.
func (*DnsServerConfigurator) NeedsRecreate ¶
func (c *DnsServerConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate always returns true - Modify is not implemented.
type HttpProxy ¶
type HttpProxy struct { sdnapi.Proxy // ProxyName : logical name for the HTTP proxy. ProxyName string // NetNamespace : network namespace where the server should be running. NetNamespace string // VethName : logical name of the veth pair on which the proxy operates. // (other types of interfaces are currently not supported) // Can be empty (if the proxy is not associated with any particular interface). VethName string // ListenIP : IP address on which the proxy should listen. // Can be empty to listen on all available interfaces instead of just // the interface with the given host address ListenIP net.IP // Hostname : domain name of the proxy. Hostname string // HTTPPort : specify on which port+protocol to listen for requests // to proxy HTTP traffic. // Zero port number can be used to disable HTTP proxying. HTTPPort sdnapi.ProxyPort // HTTPSPorts : specify on which port(s)+protocol(s) to listen // for requests to proxy HTTPS traffic. // Empty list can be used to disable HTTPS proxying. HTTPSPorts []sdnapi.ProxyPort // Transparent : enable for transparent proxy (not known to the client). Transparent bool // Users : define for username/password authentication, leave empty otherwise. Users []sdnapi.UserCredentials }
HttpProxy : HTTP(S) proxy
func (HttpProxy) Dependencies ¶
func (p HttpProxy) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the (optional) veth and network namespace as dependencies.
type HttpProxyConfigurator ¶
type HttpProxyConfigurator struct{}
HttpProxyConfigurator implements Configurator interface for HttpProxy.
func (*HttpProxyConfigurator) Modify ¶
func (c *HttpProxyConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify is not implemented.
func (*HttpProxyConfigurator) NeedsRecreate ¶
func (c *HttpProxyConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate always returns true - Modify is not implemented.
type HttpServer ¶
type HttpServer struct { // ServerName : logical name for the HTTP server. ServerName string // NetNamespace : network namespace where the server should be running. NetNamespace string // VethName : logical name of the veth pair on which the server operates. // (other types of interfaces are currently not supported) // Can be empty (if the server is not associated with any particular interface). VethName string // ListenIP : IP address on which the server should listen. // Can be empty to listen on all available interfaces instead of just // the interface with the given host address ListenIP net.IP // HTTPPort : port to listen for HTTP requests. // Zero value can be used to disable HTTP. HTTPPort uint16 // HTTPSPort : port to listen for HTTPS requests. // Zero value can be used to disable HTTPS. HTTPSPort uint16 // CertPEM : Server certificate in the PEM format. Required for HTTPS. CertPEM string // KeyPEM : Server key in the PEM format. Required for HTTPS. KeyPEM string // Maps URL Path to a content to be returned inside the HTTP(s) response body. Paths map[string]sdnapi.HTTPContent }
HttpServer : HTTP server
func (HttpServer) Dependencies ¶
func (s HttpServer) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the (optional) veth and network namespace as dependencies.
type HttpServerConfigurator ¶
type HttpServerConfigurator struct{}
HttpServerConfigurator implements Configurator interface for HttpServer.
func (*HttpServerConfigurator) Modify ¶
func (c *HttpServerConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify is not implemented.
func (*HttpServerConfigurator) NeedsRecreate ¶
func (c *HttpServerConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate always returns true - Modify is not implemented.
type IPRange ¶
type IPRange struct { // FromIP : start of the range (includes the address itself). FromIP net.IP // ToIP : end of the range (includes the address itself). ToIP net.IP }
IPRange : a range of IP addresses.
type IPRule ¶
IPRule : IP rule used to select routing table for a given traffic.
func (IPRule) Dependencies ¶
func (r IPRule) Dependencies() (deps []depgraph.Dependency)
Dependencies return nil (no dependencies).
type IPRuleConfigurator ¶
type IPRuleConfigurator struct{}
IPRuleConfigurator implements Configurator interface for IP Rules.
func (*IPRuleConfigurator) NeedsRecreate ¶
func (c *IPRuleConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true - Modify is not implemented.
type IfHandle ¶
type IfHandle struct { // PhysIf : physical interface associated with this handle. PhysIf PhysIf // Usage : How is the physical network interface being used. Usage IfUsage // ParentLL : Logical label of the parent bridge or bond if the physical interface // is bridged or aggregated, respectively. // Leave empty for L3 interfaces. ParentLL string // AdminUP : enable to put the physical interface administratively UP. AdminUP bool // MTU : Maximum transmission unit. MTU uint16 }
IfHandle : an item representing *exclusive* allocation and use of a physical interface.
func (IfHandle) Dependencies ¶
func (h IfHandle) Dependencies() (deps []depgraph.Dependency)
Dependencies returns the physical interface as the only dependency.
type IfHandleConfigurator ¶
IfHandleConfigurator implements Configurator interface for IfHandle.
func (*IfHandleConfigurator) Modify ¶
func (c *IfHandleConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify is able to change interface admin status and MTU.
func (*IfHandleConfigurator) NeedsRecreate ¶
func (c *IfHandleConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true if the usage of PhysIf changed. This triggers recreate which cascades up through the graph of dependencies.
type IfUsage ¶
type IfUsage uint8
IfUsage : how a network interface is being used.
const ( // IfUsageUnspecified : not specified how a network interface is being used. IfUsageUnspecified IfUsage = iota // IfUsageL3 : network interface is used in the L3 mode. IfUsageL3 // IfUsageBridged : network interface is bridged. IfUsageBridged // IfUsageAggregated : network interface is aggregated by Bond interface. IfUsageAggregated )
type IptablesChain ¶
type IptablesChain struct { // NetNamespace : network namespace where the chain should be created. NetNamespace string ChainName string Table string ForIPv6 bool Rules []IptablesRule // RefersChains : names of chains referred from rules. // We could probably extract this from IptablesRule.Args, but let's keep things // simple and not dive into the iptables semantics too much. RefersChains []string // RefersVeths : names of VETH interfaces referred from rules. RefersVeths []string // PreCreated : a custom chain which already exists (as empty). PreCreated bool }
IptablesChain : single iptables chain.
func (IptablesChain) Dependencies ¶
func (ch IptablesChain) Dependencies() (deps []depgraph.Dependency)
Dependencies lists all referenced chains + net namespace as dependencies.
func (IptablesChain) Equal ¶
func (ch IptablesChain) Equal(other depgraph.Item) bool
Equal compares content of two instances of the same iptables chain.
func (IptablesChain) String ¶
func (ch IptablesChain) String() string
String describes content of iptables chain.
func (IptablesChain) Type ¶
func (ch IptablesChain) Type() string
Type We use the same structure for both IPv4 and IPv6 iptables.
type IptablesChainConfigurator ¶
type IptablesChainConfigurator struct{}
IptablesChainConfigurator implements Configurator interface for both iptables and ip6tables chains.
func (*IptablesChainConfigurator) Delete ¶
Delete flushes the chain content and removes it unless it is a pre-created chain.
func (*IptablesChainConfigurator) Modify ¶
func (c *IptablesChainConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify rules by recreating them. But do not re-create the entire chain, that would recreate everything that depends on it.
func (*IptablesChainConfigurator) NeedsRecreate ¶
func (c *IptablesChainConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns false - configurator is able to modify the chain content.
type IptablesRule ¶
type IptablesRule struct { // Args : any arguments except for -t, -A, -D, -I, -R. Args []string // Description : optionally describe the rule. Description string }
IptablesRule : single iptables rule.
type MACToIP ¶
type MACToIP struct { MAC net.HardwareAddr IP net.IP }
MACToIP maps MAC address to IP address.
type MasterBridge ¶
type MasterBridge struct { // IfName : interface name of the bridge to put the veth peer under. IfName string // VLAN for which this VETH is an access port. // Leave zero to not use with VLAN. VLAN uint16 }
MasterBridge : master bridge for a veth peer.
type NetNamespace ¶
type NetNamespace struct { // NsName : name of the network namespace. NsName string ResolvConf ResolvConf }
NetNamespace : an item representing named network namespace.
func (NetNamespace) Dependencies ¶
func (n NetNamespace) Dependencies() (deps []depgraph.Dependency)
Dependencies returns nothing.
type NetNamespaceConfigurator ¶
type NetNamespaceConfigurator struct{}
NetNamespaceConfigurator implements Configurator interface for NetNamespace.
func (*NetNamespaceConfigurator) Modify ¶
func (c *NetNamespaceConfigurator) Modify(ctx context.Context, oldItem, newItem depgraph.Item) (err error)
Modify is able to update resolv.conf content.
func (*NetNamespaceConfigurator) NeedsRecreate ¶
func (c *NetNamespaceConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns false - Modify is able to handle changes (in the resolv.conf content).
type PhysIf ¶
type PhysIf struct { // MAC address assigned by Eden. MAC net.HardwareAddr // LogicalLabel : label used within the network model. LogicalLabel string }
PhysIf : physical network interface. External item used to represent a presence (or lack) of a NIC.
func (PhysIf) Dependencies ¶
func (p PhysIf) Dependencies() (deps []depgraph.Dependency)
Dependencies returns nothing (external item).
type ResolvConf ¶
type ResolvConf struct { // Create resolv.conf specifically for this network namespace // with the DNS server entries listed below. // Otherwise the namespace will use the global resolv.conf. Create bool DNSServers []net.IP }
ResolvConf - config for resolv.conf
type Route ¶
type Route struct { // NetNamespace : network namespace where the route should be created. NetNamespace string // DstNet : destination network that the route matches. // Mandatory argument (should not be nil). DstNet *net.IPNet // OutputIf : output interface for the routed traffic. // Leave undefined if the destination is unreachable. OutputIf RouteOutIf // Gw : IP address of the gateway to route the traffic via. // Leave undefined for unreachable or link-local destination. GwIP net.IP // Table : routing table to put the entry into. Table int // Metric : route metric (basically the "cost"). // The higher the value, the lower the priority is. // Highest priority is 0, lowest is ^uint32(0). Metric uint32 }
Route : single route entry.
func (Route) Dependencies ¶
func (r Route) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the namespace and the output interface as dependencies. Note that we do not check if IP address(es) assigned to the output interface match with the route gateway (it would be a programming error in sdnagent/config.go if it didn't).
type RouteConfigurator ¶
RouteConfigurator implements Configurator interface for Route.
func (*RouteConfigurator) NeedsRecreate ¶
func (c *RouteConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true. Modify is not implemented.
type RouteOutIf ¶
type RouteOutIf struct { // VethName : logical name of the veth pair used as the output device for the route. // Define either PhysIf or VethName + VethPeerIfName. VethName string // VethPeerIfName : interface name of that side of the veth pair which the routed // traffic is entering. VethPeerIfName string // PhysIf : physical interface to use as the output device. // Define either PhysIf or VethName + VethPeerIfName. PhysIf PhysIf }
RouteOutIf : output interface for the route - either veth or physical interface.
type Sysctl ¶
type Sysctl struct { // NetNamespace : network namespace name NetNamespace string EnableIPv4Forwarding bool EnableIPv6Forwarding bool BridgeNfCallIptables bool BridgeNfCallIp6tables bool }
Sysctl : item representing kernel parameters set using sysctl.
func (Sysctl) Dependencies ¶
func (f Sysctl) Dependencies() (deps []depgraph.Dependency)
Dependencies returns dependency on the network namespace.
type SysctlConfigurator ¶
type SysctlConfigurator struct{}
SysctlConfigurator implements Configurator for sysctl settings.
func (*SysctlConfigurator) NeedsRecreate ¶
func (c *SysctlConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns false - Modify is able to apply any change.
type TrafficControl ¶
type TrafficControl struct { api.TrafficControl // PhysIf : target physical network interface for traffic control. PhysIf PhysIf }
TrafficControl represents traffic control rules applied to a physical interface.
func (TrafficControl) Dependencies ¶
func (t TrafficControl) Dependencies() (deps []depgraph.Dependency)
Dependencies lists the physical interface as the only dependency.
func (TrafficControl) Equal ¶
func (t TrafficControl) Equal(other depgraph.Item) bool
Equal is a comparison method for two equally-named TrafficControl instances.
func (TrafficControl) Label ¶
func (t TrafficControl) Label() string
Label is used only for the visualization purposes of the config/state depgraph.
func (TrafficControl) Name ¶
func (t TrafficControl) Name() string
Name returns MAC address of the physical interface as the unique identifier for the TrafficControl instance.
func (TrafficControl) String ¶
func (t TrafficControl) String() string
String describes TrafficControl instance.
type TrafficControlConfigurator ¶
TrafficControlConfigurator implements Configurator interface for TrafficControl.
func (*TrafficControlConfigurator) Create ¶
Create applies traffic control rules for the physical interface.
func (*TrafficControlConfigurator) Delete ¶
Delete removes applied traffic control rules from the physical interface.
func (*TrafficControlConfigurator) NeedsRecreate ¶
func (c *TrafficControlConfigurator) NeedsRecreate(_, _ depgraph.Item) (recreate bool)
NeedsRecreate returns true, Modify is not implemented.
type Veth ¶
type Veth struct { // VethName : logical name for the veth pair as a whole. VethName string Peer1 VethPeer Peer2 VethPeer }
Veth : virtual Ethernet (two interconnected peers).
func (Veth) Dependencies ¶
func (v Veth) Dependencies() (deps []depgraph.Dependency)
Dependencies lists namespace and potentially bridge as veth dependencies.
type VethConfigurator ¶
type VethConfigurator struct{}
VethConfigurator implements Configurator interface for veth.
func (*VethConfigurator) NeedsRecreate ¶
func (c *VethConfigurator) NeedsRecreate(oldItem, newItem depgraph.Item) (recreate bool)
NeedsRecreate returns true. Modify is not implemented.
type VethPeer ¶
type VethPeer struct { // IfName : name of the veth peer. IfName string // MasterBridge : bridge to put veth peer under. // Leave nil to use veth peer without bridge. // Do not combine with non-main NetNamespace (bridges are limited to main ns) // and IPAddresses. MasterBridge *MasterBridge // NetNamespace : network namespace where the veth peer should be placed into. // Do not combine non-main namespace with MasterBridge. NetNamespace string // IPAddresses : IP addresses to assign to the veth peer. // The peer should be in the L3 mode, not under a bridge. IPAddresses []*net.IPNet // MTU : Maximum transmission unit. MTU uint16 }
VethPeer : one side of Virtual Ethernet Device.
func (VethPeer) Dependencies ¶
func (v VethPeer) Dependencies() (deps []depgraph.Dependency)
Dependencies of a single veth side.