Documentation ¶
Index ¶
- Variables
- func Connect()
- func NewNs() netns.NsHandle
- func NewVeth(n netns.NsHandle, name, dstName, ip string, insideFn func(netlink.Link) error) (link *netlink.Veth, err error)
- func RunInNs(fd netns.NsHandle, fn func() error) error
- type EgressChain
- type ExtInterface
- type IngressChain
- type InterfaceNode
- type NetlinkMonitor
- type Renderer
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func NewNs ¶
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.
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 ¶
func NewExtInterface ¶
func NewExtInterface(link netlink.Link) *ExtInterface
func (*ExtInterface) FD ¶
func (ifc *ExtInterface) FD() int
func (*ExtInterface) Link ¶
func (ifc *ExtInterface) Link() netlink.Link
func (*ExtInterface) SetID ¶
func (ifc *ExtInterface) SetID(id int)
func (*ExtInterface) SetLink ¶
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 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 (*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()
Source Files ¶
Click to show internal directories.
Click to hide internal directories.