syscall

package
v1.13.0 Latest Latest
Warning

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

Go to latest
Published: Jul 28, 2023 License: Apache-2.0 Imports: 2 Imported by: 0

README

Syscall

The code from Package syscall is used for wrapping syscall functions from different platforms that the standard syscall library does not provide.

Steps to produce files in the directory:

  1. Clone the repo golang/sys and put your types and const definitions in the linux/types.go.
  2. Run GOOS=linux GOARCH=amd64 ./mkall.sh from golang/sys/internal-branch.go1.17-vendor. Don't worry about GOARCH, it will generate the required files for all possible Linux architectures.
  3. Copy the generated code ztypes_linux.go and hand-writing code types.go to this directory.
  4. Add your syscall functions in syscall_unix.go.

Documentation

Index

Constants

View Source
const ScopeLevelCount = 16

Variables

This section is empty.

Functions

This section is empty.

Types

type AddressPrefix

type AddressPrefix struct {
	Prefix RawSockAddrInet
	// contains filtered or unexported fields
}

func NewAddressPrefixFromIPNet

func NewAddressPrefixFromIPNet(ipnet *net.IPNet) *AddressPrefix

func (*AddressPrefix) EqualsTo

func (p *AddressPrefix) EqualsTo(ipNet *net.IPNet) bool

func (*AddressPrefix) IPNet

func (p *AddressPrefix) IPNet() *net.IPNet

func (*AddressPrefix) String

func (p *AddressPrefix) String() string

type LinkLocalAddressBehavior

type LinkLocalAddressBehavior int32

LinkLocalAddressBehavior defines the link local address behavior.

const (
	LinkLocalAlwaysOff LinkLocalAddressBehavior = 0
	LinkLocalDelayed   LinkLocalAddressBehavior = 1
	LinkLocalAlwaysOn  LinkLocalAddressBehavior = 2
	LinkLocalUnchanged LinkLocalAddressBehavior = -1
)

type MibIPForwardRow

type MibIPForwardRow struct {
	Luid              uint64
	Index             uint32
	DestinationPrefix AddressPrefix
	NextHop           RawSockAddrInet

	SitePrefixLength  uint8
	ValidLifetime     uint32
	PreferredLifetime uint32
	Metric            uint32
	Protocol          NlRouteProtocol

	Loopback             bool
	AutoconfigureAddress bool
	Publish              bool
	Immortal             bool

	Age    uint32
	Origin NlRouteOrigin
}

func NewIPForwardRow

func NewIPForwardRow() *MibIPForwardRow

type MibIPForwardTable

type MibIPForwardTable struct {
	NumEntries uint32
	Table      [1]MibIPForwardRow
}

type MibIPInterfaceRow

type MibIPInterfaceRow struct {
	Family                               uint16
	Luid                                 uint64
	Index                                uint32
	MaxReassemblySize                    uint32
	Identifier                           uint64
	MinRouterAdvertisementInterval       uint32
	MaxRouterAdvertisementInterval       uint32
	AdvertisingEnabled                   bool
	ForwardingEnabled                    bool
	WeakHostSend                         bool
	WeakHostReceive                      bool
	UseAutomaticMetric                   bool
	UseNeighborUnreachabilityDetection   bool
	ManagedAddressConfigurationSupported bool
	OtherStatefulConfigurationSupported  bool
	AdvertiseDefaultRoute                bool
	RouterDiscoveryBehavior              RouterDiscoveryBehavior
	DadTransmits                         uint32
	BaseReachableTime                    uint32
	RetransmitTime                       uint32
	PathMtuDiscoveryTimeout              uint32
	LinkLocalAddressBehavior             LinkLocalAddressBehavior
	LinkLocalAddressTimeout              uint32
	ZoneIndices                          [ScopeLevelCount]uint32
	SitePrefixLength                     uint32
	Metric                               uint32
	NlMtu                                uint32
	Connected                            bool
	SupportsWakeUpPatterns               bool
	SupportsNeighborDiscovery            bool
	SupportsRouterDiscovery              bool
	ReachableTime                        uint32
	TransmitOffload                      NlInterfaceOffloadRodFlags
	ReceiveOffload                       NlInterfaceOffloadRodFlags
	DisableDefaultRoutes                 bool
}

type NetIOInterface

