Documentation ¶
Overview ¶
Copyright (c) 2023 Nordix Foundation
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
Index ¶
Constants ¶
const ( NSE = iota // Interface linked to a NSC (e.g. target) NSC // Interface linked to a NSE (e.g. Load balancer) )
Variables ¶
This section is empty.
Functions ¶
func GenerateMacAddress ¶ added in v1.0.13
func GenerateMacAddress() (net.HardwareAddr, error)
https://stackoverflow.com/questions/21018729/generate-mac-address-in-go
Types ¶
type FWMarkRoute ¶
type Iface ¶
type Iface interface { GetIndex() int GetName(options ...IfaceNameOption) string GetLocalPrefixes() []string SetLocalPrefixes(localPrefixes []string) AddLocalPrefix(prefix string) error RemoveLocalPrefix(prefix string) error GetNeighborPrefixes() []string SetNeighborPrefixes(neighborPrefixes []string) GetGatewayPrefixes() []string SetGatewayPrefixes(gateways []string) GetInterfaceType() InterfaceType SetInterfaceType(ifaceType InterfaceType) Equals(Iface) bool }
type IfaceNameOption ¶ added in v1.1.1
type IfaceNameOption func(*IfaceNameOptions)
func WithNoLoad ¶ added in v1.1.1
func WithNoLoad() IfaceNameOption
WithNoLoad - WithNoLoad implements option pattern for GetName function. Tells not to load resolved interface name into the Name field of Interface struct.
func WithNoResolve ¶ added in v1.1.1
func WithNoResolve() IfaceNameOption
WithNoResolve - WithNoResolve implements option pattern for GetName function. Tells not to resolve the interface name if not known.
type IfaceNameOptions ¶ added in v1.1.1
type InterfaceMonitor ¶
type InterfaceMonitor interface { Subscribe(subscriber InterfaceMonitorSubscriber) UnSubscribe(subscriber InterfaceMonitorSubscriber) Close() }
type InterfaceType ¶
type InterfaceType int
type SourceBasedRoute ¶
type Utils ¶
type Utils interface { NewInterface(index int) Iface NewBridge(name string) (Bridge, error) NewFWMarkRoute(ip string, fwmark int, tableID int) (FWMarkRoute, error) NewSourceBasedRoute(tableID int, prefix string) (SourceBasedRoute, error) NewInterfaceMonitor() (InterfaceMonitor, error) WithInterfaceMonitor(parent context.Context, monitor InterfaceMonitor) context.Context GetInterfaceMonitor(ctx context.Context) InterfaceMonitor GetIndexFromName(name string) (int, error) }