func (ep *endpoint) GetLocalAddress() (tcpip.FullAddress, *tcpip.Error) {
	return tcpip.FullAddress{}, tcpip.ErrNotSupported
}
GetLocalAddress implements tcpip.Endpoint.GetLocalAddress.
package packet
import (
	"sync"
	"github.com/google/netstack/tcpip"
	"github.com/google/netstack/tcpip/buffer"
	"github.com/google/netstack/tcpip/header"
	"github.com/google/netstack/tcpip/iptables"
	"github.com/google/netstack/tcpip/stack"
	"github.com/google/netstack/waiter"
)
type packet struct {
	packetEntry
	data buffer.VectorisedView
	timestampNS int64
	senderAddr tcpip.FullAddress
}
type endpoint struct {
	stack.TransportEndpointInfo
	stack       *stack.Stack
	netProto    tcpip.NetworkProtocolNumber
	waiterQueue *waiter.Queue
	cooked      bool
	rcvMu         sync.Mutex
	rcvList       packetList
	rcvBufSizeMax int
	rcvBufSize    int
	rcvClosed     bool
	mu         sync.RWMutex
	sndBufSize int
	closed     bool
	stats      tcpip.TransportEndpointStats
}
func NewEndpoint(s *stack.Stack, cooked bool, netProto tcpip.NetworkProtocolNumber, waiterQueue *waiter.Queue) (tcpip.Endpoint, *tcpip.Error) {
	ep := &endpoint{
		stack: s,
		TransportEndpointInfo: stack.TransportEndpointInfo{
			NetProto: netProto,
		},
		cooked:        cooked,
		netProto:      netProto,
		waiterQueue:   waiterQueue,
		rcvBufSizeMax: 32 * 1024,
		sndBufSize:    32 * 1024,
	}
	if err := s.RegisterPacketEndpoint(0, netProto, ep); err != nil {
		return nil, err
	}
	return ep, nil
}
func (ep *endpoint) Close() {
	ep.mu.Lock()
	defer ep.mu.Unlock()
	if ep.closed {
		return
	}
	ep.stack.UnregisterPacketEndpoint(0, ep.netProto, ep)
	ep.rcvMu.Lock()
	defer ep.rcvMu.Unlock()
	ep.rcvClosed = true
	ep.rcvBufSize = 0
	for !ep.rcvList.Empty() {
		ep.rcvList.Remove(ep.rcvList.Front())
	}
	ep.closed = true
	ep.waiterQueue.Notify(waiter.EventHUp | waiter.EventErr | waiter.EventIn | waiter.EventOut)
}
func (ep *endpoint) ModerateRecvBuf(copied int) {}
func (ep *endpoint) IPTables() (iptables.IPTables, error) {
	return ep.stack.IPTables(), nil
}
func (ep *endpoint) Read(addr *tcpip.FullAddress) (buffer.View, tcpip.ControlMessages, *tcpip.Error) {
	ep.rcvMu.Lock()
	if ep.rcvList.Empty() {
		err := tcpip.ErrWouldBlock
		if ep.rcvClosed {
			ep.stats.ReadErrors.ReadClosed.Increment()
			err = tcpip.ErrClosedForReceive
		}
		ep.rcvMu.Unlock()
		return buffer.View{}, tcpip.ControlMessages{}, err
	}
	packet := ep.rcvList.Front()
	ep.rcvList.Remove(packet)
	ep.rcvBufSize -= packet.data.Size()
	ep.rcvMu.Unlock()
	if addr != nil {
		*addr = packet.senderAddr
	}
	return packet.data.ToView(), tcpip.ControlMessages{HasTimestamp: true, Timestamp: packet.timestampNS}, nil
}
func (ep *endpoint) Write(p tcpip.Payloader, opts tcpip.WriteOptions) (int64, <-chan struct{}, *tcpip.Error) {
	return 0, nil, tcpip.ErrInvalidOptionValue
}
func (ep *endpoint) Peek([][]byte) (int64, tcpip.ControlMessages, *tcpip.Error) {
	return 0, tcpip.ControlMessages{}, nil
}
func (*endpoint) Disconnect() *tcpip.Error {
	return tcpip.ErrNotSupported
}
func (ep *endpoint) Connect(addr tcpip.FullAddress) *tcpip.Error {
	return tcpip.ErrNotSupported
}
func (ep *endpoint) Shutdown(flags tcpip.ShutdownFlags) *tcpip.Error {
	return tcpip.ErrNotSupported
}
func (ep *endpoint) Listen(backlog int) *tcpip.Error {
	return tcpip.ErrNotSupported
}
func (ep *endpoint) Accept() (tcpip.Endpoint, *waiter.Queue, *tcpip.Error) {
	return nil, nil, tcpip.ErrNotSupported
}
func (ep *endpoint) Bind(addr tcpip.FullAddress) *tcpip.Error {
	return tcpip.ErrNotSupported
}