type NetIOInterface interface {
	GetIPInterfaceEntry(ipInterfaceRow *MibIPInterfaceRow) (errcode error)

	SetIPInterfaceEntry(ipInterfaceRow *MibIPInterfaceRow) (errcode error)

	CreateIPForwardEntry(ipForwardEntry *MibIPForwardRow) (errcode error)

	DeleteIPForwardEntry(ipForwardEntry *MibIPForwardRow) (errcode error)

	ListIPForwardRows(family uint16) ([]MibIPForwardRow, error)
}

func NewNetIO

func NewNetIO() NetIOInterface

type NlInterfaceOffloadRodFlags

type NlInterfaceOffloadRodFlags uint8

NlInterfaceOffloadRodFlags specifies a set of flags that indicate the offload capabilities for an IP interface.

const (
	NlChecksumSupported NlInterfaceOffloadRodFlags = 0x01

	TlDatagramChecksumSupported NlInterfaceOffloadRodFlags = 0x04
	TlStreamChecksumSupported   NlInterfaceOffloadRodFlags = 0x08
	TlStreamOptionsSupported    NlInterfaceOffloadRodFlags = 0x10
	FastPathCompatible          NlInterfaceOffloadRodFlags = 0x20
	TlLargeSendOffloadSupported NlInterfaceOffloadRodFlags = 0x40
	TlGiantSendOffloadSupported NlInterfaceOffloadRodFlags = 0x80
)

type NlRouteOrigin

type NlRouteOrigin uint32

NlRouteOrigin defines the origin of the IP route.

const (
	NlroManual              NlRouteOrigin = 0
	NlroWellKnown           NlRouteOrigin = 1
	NlroDHCP                NlRouteOrigin = 2
	NlroRouterAdvertisement NlRouteOrigin = 3
	Nlro6to4                NlRouteOrigin = 4
)

type NlRouteProtocol

type NlRouteProtocol uint32

NlRouteProtocol defines the routing mechanism that an IP route was added with.

const (
	RouteProtocolOther   NlRouteProtocol = 1
	RouteProtocolLocal   NlRouteProtocol = 2
	RouteProtocolNetMgmt NlRouteProtocol = 3
	RouteProtocolIcmp    NlRouteProtocol = 4
	RouteProtocolEgp     NlRouteProtocol = 5
	RouteProtocolGgp     NlRouteProtocol = 6
	RouteProtocolHello   NlRouteProtocol = 7
	RouteProtocolRip     NlRouteProtocol = 8
	RouteProtocolIsIs    NlRouteProtocol = 9
	RouteProtocolEsIs    NlRouteProtocol = 10
	RouteProtocolCisco   NlRouteProtocol = 11
	RouteProtocolBbn     NlRouteProtocol = 12
	RouteProtocolOspf    NlRouteProtocol = 13
	RouteProtocolBgp     NlRouteProtocol = 14
	RouteProtocolIdpr    NlRouteProtocol = 15
	RouteProtocolEigrp   NlRouteProtocol = 16
	RouteProtocolDvmrp   NlRouteProtocol = 17
	RouteProtocolRpl     NlRouteProtocol = 18
	RouteProtocolDhcp    NlRouteProtocol = 19

	//
	// Windows-specific definitions.
	//
	NT_AUTOSTATIC     NlRouteProtocol = 10002
	NT_STATIC         NlRouteProtocol = 10006
	NT_STATIC_NON_DOD NlRouteProtocol = 10007
)

type RawSockAddrInet

type RawSockAddrInet struct {
	Family uint16
	// contains filtered or unexported fields
}

func NewRawSockAddrInetFromIP

func NewRawSockAddrInetFromIP(ip net.IP) *RawSockAddrInet

func (*RawSockAddrInet) IP

func (a *RawSockAddrInet) IP() net.IP

func (*RawSockAddrInet) String

func (a *RawSockAddrInet) String() string

type RouterDiscoveryBehavior

type RouterDiscoveryBehavior int32

The following definitions are copied from Nldef header in Win32 API reference documentation. RouterDiscoveryBehavior defines the router discovery behavior.

const (
	RouterDiscoveryDisabled  RouterDiscoveryBehavior = 0
	RouterDiscoveryEnabled   RouterDiscoveryBehavior = 1
	RouterDiscoveryDHCP      RouterDiscoveryBehavior = 2
	RouterDiscoveryUnchanged RouterDiscoveryBehavior = -1
)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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