hover

package
v0.0.0-...-9da2307 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	Debug = util.Debug
	Info  = util.Info
	Warn  = util.Warn
	Error = util.Error
)

Functions

func Connect

func Connect()

func NewNs

func NewNs() netns.NsHandle

NewNs creates a new network namespace and returns a handle to it. The caller is responsible for calling Close on the handle when done with it.

func NewVeth

func NewVeth(n netns.NsHandle, name, dstName, ip string, insideFn func(netlink.Link) error) (link *netlink.Veth, err error)

NewVeth creates a veth pair with the given name, moves the peer into the namespace n, then renames the peer to dstName and assigns the provided ip. If insideFn is not nil, also executes that function in the context of the given namespace.

func RunInNs

func RunInNs(fd netns.NsHandle, fn func() error) error

Types

type EgressChain

type EgressChain struct {
	// contains filtered or unexported fields
}

func NewEgressChain

func NewEgressChain(chain [4]int) (*EgressChain, error)

func (*EgressChain) Close

func (c *EgressChain) Close()

func (*EgressChain) FD

func (c *EgressChain) FD() int

type ExtInterface

type ExtInterface struct {
	canvas.NodeBase
	// contains filtered or unexported fields
}

func NewExtInterface

func NewExtInterface(link netlink.Link) *ExtInterface

func (*ExtInterface) FD

func (ifc *ExtInterface) FD() int
func (ifc *ExtInterface) Link() netlink.Link

func (*ExtInterface) SetID

func (ifc *ExtInterface) SetID(id int)
func (ifc *ExtInterface) SetLink(link netlink.Link)

type IngressChain

type IngressChain struct {
	// contains filtered or unexported fields
}

func NewIngressChain

func NewIngressChain(chain [4]int) (*IngressChain, error)

func (*IngressChain) Close

func (c *IngressChain) Close()

func (*IngressChain) FD

func (c *IngressChain) FD() int

type InterfaceNode

type InterfaceNode interface {
	canvas.Node
	Link() netlink.Link
	SetLink(netlink.Link)
}

type NetlinkMonitor

type NetlinkMonitor struct {
	// contains filtered or unexported fields
}

NetlinkMonitor keeps track of the interfaces on this host. It can invoke a callback when an interface is added/deleted.

func NewNetlinkMonitor

func NewNetlinkMonitor(g canvas.Graph, r *Renderer, modules *bpf.BpfTable) (res *NetlinkMonitor, err error)

func (*NetlinkMonitor) Close

func (nm *NetlinkMonitor) Close()

func (*NetlinkMonitor) EnsureInterfaces

func (nm *NetlinkMonitor) EnsureInterfaces(g canvas.Graph)

func (*NetlinkMonitor) InterfaceByName

func (nm *NetlinkMonitor) InterfaceByName(name string) (node InterfaceNode, err error)

func (*NetlinkMonitor) Interfaces

func (nm *NetlinkMonitor) Interfaces() (nodes []InterfaceNode)

func (*NetlinkMonitor) ParseLinkUpdates

func (nm *NetlinkMonitor) ParseLinkUpdates()

type Renderer

type Renderer struct {
}

func NewRenderer

func NewRenderer() *Renderer

func (*Renderer) Provision

func (h *Renderer) Provision(g canvas.Graph, nodes []InterfaceNode) (err error)

func (*Renderer) Run

func (h *Renderer) Run(g canvas.Graph, nodes []InterfaceNode)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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