server

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Aug 31, 2026 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Server

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

Server is an IPMI BMC server.

Create one with NewServer, then call Server.Serve to start accepting packets. Serve blocks until ctx is cancelled or Server.Close is called.

func NewServer

func NewServer(b *bmc.BMC, conn transport.PacketConn, opts ...ServerOption) *Server

NewServer creates a Server.

b is the BMC state (create with bmc.New). conn is the packet transport (e.g., from transport/udp.Listen). opts are applied in order.

A default handlers.Registry populated with all standard commands is used unless overridden via WithHandlerRegistry.

func (*Server) Close

func (s *Server) Close() error

Close shuts down the server and its transport.

func (*Server) Serve

func (s *Server) Serve(ctx context.Context) error

Serve reads packets from the transport and dispatches them until ctx is cancelled or Server.Close is called.

type ServerOption

type ServerOption func(*Server)

ServerOption configures a Server.

func WithCipherSuites

func WithCipherSuites(ids []types.CipherSuiteID) ServerOption

WithCipherSuites configures the RMCP+ cipher suites the server advertises and accepts. Each ID must be a suite the reference server implements (validated by bmc.BMC.SetCipherSuites); passing an unsupported suite panics. Use this to advertise only a subset, e.g. only suite 17.

func WithHandlerRegistry

func WithHandlerRegistry(r *handlers.Registry) ServerOption

WithHandlerRegistry replaces the default handler registry. Use this to add OEM commands or override built-in handlers. All registration on r must be complete before Server.Serve is called; the registry is read-only and unsynchronized during dispatch.

func WithSOLDebug added in v0.9.1

func WithSOLDebug() ServerOption

WithSOLDebug traces every SOL data-plane packet (decoded fields on receipt/send, raw wire bytes on transmit) to stderr. SOL failures are otherwise invisible to command tracing: the data plane rides the session directly and never passes through the handler registry.

func WithServerBufferSize

func WithServerBufferSize(n int) ServerOption

WithServerBufferSize sets the UDP read buffer size (default 4096).

func WithV15AuthTypes

func WithV15AuthTypes(types []bmc.V15AuthType) ServerOption

WithV15AuthTypes configures IPMI v1.5 authentication types the server advertises and accepts (lan / -A MD5). Mirrors bmc.WithV15AuthTypes.

func WithV15Disabled

func WithV15Disabled() ServerOption

WithV15Disabled disables IPMI v1.5 LAN sessions. RMCP+ (lanplus) is unaffected.

Jump to

Keyboard shortcuts

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