add EthLinkPoller;

This commit is contained in:
soypat
2023-12-18 15:56:35 -08:00
parent 731362a0cf
commit 60cdb7fd50
+12 -2
View File
@@ -6,8 +6,8 @@ import (
"time"
)
//go:linkname UseNetdev net.useNetdev
func UseNetdev(dev Stack)
//go:linkname UseStack net.useNetdev
func UseStack(stack Stack)
// GethostByName() errors
var (
@@ -61,6 +61,16 @@ type Link interface {
LinkStatus() LinkStatus
}
type EthLinkPoller interface {
Link
// SendEth sends an Ethernet packet
SendEth(pkt []byte) error
// RecvEthHandle sets recieve Ethernet packet callback function
RecvEthHandle(func(pkt []byte) error)
// PollOne tries to receive one Ethernet packet and returns true if one was
PollOne() (bool, error)
}
type LinkWifi interface {
Link
// Connect device to network