getifaddrs

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Dec 21, 2015 License: MIT Imports: 2 Imported by: 0

README

getifaddrs godoc getifaddrs

getifaddrs is a Go package to call getifaddrs(3). cgo is implied. Linux, *BSD supported.

import "github.com/ostrost/ostent/getifaddrs"

func main() {
ifdatas, err := getifaddrs.getifaddrs()
// ...
}

Documentation

Overview

Package getifaddrs does getifaddrs(3) for Go.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func IfaDropsOut

func IfaDropsOut(ifadata unsafe.Pointer) *uint

Types

type IfAddr

type IfAddr struct {
	IfaIP         string
	IfaName       string
	IfaBytesIn    uint
	IfaBytesOut   uint
	IfaPacketsIn  uint
	IfaPacketsOut uint
	IfaDropsIn    uint
	IfaDropsOut   *uint // nil in darwin
	IfaErrorsIn   uint
	IfaErrorsOut  uint
}

IfAddr is a struct with interface info.

func Getifaddrs

func Getifaddrs() ([]IfAddr, error)

Getifaddrs returns a list of IfAddr. Unlike with getifaddrs(3) the IfAddr has merged link level and interface address data.

func (IfAddr) BytesIn

func (ia IfAddr) BytesIn() uint

func (IfAddr) BytesOut

func (ia IfAddr) BytesOut() uint

func (IfAddr) DropsIn

func (ia IfAddr) DropsIn() uint

func (IfAddr) DropsOut

func (ia IfAddr) DropsOut() *uint

func (IfAddr) ErrorsIn

func (ia IfAddr) ErrorsIn() uint

func (IfAddr) ErrorsOut

func (ia IfAddr) ErrorsOut() uint

func (IfAddr) IP

func (ia IfAddr) IP() string

GetName and other methods may be combined into an interface.

func (IfAddr) Name

func (ia IfAddr) Name() string

func (IfAddr) PacketsIn

func (ia IfAddr) PacketsIn() uint

func (IfAddr) PacketsOut

func (ia IfAddr) PacketsOut() uint

Jump to

Keyboard shortcuts

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