ip

package
v0.0.0-...-c012b7a Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2021 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const FamilyV4 = "-4"

FamilyV4 represents IPv4 protocol family

View Source
const FamilyV6 = "-6"

FamilyV6 represents IPv6 protocol family

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action interface {
	AddAction() []string
}

Action represents an action in filter

type ActionPolice

type ActionPolice struct {
	Rate  string
	Burst string
	Mtu   string
	Drop  bool
}

ActionPolice represents an action of 'police' type

func (*ActionPolice) AddAction

func (a *ActionPolice) AddAction() []string

AddAction generates a part of command specific for 'police' action

type Addr

type Addr struct {
	DevName string
	Address string
	Scope   string
	Family  string
}

Addr represents arguments for address protocol manipulation

func (*Addr) Add

func (a *Addr) Add() error

Add adds new protocol address

func (*Addr) Flush

func (a *Addr) Flush() error

Flush flushes protocol addresses

type Bridge

type Bridge struct {
	Link
}

Bridge represents arguments for link device of type bridge

func (*Bridge) Add

func (b *Bridge) Add() error

Add adds new virtual link

type Class

type Class struct {
	Dev     string
	Parent  string
	Classid string
}

Class represents qdisc class object

type ClassHTB

type ClassHTB struct {
	Class
	Rate string
}

ClassHTB represents htb qdisc class object

func (*ClassHTB) Add

func (class *ClassHTB) Add() error

Add adds class to a node

type Dummy

type Dummy struct {
	Link
}

Dummy represents arguments for link device of type dummy

func (*Dummy) Add

func (d *Dummy) Add() error

Add adds new virtual link

type Filter

type Filter struct {
	Dev      string
	Parent   string
	Protocol string
	Flowid   string
}

Filter represents filter object

type Gretap

type Gretap struct {
	Link
	Local  string
	Remote string
}

Gretap represents arguments for link of type gretap

func (*Gretap) Add

func (g *Gretap) Add() error

Add adds new virtual link

type Link struct {
	Name   string
	MTU    string
	Parent string
}

Link represents base arguments for link device

func (*Link) BridgeLinkSetHairpin

func (l *Link) BridgeLinkSetHairpin(hairpin bool) error

BridgeLinkSetHairpin sets bridge 'hairpin' attribute on a port

func (*Link) BridgeLinkSetIsolated

func (l *Link) BridgeLinkSetIsolated(isolated bool) error

BridgeLinkSetIsolated sets bridge 'isolated' attribute on a port

func (*Link) BridgeVLANAdd

func (l *Link) BridgeVLANAdd(vid string, pvid bool, untagged bool, self bool, master bool) error

BridgeVLANAdd adds a new vlan filter entry

func (*Link) BridgeVLANDelete

func (l *Link) BridgeVLANDelete(vid string, self bool, master bool) error

BridgeVLANDelete removes an existing vlan filter entry

func (*Link) Change

func (l *Link) Change(devType string, fanMap string) error

Change sets map for link device

func (*Link) Delete

func (l *Link) Delete() error

Delete deletes the link device

func (*Link) GetVFInfo

func (l *Link) GetVFInfo(vfID int) (VirtFuncInfo, error)

GetVFInfo returns info about virtual function

func (*Link) SetAddress

func (l *Link) SetAddress(address string) error

SetAddress sets the address of the link device

func (*Link) SetDown

func (l *Link) SetDown() error

SetDown disables the link device

func (*Link) SetMTU

func (l *Link) SetMTU(mtu string) error

SetMTU sets the MTU of the link device

func (*Link) SetMaster

func (l *Link) SetMaster(master string) error

SetMaster sets the master of the link device

func (*Link) SetName

func (l *Link) SetName(newName string) error

SetName sets the name of the link device

func (*Link) SetNetns

func (l *Link) SetNetns(netns string) error

SetNetns moves the link to the selected network namespace

func (*Link) SetNoMaster

func (l *Link) SetNoMaster() error

SetNoMaster removes the master of the link device

func (*Link) SetUp

func (l *Link) SetUp() error

SetUp enables the link device

func (*Link) SetVfAddress

