IpRoute

package
v0.0.0-...-7685a06 Latest Latest
Warning

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

Go to latest
Published: Dec 30, 2021 License: GPL-3.0 Imports: 3 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

func NewManager

func NewManager() *Manager

create manager

func (*Manager) CreateRoute

func (m *Manager) CreateRoute(name string, node RouteNodeSpec, info RouteInfoSpec) (*Route, error)

create route

type Route

type Route struct {

	// only use
	Node RouteNodeSpec
	Info RouteInfoSpec
	// contains filtered or unexported fields
}

route

func (*Route) CreateRule

func (r *Route) CreateRule(ruleAction RuleAction, selector RuleSelector) (*Rule, error)

func (*Route) Remove

func (r *Route) Remove() error

remove route

type RouteInfoSpec

type RouteInfoSpec struct {
	Via string
	Dev string
	Mtu string
}

route info spec, only select important ones, too many extends

func (*RouteInfoSpec) String

func (info *RouteInfoSpec) String() string

info

type RouteNodeSpec

type RouteNodeSpec struct {
	// args
	Type   string // unist local broadcast
	Prefix string // default 0/0 or ::/0
	Proto  string //
	Scope  string // global link host
	Metric string // metric num
}

route node spec

func (*RouteNodeSpec) String

func (node *RouteNodeSpec) String() string

to string

type Rule

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

rule

func (*Rule) Remove

func (rule *Rule) Remove() ([]byte, error)

type RuleAction

type RuleAction struct {
	// Table string   this is attach with table
	Proto  string
	Nat    string
	Realms string
}

rule action

func (*RuleAction) String

func (a *RuleAction) String() string

rule action

type RuleSelector

type RuleSelector struct {
	Mark       bool   // not !
	SrcPrefix  string // source
	DestPrefix string // destination
	Fwmark     string // mark
	IpProto    string // ip protocol
	SPort      string // source port
	DPort      string // destination port
}

rule selector

func (*RuleSelector) String

func (s *RuleSelector) String() string

selector

type RunCommand

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

run command to route

Jump to

Keyboard shortcuts

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