server6

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2019 License: BSD-3-Clause Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handler

type Handler func(conn net.PacketConn, peer net.Addr, m dhcpv6.DHCPv6)

Handler is a type that defines the handler function to be called every time a valid DHCPv6 message is received

type Server

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

Server represents a DHCPv6 server object

func NewServer

func NewServer(ifname string, addr *net.UDPAddr, handler Handler, opt ...ServerOpt) (*Server, error)

NewServer initializes and returns a new Server object, listening on `addr`, and joining the multicast group ff02::1:2 . If `addr` is nil, IPv6 unspec is used. If `WithConn` is used with a non-nil address, `addr` and `ifname` have no effect. In such case, joining the multicast group is the caller's responsibility.

func (*Server) Close

func (s *Server) Close() error

Close sends a termination request to the server, and closes the UDP listener

func (*Server) Serve

func (s *Server) Serve() error

Serve starts the DHCPv6 server. The listener will run in background, and can be interrupted with `Server.Close`.

type ServerOpt

type ServerOpt func(s *Server)

A ServerOpt configures a Server.

func WithConn

func WithConn(conn net.PacketConn) ServerOpt

WithConn configures a server with the given connection.

Jump to

Keyboard shortcuts

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