Documentation ¶
Index ¶
- Variables
- func AddSystemRoute(network string, dev string) error
- type IRouter
- type RouteRecord
- type RouteTable
- func (r *RouteTable) Add(dst string, uuid string) error
- func (r *RouteTable) Delete(dst string)
- func (r *RouteTable) DeleteById(id string)
- func (r *RouteTable) GetByName(name string) *TableNode
- func (r *RouteTable) ListByName() []string
- func (r *RouteTable) Print()
- func (r *RouteTable) Route(ip net.IP) string
- type SystemRouteTable
- type TableNode
Constants ¶
This section is empty.
Variables ¶
View Source
var (
ErrMaskSizeOutOfLimit = errors.New("net mask size out of limit")
)
Functions ¶
func AddSystemRoute ¶
AddSystemRoute @Description: @param network @param dev
Types ¶
type IRouter ¶
type IRouter interface { // // Route // @Description: // @param ip // @return interface{} // Route(ip net.IP) string // // Add // @Description: Add("192.168.1.0/24"[dst cidr],"10.1.1.2"[client]) // @param dst destination cidr // @param tunnel tunnel mark // @return error // Add(dst string, tunnel string) error // // Delete // @Description: // @param dst dst destination cidr // Delete(dst string) }
IRouter @Description:
type RouteRecord ¶
RouteRecord @Description:
type RouteTable ¶
type RouteTable struct { Length int // contains filtered or unexported fields }
RouteTable @Description:
func NewRouteTable ¶
func NewRouteTable(autoRank bool, minimumMaskSize int) *RouteTable
NewRouteTable @Description: @return *RouteTable
func (*RouteTable) Add ¶
func (r *RouteTable) Add(dst string, uuid string) error
Add @Description: 若已存在则会更新路由表 @receiver r @param dst @param uuid @return error
func (*RouteTable) Delete ¶
func (r *RouteTable) Delete(dst string)
Delete @Description: @receiver r @param dst
func (*RouteTable) DeleteById ¶ added in v0.1.1
func (r *RouteTable) DeleteById(id string)
DeleteById @Description: @receiver r @param dst
func (*RouteTable) GetByName ¶
func (r *RouteTable) GetByName(name string) *TableNode
GetByName @Description: @receiver r @param name @return *TableNode
func (*RouteTable) ListByName ¶
func (r *RouteTable) ListByName() []string
ListByName @Description: @receiver r @return []string
type SystemRouteTable ¶
type SystemRouteTable struct { DeviceName string Records map[string]*RouteRecord // contains filtered or unexported fields }
SystemRouteTable @Description:
func NewSystemRouteTable ¶
func NewSystemRouteTable(devName string) *SystemRouteTable
NewSystemRouteTable @Description: @return *SystemRouteTable
func (*SystemRouteTable) DeployAll ¶
func (t *SystemRouteTable) DeployAll()
DeployAll @Description: @receiver t
Click to show internal directories.
Click to hide internal directories.