Add tcpip.AddressWithPrefix.String

PiperOrigin-RevId: 263436592
This commit is contained in:
Tamir Duberstein 2019-08-14 15:00:58 -07:00 committed by gVisor bot
parent 570fb1db6b
commit 69d1414a32
1 changed files with 5 additions and 0 deletions

View File

@ -1072,6 +1072,11 @@ type AddressWithPrefix struct {
PrefixLen int
}
// String implements the fmt.Stringer interface.
func (a AddressWithPrefix) String() string {
return fmt.Sprintf("%s/%d", a.Address, a.PrefixLen)
}
// ProtocolAddress is an address and the network protocol it is associated
// with.
type ProtocolAddress struct {