From 0845afe72e425c66b9dd591c375e810cfb85de47 Mon Sep 17 00:00:00 2001 From: Andrea Barberio Date: Thu, 27 Sep 2018 00:09:24 +0100 Subject: linter --- dhcpv6/server.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dhcpv6/server.go b/dhcpv6/server.go index 786d369..b832a8a 100644 --- a/dhcpv6/server.go +++ b/dhcpv6/server.go @@ -51,14 +51,18 @@ func main() { */ +// Handler is a type that defines the handler function to be called every time a +// valid DHCPv6 message is received type Handler func(conn net.PacketConn, peer net.Addr, m DHCPv6) +// Server represents a DHCPv6 server object type Server struct { conn net.PacketConn LocalAddr net.UDPAddr Handler Handler } +// ActivateAndServe starts the DHCPv6 server func (s *Server) ActivateAndServe() error { if s.conn == nil { conn, err := net.ListenUDP("udp6", &s.LocalAddr) @@ -99,6 +103,7 @@ func (s *Server) ActivateAndServe() error { return nil } +// NewServer initializes and returns a new Server object func NewServer(addr net.UDPAddr, handler Handler) *Server { return &Server{ LocalAddr: addr, -- cgit v1.2.3