func (e *endpoint) NICID() tcpip.NICID {
	return e.nicid
}
NICID returns the ID of the NIC this endpoint belongs to.
package ipv4
import (
	"log"
	"sync/atomic"
	"github.com/brewlin/net-protocol/pkg/buffer"
	tcpip "github.com/brewlin/net-protocol/protocol"
	"github.com/brewlin/net-protocol/protocol/header"
	"github.com/brewlin/net-protocol/protocol/network/fragmentation"
	"github.com/brewlin/net-protocol/protocol/network/hash"
	"github.com/brewlin/net-protocol/stack"
)
const (
	ProtocolName = "ipv4"
	ProtocolNumber = header.IPv4ProtocolNumber
	maxTotalSize = 0xffff
	buckets = 2048
)
type endpoint struct {
	nicid tcpip.NICID
	id stack.NetworkEndpointID
	linkEP stack.LinkEndpoint
	dispatcher stack.TransportDispatcher
	echoRequests chan echoRequest
	fragmentation *fragmentation.Fragmentation
}
func (p *protocol) NewEndpoint(nicid tcpip.NICID, addr tcpip.Address, linkAddrCache stack.LinkAddressCache,
	dispatcher stack.TransportDispatcher, linkEP stack.LinkEndpoint) (stack.NetworkEndpoint, *tcpip.Error) {
	e := &endpoint{
		nicid:        nicid,
		id:           stack.NetworkEndpointID{LocalAddress: addr},
		linkEP:       linkEP,
		dispatcher:   dispatcher,
		echoRequests: make(chan echoRequest, 10),
		fragmentation: fragmentation.NewFragmentation(fragmentation.HighFragThreshold,
			fragmentation.LowFragThreshold, fragmentation.DefaultReassembleTimeout),
	}
	go e.echoReplier()
	return e, nil
}
func (e *endpoint) DefaultTTL() uint8 {
	return 255
}
func (e *endpoint) MTU() uint32 {
	return calculateMTU(e.linkEP.MTU())
}
func (e *endpoint) Capabilities() stack.LinkEndpointCapabilities {
	return e.linkEP.Capabilities()
}