diff options
author | Christopher Koch <chrisko@google.com> | 2018-12-29 09:21:33 -0800 |
---|---|---|
committer | insomniac <insomniacslk@users.noreply.github.com> | 2019-01-14 23:19:04 +0000 |
commit | 158ad8e79b2e644da7dfbfceb9191e6587ede81e (patch) | |
tree | 3618cbf06e7e34d835495047ec634b5b93824432 /dhcpv4/option_ntp_servers.go | |
parent | 03a987ca7475df51eb9164e807f9c1929017e08a (diff) |
dhcpv4: move all list of IPs types to options_ips.go.
Diffstat (limited to 'dhcpv4/option_ntp_servers.go')
-rw-r--r-- | dhcpv4/option_ntp_servers.go | 38 |
1 files changed, 0 insertions, 38 deletions
diff --git a/dhcpv4/option_ntp_servers.go b/dhcpv4/option_ntp_servers.go deleted file mode 100644 index 1c74e13..0000000 --- a/dhcpv4/option_ntp_servers.go +++ /dev/null @@ -1,38 +0,0 @@ -package dhcpv4 - -import ( - "fmt" - "net" -) - -// This option implements the network time protocol servers option -// https://tools.ietf.org/html/rfc2132 - -// OptNTPServers represents an option encapsulating the NTP servers. -type OptNTPServers struct { - NTPServers []net.IP -} - -// ParseOptNTPServers returns a new OptNTPServers from a byte stream, or error if any. -func ParseOptNTPServers(data []byte) (*OptNTPServers, error) { - ips, err := ParseIPs(data) - if err != nil { - return nil, err - } - return &OptNTPServers{NTPServers: ips}, nil -} - -// Code returns the option code. -func (o *OptNTPServers) Code() OptionCode { - return OptionNTPServers -} - -// ToBytes returns a serialized stream of bytes for this option. -func (o *OptNTPServers) ToBytes() []byte { - return IPsToBytes(o.NTPServers) -} - -// String returns a human-readable string. -func (o *OptNTPServers) String() string { - return fmt.Sprintf("NTP Servers -> %v", IPsToString(o.NTPServers)) -} |