handler.go 798 B

12345678910111213141516171819
  1. package handler
  2. import (
  3. "github.com/insomniacslk/dhcp/dhcpv4"
  4. "github.com/insomniacslk/dhcp/dhcpv6"
  5. )
  6. // Handler6 is a function that is called on a given DHCPv6 packet.
  7. // It returns a DHCPv6 packet and a boolean.
  8. // If the boolean is true, this will be the last handler to be called.
  9. // The two input packets are the original request, and a response packet.
  10. // The response packet may or may not be modified by the function, and
  11. // the result will be returned by the handler.
  12. // If the returned boolean is true, the returned packet may be nil or
  13. // invalid, in which case no response will be sent.
  14. type Handler6 func(req, resp dhcpv6.DHCPv6) (dhcpv6.DHCPv6, bool)
  15. // Handler4 behaves like Handler6, but for DHCPv4 packets.
  16. type Handler4 func(req, resp *dhcpv4.DHCPv4) (*dhcpv4.DHCPv4, bool)