From 158ad8e79b2e644da7dfbfceb9191e6587ede81e Mon Sep 17 00:00:00 2001 From: Christopher Koch Date: Sat, 29 Dec 2018 09:21:33 -0800 Subject: dhcpv4: move all list of IPs types to options_ips.go. --- dhcpv4/option_domain_name_server.go | 40 ------------------------------------- 1 file changed, 40 deletions(-) delete mode 100644 dhcpv4/option_domain_name_server.go (limited to 'dhcpv4/option_domain_name_server.go') diff --git a/dhcpv4/option_domain_name_server.go b/dhcpv4/option_domain_name_server.go deleted file mode 100644 index a8a679f..0000000 --- a/dhcpv4/option_domain_name_server.go +++ /dev/null @@ -1,40 +0,0 @@ -package dhcpv4 - -import ( - "fmt" - "net" -) - -// This option implements the domain name server option -// https://tools.ietf.org/html/rfc2132 - -// OptDomainNameServer represents an option encapsulating the domain name -// servers. -type OptDomainNameServer struct { - NameServers []net.IP -} - -// ParseOptDomainNameServer returns a new OptDomainNameServer from a byte -// stream, or error if any. -func ParseOptDomainNameServer(data []byte) (*OptDomainNameServer, error) { - ips, err := ParseIPs(data) - if err != nil { - return nil, err - } - return &OptDomainNameServer{NameServers: ips}, nil -} - -// Code returns the option code. -func (o *OptDomainNameServer) Code() OptionCode { - return OptionDomainNameServer -} - -// ToBytes returns a serialized stream of bytes for this option. -func (o *OptDomainNameServer) ToBytes() []byte { - return IPsToBytes(o.NameServers) -} - -// String returns a human-readable string. -func (o *OptDomainNameServer) String() string { - return fmt.Sprintf("Domain Name Servers -> %s", IPsToString(o.NameServers)) -} -- cgit v1.2.3