summaryrefslogtreecommitdiffhomepage
path: root/dhcpv4/ztpv4/ztp.go
diff options
context:
space:
mode:
authorPablo Mazzini <pmazzini@gmail.com>2023-03-01 14:24:04 +0000
committerGitHub <noreply@github.com>2023-03-01 14:24:04 +0000
commit3e45eea5edd7e01ec2680891bc7c416afcbccd5a (patch)
treebee4e514c8906a9dc5bc4970ccb2e9ab5ece9d92 /dhcpv4/ztpv4/ztp.go
parent86f5cd589e46149cc5b25d74563642489e23df78 (diff)
parent67c5482272acca1e1d1075fac8b489cc312ee897 (diff)
Merge pull request #494 from name29/master
Adding support for new juniper format
Diffstat (limited to 'dhcpv4/ztpv4/ztp.go')
-rw-r--r--dhcpv4/ztpv4/ztp.go10
1 files changed, 10 insertions, 0 deletions
diff --git a/dhcpv4/ztpv4/ztp.go b/dhcpv4/ztpv4/ztp.go
index ecb63c6..8ab3a8e 100644
--- a/dhcpv4/ztpv4/ztp.go
+++ b/dhcpv4/ztpv4/ztp.go
@@ -68,6 +68,16 @@ func parseClassIdentifier(packet *dhcpv4.DHCPv4) (*VendorData, error) {
vd.VendorName = p[0]
return vd, nil
+ // Juniper:tttt-ttt:DN817
+ case strings.HasPrefix(vc, "Juniper:"):
+ p := strings.Split(vc, ":")
+ if len(p) == 3 {
+ vd.VendorName = p[0]
+ vd.Model = p[1]
+ vd.Serial = p[2]
+ return vd, nil
+ }
+ return nil, fmt.Errorf("%w got '%s'", errVendorOptionMalformed, vc)
// For Ciena the class identifier (opt 60) is written in the following format:
// {vendor iana code}-{product}-{type}