summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/ztpv4/ztp.go
diff options
context:
space:
mode:
authorChristopher Koch <c@chrisko.ch>2019-01-20 21:13:30 +0000
committerinsomniac <insomniacslk@users.noreply.github.com>2019-01-24 08:05:49 +0000
commita4a666c6477431358a1d6ed7b556398ed690ab5c (patch)
treed6b4c0e7a753db223d7d8b09569c4d028cff0f24 /dhcpv4/ztpv4/ztp.go
parentc90ab10024ada840e24bb028a3405961e8e4c26a (diff)
dhcpv4: getters instead of getters
From: r := GetRouter(d.Options) To: r := d.Router()
Diffstat (limited to 'dhcpv4/ztpv4/ztp.go')
-rw-r--r--dhcpv4/ztpv4/ztp.go4
1 files changed, 2 insertions, 2 deletions
diff --git a/dhcpv4/ztpv4/ztp.go b/dhcpv4/ztpv4/ztp.go
index 4401e9d..1bcb44f 100644
--- a/dhcpv4/ztpv4/ztp.go
+++ b/dhcpv4/ztpv4/ztp.go
@@ -18,7 +18,7 @@ var errVendorOptionMalformed = errors.New("malformed vendor option")
// ParseVendorData will try to parse dhcp4 options looking for more
// specific vendor data (like model, serial number, etc).
func ParseVendorData(packet *dhcpv4.DHCPv4) (*VendorData, error) {
- vc := dhcpv4.GetClassIdentifier(packet.Options)
+ vc := packet.ClassIdentifier()
if len(vc) == 0 {
return nil, errors.New("vendor options not found")
}
@@ -58,7 +58,7 @@ func ParseVendorData(packet *dhcpv4.DHCPv4) (*VendorData, error) {
p := strings.Split(vc, "-")
if len(p) < 3 {
vd.Model = p[1]
- vd.Serial = dhcpv4.GetHostName(packet.Options)
+ vd.Serial = packet.HostName()
if len(vd.Serial) == 0 {
return nil, errors.New("host name option is missing")
}