Add a Stringer implementation to PacketDispatchMode

PiperOrigin-RevId: 272083936
This commit is contained in:
Bhasker Hariharan
2019-09-30 15:52:55 -07:00
committed by gVisor bot
parent c06cca6678
commit bcbb3ef317
+13 -1
View File
@@ -82,7 +82,19 @@ const (
PacketMMap
)
// An endpoint implements the link-layer using a message-oriented file descriptor.
func (p PacketDispatchMode) String() string {
switch p {
case Readv:
return "Readv"
case RecvMMsg:
return "RecvMMsg"
case PacketMMap:
return "PacketMMap"
default:
return fmt.Sprintf("unknown packet dispatch mode %v", p)
}
}
type endpoint struct {
// fds is the set of file descriptors each identifying one inbound/outbound
// channel. The endpoint will dispatch from all inbound channels as well as