func (l *Link) SetVfAddress(vf string, address string) error

SetVfAddress changes the address for the specified vf

func (*Link) SetVfSpoofchk

func (l *Link) SetVfSpoofchk(vf string, mode string) error

SetVfSpoofchk turns packet spoof checking on or off for the specified VF

func (*Link) SetVfVlan

func (l *Link) SetVfVlan(vf string, vlan string) error

SetVfVlan changes the assigned VLAN for the specified vf

type Macvlan

type Macvlan struct {
	Link
	Mode string
}

Macvlan represents arguments for link of type macvlan

func (*Macvlan) Add

func (macvlan *Macvlan) Add() error

Add adds new virtual link

type Macvtap

type Macvtap struct {
	Macvlan
}

Macvtap represents arguments for link of type macvtap

func (*Macvtap) Add

func (macvtap *Macvtap) Add() error

Add adds new virtual link

type Neigh

type Neigh struct {
	DevName string
	Proxy   string
}

Neigh represents arguments for neighbour manipulation

func (*Neigh) Delete

func (n *Neigh) Delete() error

Delete deletes a neighbour entry

func (*Neigh) Show

func (n *Neigh) Show() (string, error)

Show list neighbour entries

type Qdisc

type Qdisc struct {
	Dev     string
	Handle  string
	Root    bool
	Ingress bool
}

Qdisc represents 'queueing discipline' object

func (*Qdisc) Add

func (qdisc *Qdisc) Add() error

Add adds qdisc to a node

func (*Qdisc) Delete

func (qdisc *Qdisc) Delete() error

Delete deletes qdisc from node

type QdiscHTB

type QdiscHTB struct {
	Qdisc
	Default string
}

QdiscHTB represents the hierarchy token bucket qdisc object

func (*QdiscHTB) Add

func (qdisc *QdiscHTB) Add() error

Add adds qdisc to a node

type Route

type Route struct {
	DevName string
	Route   string
	Table   string
	Src     string
	Proto   string
	Family  string
}

Route represents arguments for route manipulation

func (*Route) Add

func (r *Route) Add() error

Add adds new route

func (*Route) Delete

func (r *Route) Delete() error

Delete deletes routing table

func (*Route) Flush

func (r *Route) Flush() error

Flush flushes routing tables

func (*Route) Replace

func (r *Route) Replace(routes []string) error

Replace changes or adds new route

func (*Route) Show

func (r *Route) Show() ([]string, error)

Show lists routes

type Tuntap

type Tuntap struct {
	Name       string
	Mode       string
	MultiQueue bool
}

Tuntap represents arguments for tuntap manipulation

func (*Tuntap) Add

func (t *Tuntap) Add() error

Add adds new tuntap interface

type U32Filter

type U32Filter struct {
	Filter
	Value   string
	Mask    string
	Actions []Action
}

U32Filter represents universal 32bit traffic control filter

func (*U32Filter) Add

func (u32 *U32Filter) Add() error

Add adds universal 32bit traffic control filter to a node

type Veth

type Veth struct {
	Link
	PeerName string
}

Veth represents arguments for link of type veth

func (*Veth) Add

func (veth *Veth) Add() error

Add adds new virtual link

type VirtFuncInfo

type VirtFuncInfo struct {
	VF         int              `json:"vf"`
	Address    string           `json:"address"`
	MAC        string           `json:"mac"` // Deprecated
	VLANs      []map[string]int `json:"vlan_list"`
	SpoofCheck bool             `json:"spoofchk"`
}

VirtFuncInfo holds information about vf.

type Vlan

type Vlan struct {
	Link
	VlanID string
	Gvrp   bool
}

Vlan represents arguments for link of type vlan

func (*Vlan) Add

func (vlan *Vlan) Add() error

Add adds new virtual link

type Vxlan

type Vxlan struct {
	Link
	VxlanID string
	DevName string
	Local   string
	Remote  string
	Group   string
	DstPort string
	TTL     string
	FanMap  string
}

Vxlan represents arguments for link of type vxlan

func (*Vxlan) Add

func (vxlan *Vxlan) Add() error

Add adds new virtual link

Jump to

Keyboard shortcuts

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