Documentation ¶
Overview ¶
Package mechutils provides utilities for conververtin kernel.Mechanism to various things
Index ¶
- func RunInNetNS(mechanism *kernel.Mechanism, f func() error) error
- func ToAlias(conn *networkservice.Connection, isClient bool) string
- func ToInterfaceName(conn *networkservice.Connection, isClient bool) string
- func ToNSFilename(mechanism *kernel.Mechanism) (string, error)
- func ToNSHandle(mechanism *kernel.Mechanism) (netns.NsHandle, error)
- func ToNetlinkHandle(mechanism *kernel.Mechanism) (*netlink.Handle, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func RunInNetNS ¶
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 ¶
ToNSFilename - mechanism to NetNS filename
func ToNSHandle ¶
ToNSHandle - mechanism to netns.NSHandle
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.