summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--dhcpv6/dhcpv6.go1
-rw-r--r--dhcpv6/dhcpv6relay.go8
2 files changed, 9 insertions, 0 deletions
diff --git a/dhcpv6/dhcpv6.go b/dhcpv6/dhcpv6.go
index 97eb401..9e24322 100644
--- a/dhcpv6/dhcpv6.go
+++ b/dhcpv6/dhcpv6.go
@@ -7,6 +7,7 @@ import (
type DHCPv6 interface {
Type() MessageType
ToBytes() []byte
+ String() string
Summary() string
Length() int
}
diff --git a/dhcpv6/dhcpv6relay.go b/dhcpv6/dhcpv6relay.go
index 236a23a..4255d02 100644
--- a/dhcpv6/dhcpv6relay.go
+++ b/dhcpv6/dhcpv6relay.go
@@ -23,6 +23,14 @@ func (r *DHCPv6Relay) MessageTypeToString() string {
return MessageTypeToString(r.messageType)
}
+func (r *DHCPv6Relay) String() string {
+ ret := fmt.Sprintf(
+ "DHCPv6Relay(messageType=%v hopcount=%v, linkaddr=%v, peeraddr=%v, %d options)",
+ r.MessageTypeToString(), r.hopCount, r.linkAddr, r.peerAddr, len(r.options),
+ )
+ return ret
+}
+
func (r *DHCPv6Relay) Summary() string {
ret := fmt.Sprintf(
"DHCPv6Relay\n"+