port

package
v0.0.0-...-aa8ecac Latest Latest
Warning

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

Go to latest
Published: Dec 10, 2024 License: Apache-2.0, MIT Imports: 6 Imported by: 6

Documentation

Overview

Package port provides port ID allocation for netlink sockets.

A netlink port is any int32 value. Positive ports are typically equivalent to the PID of the binding process. If that port is unavailable, negative ports are searched to find a free port that will not conflict with other PIDS.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

Manager allocates netlink port IDs.

+stateify savable

func New

func New() *Manager

New creates a new Manager.

func (*Manager) Allocate

func (m *Manager) Allocate(protocol int, hint int32) (int32, bool)

Allocate reserves a new port ID for protocol. hint will be taken if available.

func (*Manager) Release

func (m *Manager) Release(protocol int, port int32)

Release frees the specified port for protocol.

Preconditions: port is already allocated.

func (*Manager) StateFields

func (m *Manager) StateFields() []string

func (*Manager) StateLoad

func (m *Manager) StateLoad(ctx context.Context, stateSourceObject state.Source)

+checklocksignore

func (*Manager) StateSave

func (m *Manager) StateSave(stateSinkObject state.Sink)

+checklocksignore

func (*Manager) StateTypeName

func (m *Manager) StateTypeName() string

Jump to

Keyboard shortcuts

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