func (e *countedEndpoint) WritePackets(r *stack.Route, _ *stack.GSO, hdrs []stack.PacketDescriptor, payload buffer.VectorisedView, protocol tcpip.NetworkProtocolNumber) (int, *tcpip.Error) {
	e.writeCount += len(hdrs)
	return len(hdrs), nil
}
WritePackets implements stack.LinkEndpoint.WritePackets.
package waitable
import (
	"testing"
	"github.com/google/netstack/tcpip"
	"github.com/google/netstack/tcpip/buffer"
	"github.com/google/netstack/tcpip/stack"
)
type countedEndpoint struct {
	dispatchCount int
	writeCount    int
	attachCount   int
	mtu          uint32
	capabilities stack.LinkEndpointCapabilities
	hdrLen       uint16
	linkAddr     tcpip.LinkAddress
	dispatcher stack.NetworkDispatcher
}
func (e *countedEndpoint) DeliverNetworkPacket(linkEP stack.LinkEndpoint, remote, local tcpip.LinkAddress, protocol tcpip.NetworkProtocolNumber, pkt tcpip.PacketBuffer) {
	e.dispatchCount++
}
func (e *countedEndpoint) Attach(dispatcher stack.NetworkDispatcher) {
	e.attachCount++
	e.dispatcher = dispatcher
}
func (e *countedEndpoint) IsAttached() bool {
	return e.dispatcher != nil
}
func (e *countedEndpoint) MTU() uint32 {
	return e.mtu
}
func (e *countedEndpoint) Capabilities() stack.LinkEndpointCapabilities {
	return e.capabilities
}
func (e *countedEndpoint) MaxHeaderLength() uint16 {
	return e.hdrLen
}
func (e *countedEndpoint) LinkAddress() tcpip.LinkAddress {
	return e.linkAddr
}
func (e *countedEndpoint) WritePacket(r *stack.Route, _ *stack.GSO, protocol tcpip.NetworkProtocolNumber, pkt tcpip.PacketBuffer) *tcpip.Error {
	e.writeCount++
	return nil
}