mnet_ip

package
v0.0.0-...-4adfca9 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 2, 2020 License: AGPL-3.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Family type definitions
	FAMILY_ALL  = unix.AF_UNSPEC
	FAMILY_V4   = unix.AF_INET
	FAMILY_V6   = unix.AF_INET6
	FAMILY_MPLS = 28
	// Arbitrary set value (greater than default 4k) to allow receiving
	// from kernel more verbose messages e.g. for statistics,
	// tc rules or filters, or other more memory requiring data.
	RECEIVE_BUFFER_SIZE = 65536
)

Variables

This section is empty.

Functions

func AssignNetlinkIpAddress

func AssignNetlinkIpAddress(ifName string, ipAddr string, netmask int)

func ConfigBridgeByCommand

func ConfigBridgeByCommand(bridgeID string, ipAddr string, netmask string, resetBridge bool) (string, error)

Create and configure a bridge

func ConfigBridgeIpAddrByCommand

func ConfigBridgeIpAddrByCommand(bridgeID string, ipAddr string, netmask string) (string, error)

Assign an ip address to a bridge network interface

func ConfigBridgeUpByCommand

func ConfigBridgeUpByCommand(bridgeID string) (string, error)

"Up" the bridge interface

func ConfigIpAddressForNewTunByCommand

func ConfigIpAddressForNewTunByCommand(
	taptunID string, ipAddr string, netmask string, peerIpAddr string, peerGatewayIpAddr string) (ret bool)

func ConfigMconnIpAddress

func ConfigMconnIpAddress(taptunNum string, ipAddr string, netmask string, gwIpAddr string, peerIpAddr string)

L3 based = mconn = client mode

func ConfigRouteTargetIpAddr

func ConfigRouteTargetIpAddr(targetIpAddr string, gatewayIpAddr string) (string, error)

Add a route (routing table entry) to the targetIpAddr through the gatewayIpAddr

func ConfigTapToBridgeByCommand

func ConfigTapToBridgeByCommand(bridgeID string, tapID string) (string, error)

Add a network interface to a bridge interface

func ConfigTunIpAddrByCommand

func ConfigTunIpAddrByCommand(
	taptunID string, ipAddr string, netmask string, peerIpAddr string, peerGatewayIpAddr string) (result map[int]string)

func GetCommandSetForAddIpAddressTunInterface

func GetCommandSetForAddIpAddressTunInterface(taptunID string, ipAddr string, netmask string, peerIpAddr string, gatewayIpAddr string) (string, map[int][]string)

///// Client Node L3 connection CMD changes based on platform. gatewayIpAddr is peer internal ip as gateway ip from client side connection

func GetIpAddressV4ByNetlink(ifName string) []netlink.Addr
func GetIpAddressV6ByNetlink(ifName string) []netlink.Addr

func GetMainInterfaceIpAddress

func GetMainInterfaceIpAddress() (string, error)

Returns the main network interface ip address

func GetNetlinkAllIpAddress

func GetNetlinkAllIpAddress(ifName string, family int) []netlink.Addr

func GetOwnGatewayIpAddress

func GetOwnGatewayIpAddress() (string, error)

Returns the node's gateway ip address

func ListAllLinksByNetlink()

func ListNetlinkAllIpAddress

func ListNetlinkAllIpAddress(ifName string, family int)

func NetflowMonitorBridge

func NetflowMonitorBridge(bridgeID string, collectorIp string, collectorPort string, netflowDirectory string) error

Add a softflowd daemon to a bridge interface

func RemoveNetlinkIpAddress

func RemoveNetlinkIpAddress(ifName string, ipAddr string, netmask int)

func RerouteAllTraffic

func RerouteAllTraffic(gatewayIpAddr string) (string, error)

Direct all net traffic to through a gateway

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL