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 ¶
- type Manager
- func (m *Manager) Allocate(protocol int, hint int32) (int32, bool)
- func (m *Manager) Release(protocol int, port int32)
- func (m *Manager) StateFields() []string
- func (m *Manager) StateLoad(ctx context.Context, stateSourceObject state.Source)
- func (m *Manager) StateSave(stateSinkObject state.Sink)
- func (m *Manager) StateTypeName() string
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 (*Manager) Allocate ¶
Allocate reserves a new port ID for protocol. hint will be taken if available.
func (*Manager) Release ¶
Release frees the specified port for protocol.
Preconditions: port is already allocated.
func (*Manager) StateFields ¶
func (*Manager) StateTypeName ¶
Click to show internal directories.
Click to hide internal directories.