summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/option_server_identifier.go
diff options
context:
space:
mode:
authorChristopher Koch <c@chrisko.ch>2019-01-15 21:11:07 +0000
committerChris K <c@chrisko.ch>2019-01-19 14:44:00 -0800
commit0b587bcfd1b0e8808e57d77fb4028adbd54bfd25 (patch)
treeb9431e29f54157978762db67d36c1b19a7f3b3ef /dhcpv4/option_server_identifier.go
parentfeb8958aff848a6d7363fea2e29a2ac071685055 (diff)
dhcpv4: consolidate all IP options into one file.
Diffstat (limited to 'dhcpv4/option_server_identifier.go')
-rw-r--r--dhcpv4/option_server_identifier.go36
1 files changed, 0 insertions, 36 deletions
diff --git a/dhcpv4/option_server_identifier.go b/dhcpv4/option_server_identifier.go
deleted file mode 100644
index 6fc09a9..0000000
--- a/dhcpv4/option_server_identifier.go
+++ /dev/null
@@ -1,36 +0,0 @@
-package dhcpv4
-
-import (
- "fmt"
- "net"
-
- "github.com/u-root/u-root/pkg/uio"
-)
-
-// OptServerIdentifier implements the server identifier option described by RFC
-// 2132, Section 9.7.
-type OptServerIdentifier struct {
- ServerID net.IP
-}
-
-// ParseOptServerIdentifier returns a new OptServerIdentifier from a byte
-// stream, or error if any.
-func ParseOptServerIdentifier(data []byte) (*OptServerIdentifier, error) {
- buf := uio.NewBigEndianBuffer(data)
- return &OptServerIdentifier{ServerID: net.IP(buf.CopyN(net.IPv4len))}, buf.FinError()
-}
-
-// Code returns the option code.
-func (o *OptServerIdentifier) Code() OptionCode {
- return OptionServerIdentifier
-}
-
-// ToBytes returns a serialized stream of bytes for this option.
-func (o *OptServerIdentifier) ToBytes() []byte {
- return o.ServerID.To4()
-}
-
-// String returns a human-readable string.
-func (o *OptServerIdentifier) String() string {
- return fmt.Sprintf("Server Identifier -> %v", o.ServerID.String())
-}