diff options
Diffstat (limited to 'dhcpv4/options.go')
-rw-r--r-- | dhcpv4/options.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/dhcpv4/options.go b/dhcpv4/options.go index aa9808b..989a93b 100644 --- a/dhcpv4/options.go +++ b/dhcpv4/options.go @@ -110,6 +110,16 @@ func (o *Option) String() string { return fmt.Sprintf("%v -> %v", code, o.Data) } +// BSDPString converts a BSDP-specific option embedded in +// vendor-specific information to a human-readable string. +func (o *Option) BSDPString() string { + code, ok := BSDPOptionCodeToString[o.Code] + if !ok { + code = "Unknown" + } + return fmt.Sprintf("%v -> %v", code, o.Data) +} + func (o *Option) ToBytes() []byte { // Convert a single option to its wire-format representation ret := []byte{byte(o.Code)} |