package routebsd
import "internal/routebsd"
Package routebsd supports reading interface addresses on BSD systems. This is a very stripped down version of x/net/route, for use by the net package in the standard library.
Index ¶
- type Addr
- type InetAddr
- type InterfaceAddrMessage
- type InterfaceMessage
- type InterfaceMulticastAddrMessage
- type LinkAddr
- type Message
Types ¶
type Addr ¶
type Addr interface { // Family returns an address family. Family() int }
An Addr represents an address associated with packet routing.
type InetAddr ¶
An InetAddr represent an internet address using IPv4 or IPv6.
func (*InetAddr) Family ¶
type InterfaceAddrMessage ¶
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.
type InterfaceMessage ¶
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) MTU ¶
func (m *InterfaceMessage) MTU() int
MTU returns the interface MTU.
type InterfaceMulticastAddrMessage ¶
type InterfaceMulticastAddrMessage 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 InterfaceMulticastAddrMessage represents an interface multicast address message.
type LinkAddr ¶
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 ¶
Family implements the Family method of Addr interface.
type Message ¶
type Message interface {
// contains filtered or unexported methods
}
A Message represents a routing message.
func FetchRIBMessages ¶
FetchRIBMessages fetches a list of addressing messages for an interface. The typ argument is something like syscall.NET_RT_IFLIST. The argument is an interface index or 0 for all.
Source Files ¶
address.go binary.go interface.go interface_classic.go interface_multicast.go message.go route.go sys.go sys_darwin.go
- Version
- v1.25.0-rc.1
- Published
- Jun 11, 2025
- Platform
- darwin/amd64
- Imports
- 6 packages
- Last checked
- 3 minutes ago –
Tools for package owners.