Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions core/adapter/adapter.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,19 +6,21 @@ import (
"gvisor.dev/gvisor/pkg/tcpip/stack"
)

// TCPConn implements the net.Conn interface.
// TCPConn represents a TCP connection that implements net.Conn
// and exposes its stack.TransportEndpointID.
type TCPConn interface {
net.Conn

// ID returns the transport endpoint id of TCPConn.
ID() *stack.TransportEndpointID
// ID returns the transport endpoint id.
ID() stack.TransportEndpointID
}

// UDPConn implements net.Conn and net.PacketConn.
// UDPConn represents a UDP connection that implements both net.Conn
// and net.PacketConn and exposes its stack.TransportEndpointID.
type UDPConn interface {
net.Conn
net.PacketConn

// ID returns the transport endpoint id of UDPConn.
ID() *stack.TransportEndpointID
// ID returns the transport endpoint id.
ID() stack.TransportEndpointID
}
4 changes: 2 additions & 2 deletions core/tcp.go
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,6 @@ type tcpConn struct {
id stack.TransportEndpointID
}

func (c *tcpConn) ID() *stack.TransportEndpointID {
return &c.id
func (c *tcpConn) ID() stack.TransportEndpointID {
return c.id
}
4 changes: 2 additions & 2 deletions core/udp.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,6 @@ type udpConn struct {
id stack.TransportEndpointID
}

func (c *udpConn) ID() *stack.TransportEndpointID {
return &c.id
func (c *udpConn) ID() stack.TransportEndpointID {
return c.id
}