Go: vendor/golang_org/x/net/route Index | Files

package route

import "vendor/golang_org/x/net/route"

Package route provides basic functions for the manipulation of packet routing facilities on BSD variants.

The package supports any version of Darwin, any version of DragonFly BSD, FreeBSD 7 through 11, NetBSD 6 and above, and OpenBSD 5.6 and above.

Index

Package Files

address.go binary.go interface.go interface_classic.go interface_multicast.go message.go route.go route_classic.go sys.go sys_darwin.go syscall.go zsys_darwin.go

func FetchRIB Uses

func FetchRIB(af int, typ RIBType, arg int) ([]byte, error)

FetchRIB fetches a routing information base from the operating system.

The provided af must be an address family.

The provided arg must be a RIBType-specific argument. When RIBType is related to routes, arg might be a set of route flags. When RIBType is related to network interfaces, arg might be an interface index or a set of interface flags. In most cases, zero means a wildcard.

func ParseRIB Uses

func ParseRIB(typ RIBType, b []byte) ([]Message, error)

ParseRIB parses b as a routing information base and returns a list of routing messages.

type Addr Uses

type Addr interface {
    // Family returns an address family.
    Family() int
}

An Addr represents an address associated with packet routing.

type DefaultAddr Uses

type DefaultAddr struct {
    Raw []byte // raw format of address
    // contains filtered or unexported fields
}

A DefaultAddr represents an address of various operating system-specific features.

func (*DefaultAddr) Family Uses

func (a *DefaultAddr) Family() int

Family implements the Family method of Addr interface.

type Inet4Addr Uses

type Inet4Addr struct {
    IP [4]byte // IP address
}

An Inet4Addr represents an internet address for IPv4.

func (*Inet4Addr) Family Uses

func (a *Inet4Addr) Family() int

Family implements the Family method of Addr interface.

type Inet6Addr Uses

type Inet6Addr struct {
    IP     [16]byte // IP address
    ZoneID int      // zone identifier
}

An Inet6Addr represents an internet address for IPv6.

func (*Inet6Addr) Family Uses

func (a *Inet6Addr) Family() int

Family implements the Family method of Addr interface.

type InterfaceAddrMessage Uses

type InterfaceAddrMessage struct {
    Version int    // message version
    Type    int    // message type
    Flags   int    // interface flags
    Index   int    // interface index
    Addrs   []Addr // addresses
    // contains filtered or unexported fields
}

An InterfaceAddrMessage represents an interface address message.

func (*InterfaceAddrMessage) Sys Uses

func (m *InterfaceAddrMessage) Sys() []Sys

Sys implements the Sys method of Message interface.

type InterfaceAnnounceMessage Uses

type InterfaceAnnounceMessage struct {
    Version int    // message version
    Type    int    // message type
    Index   int    // interface index
    Name    string // interface name
    What    int    // what type of announcement
    // contains filtered or unexported fields
}

An InterfaceAnnounceMessage represents an interface announcement message.

func (*InterfaceAnnounceMessage) Sys Uses

func (m *InterfaceAnnounceMessage) Sys() []Sys

Sys implements the Sys method of Message interface.

type InterfaceMessage Uses

type InterfaceMessage struct {
    Version int    // message version
    Type    int    // message type
    Flags   int    // interface flags
    Index   int    // interface index
    Name    string // interface name
    Addrs   []Addr // addresses
    // contains filtered or unexported fields
}

An InterfaceMessage represents an interface message.

func (*InterfaceMessage) Sys Uses

func (m *InterfaceMessage) Sys() []Sys

Sys implements the Sys method of Message interface.

type InterfaceMetrics Uses

type InterfaceMetrics struct {
    Type int // interface type
    MTU  int // maximum transmission unit
}

A InterfaceMetrics represents interface metrics.

func (*InterfaceMetrics) SysType Uses

func (imx *InterfaceMetrics) SysType() SysType

SysType implements the SysType method of Sys interface.

type InterfaceMulticastAddrMessage Uses

type InterfaceMulticastAddrMessage struct {
    Version int    // message version
    Type    int    // messsage type
    Flags   int    // interface flags
    Index   int    // interface index
    Addrs   []Addr // addresses
    // contains filtered or unexported fields
}

An InterfaceMulticastAddrMessage represents an interface multicast address message.

func (*InterfaceMulticastAddrMessage) Sys Uses

func (m *InterfaceMulticastAddrMessage) Sys() []Sys

Sys implements the Sys method of Message interface.

type LinkAddr Uses

type LinkAddr struct {
    Index int    // interface index when attached
    Name  string // interface name when attached
    Addr  []byte // link-layer address when attached
}

A LinkAddr represents a link-layer address.

func (*LinkAddr) Family Uses

func (a *LinkAddr) Family() int

Family implements the Family method of Addr interface.

type Message Uses

type Message interface {
    // Sys returns operating system-specific information.
    Sys() []Sys
}

A Message represents a routing message.

Note: This interface will be changed to support Marshal method in future version.

type RIBType Uses

type RIBType int

A RIBType reprensents a type of routing information base.

const (
    RIBTypeRoute     RIBType = syscall.NET_RT_DUMP
    RIBTypeInterface RIBType = syscall.NET_RT_IFLIST
)

type RouteMessage Uses

type RouteMessage struct {
    Version int    // message version
    Type    int    // message type
    Flags   int    // route flags
    Index   int    // interface index when atatched
    Addrs   []Addr // addresses
    // contains filtered or unexported fields
}

A RouteMessage represents a message conveying an address prefix, a nexthop address and an output interface.

func (*RouteMessage) Sys Uses

func (m *RouteMessage) Sys() []Sys

Sys implements the Sys method of Message interface.

type RouteMetrics Uses

type RouteMetrics struct {
    PathMTU int // path maximum transmission unit
}

A RouteMetrics represents route metrics.

func (*RouteMetrics) SysType Uses

func (rmx *RouteMetrics) SysType() SysType

SysType implements the SysType method of Sys interface.

type Sys Uses

type Sys interface {
    // SysType returns a type of operating system-specific
    // information.
    SysType() SysType
}

A Sys reprensents operating system-specific information.

type SysType Uses

type SysType int

A SysType represents a type of operating system-specific information.

const (
    SysMetrics SysType = iota
    SysStats
)

Package route imports 5 packages (graph). Updated 2017-06-17 with GOOS=darwin. Refresh now. Tools for package owners.