mechutils

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

Package mechutils provides utilities for conververtin kernel.Mechanism to various things

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunInNetNS

func RunInNetNS(mechanism *kernel.Mechanism, f func() error) error

RunInNetNS - runs f in the netns of the mechanism Note: runtime.LockOSThread() is running for the lifetime of f so f should be very quick to run

func ToAlias

func ToAlias(conn *networkservice.Connection, isClient bool) string

ToAlias - create interface alias/tag from conn for client or server side for forwarder.

Note: Don't use this in a non-forwarder context

func ToInterfaceName

func ToInterfaceName(conn *networkservice.Connection, isClient bool) string

ToInterfaceName - create interface name from conn for client or server side for forwarder.

Note: Don't use this in a non-forwarder context

func ToNSFilename

func ToNSFilename(mechanism *kernel.Mechanism) (string, error)

ToNSFilename - mechanism to NetNS filename

func ToNSHandle

func ToNSHandle(mechanism *kernel.Mechanism) (netns.NsHandle, error)

ToNSHandle - mechanism to netns.NSHandle

func ToNetlinkHandle

func ToNetlinkHandle(mechanism *kernel.Mechanism) (*netlink.Handle, error)

ToNetlinkHandle - mechanism to netlink.Handle for the NetNS specified in mechanism

Types

This section is empty.

Jump to

Keyboard shortcuts

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