diff options
author | Emanuele Fia <name29@fb.com> | 2022-03-31 20:38:34 +0100 |
---|---|---|
committer | Emanuele Fia <name29@fb.com> | 2022-04-04 21:48:06 +0100 |
commit | 9e4611cb531e6234489ccf22973cd6b4d698885d (patch) | |
tree | 0a6a0bd1f513be7e71a363f2ad4c05a90db879ed /dhcpv6 | |
parent | cef7f4a9829be517745c0c07658f1344989d150f (diff) |
Extending support for more interface types in parse_circuit_id
Adding support for DHCPv6 for Ciena
Signed-off-by: Emanuele Fia <name29@fb.com>
Diffstat (limited to 'dhcpv6')
-rw-r--r-- | dhcpv6/ztpv6/README.md | 1 | ||||
-rw-r--r-- | dhcpv6/ztpv6/parse_vendor_options.go | 7 |
2 files changed, 2 insertions, 6 deletions
diff --git a/dhcpv6/ztpv6/README.md b/dhcpv6/ztpv6/README.md index f44191b..a3e16f8 100644 --- a/dhcpv6/ztpv6/README.md +++ b/dhcpv6/ztpv6/README.md @@ -3,6 +3,7 @@ ## Currently Supported Vendors For DHCPv6 ZTP - Arista - ZPE + - Ciena ## Why Do We Need This? Many network hardware vendors support features that allow network devices to provision themselves with proper supporting automation/tools. Network devices can rely on DHCP and other methods to gather bootfile info, IPs, etc. DHCPv6 Vendor options provides us Vendor Name, Make, Model, and Serial Number data. This data can be used to uniquely identify individual network devices at provisioning time and can be used by tooling to make decisions necessary to correctly and reliably provision a network device. diff --git a/dhcpv6/ztpv6/parse_vendor_options.go b/dhcpv6/ztpv6/parse_vendor_options.go index 13983f4..3d1fd01 100644 --- a/dhcpv6/ztpv6/parse_vendor_options.go +++ b/dhcpv6/ztpv6/parse_vendor_options.go @@ -2,7 +2,6 @@ package ztpv6 import ( "errors" - "fmt" "strconv" "strings" @@ -81,11 +80,7 @@ func ParseVendorData(packet dhcpv6.DHCPv6) (*VendorData, error) { if len(v) < 3 { return nil, errVendorOptionMalformed } - innerMessage, err := packet.GetInnerMessage() - if err != nil { - return nil, fmt.Errorf("Unable to get inner message: %v", err) - } - duid := innerMessage.Options.ClientID() + duid := packet.(*dhcpv6.Message).Options.ClientID() vd.VendorName = iana.EnterpriseIDCienaCorporation.String() vd.Model = v[1] + "-" + v[2] vd.Serial = string(duid.EnterpriseIdentifier) |