diff --git a/espat/espat.go b/espat/espat.go index ebfc0490f..aca6d7a3e 100644 --- a/espat/espat.go +++ b/espat/espat.go @@ -125,13 +125,6 @@ func (d *Device) NetNotify(cb func(netlink.Event)) { // Not supported } -func (d *Device) SendEth(pkt []byte) error { - return netlink.ErrNotSupported -} - -func (d *Device) RecvEthHandle(handler func(pkt []byte) error) { -} - func (d *Device) GetHostByName(name string) (net.IP, error) { ip, err := d.GetDNS(name) return net.ParseIP(ip), err diff --git a/netlink/bond.go b/netlink/bond.go deleted file mode 100644 index 8f583ca70..000000000 --- a/netlink/bond.go +++ /dev/null @@ -1,15 +0,0 @@ -package netlink - -// Bond aggregates links as one -type Bond struct { - *Bridge -} - -func NewBond(links []Netlinker) *Bond { - return &Bond{Bridge: NewBridge(links)} -} - -func (b *Bond) SendEth(pkt []byte) error { - // Send Ethernet pkt to active link(s) - return nil -} diff --git a/netlink/bridge.go b/netlink/bridge.go deleted file mode 100644 index 6b7d52d3d..000000000 --- a/netlink/bridge.go +++ /dev/null @@ -1,39 +0,0 @@ -package netlink - -import ( - "net" -) - -// Bridge connects links into an Ethernet (L2) broadcast domain -type Bridge struct { - ip net.IP - links []Netlinker - recvEth func([]byte) error -} - -func NewBridge(links []Netlinker) *Bridge { - return &Bridge{links: links} -} - -func (b *Bridge) NetConnect(params *ConnectParams) error { - return nil -} - -func (b *Bridge) NetDisconnect() { -} - -func (b *Bridge) NetNotify(cb func(Event)) { -} - -func (b *Bridge) GetHardwareAddr() (net.HardwareAddr, error) { - return net.HardwareAddr{}, nil -} - -func (b *Bridge) SendEth(pkt []byte) error { - // L2 Forward ethernet pkt to zero of more []links - return nil -} - -func (b *Bridge) RecvEthHandle(handler func(pkt []byte) error) { - b.recvEth = handler -} diff --git a/netlink/netlink.go b/netlink/netlink.go index 71e257756..9cb0ee55b 100644 --- a/netlink/netlink.go +++ b/netlink/netlink.go @@ -98,13 +98,4 @@ type Netlinker interface { // GetHardwareAddr returns device MAC address GetHardwareAddr() (net.HardwareAddr, error) - - // SendEth sends an Ethernet pkt - // TODO describe content of pkt - SendEth(pkt []byte) error - - // RecvEthHandle sets handler for receiving an Ethernet pkt. The - // handler MUST not hold references to the pkt on return. - // TODO describe content of pkt - RecvEthHandle(handler func(pkt []byte) error) } diff --git a/netlink/vlan.go b/netlink/vlan.go deleted file mode 100644 index 7dd716115..000000000 --- a/netlink/vlan.go +++ /dev/null @@ -1,41 +0,0 @@ -package netlink - -import ( - "net" -) - -// Vlan is a virtual LAN -type Vlan struct { - ip net.IP - // Vlan ID - id uint16 - link Netlinker - recvEth func([]byte) error -} - -func NewVlan(id uint16, link Netlinker) *Vlan { - return &Vlan{id: id, link: link} -} - -func (v *Vlan) NetConnect(params *ConnectParams) error { - return nil -} - -func (v *Vlan) NetDisconnect() { -} - -func (v *Vlan) NetNotify(cb func(Event)) { -} - -func (v *Vlan) GetHardwareAddr() (net.HardwareAddr, error) { - return net.HardwareAddr{}, nil -} - -func (v *Vlan) SendEth(pkt []byte) error { - // Prepend VLAN hdr to pkt and send on link - return nil -} - -func (v *Vlan) RecvEthHandle(handler func(pkt []byte) error) { - v.recvEth = handler -} diff --git a/rtl8720dn/rtl8720dn.go b/rtl8720dn/rtl8720dn.go index 81900c69d..fa0f38447 100644 --- a/rtl8720dn/rtl8720dn.go +++ b/rtl8720dn/rtl8720dn.go @@ -315,13 +315,6 @@ func (r *rtl8720dn) NetNotify(cb func(netlink.Event)) { r.notifyCb = cb } -func (r *rtl8720dn) SendEth(pkt []byte) error { - return netlink.ErrNotSupported -} - -func (r *rtl8720dn) RecvEthHandle(handler func(pkt []byte) error) { -} - func (r *rtl8720dn) GetHostByName(name string) (net.IP, error) { if debugging(debugNetdev) { diff --git a/tcpip/netdev.go b/tcpip/netdev.go deleted file mode 100644 index 92efeadbc..000000000 --- a/tcpip/netdev.go +++ /dev/null @@ -1,52 +0,0 @@ -package tcpip - -import ( - "net" - "time" - - "tinygo.org/x/drivers/netdev" -) - -func (s *Stack) GetHostByName(name string) (net.IP, error) { - return net.IP{}, netdev.ErrNotSupported -} - -func (s *Stack) GetIPAddr() (net.IP, error) { - return net.IP{}, netdev.ErrNotSupported -} - -func (s *Stack) Socket(domain int, stype int, protocol int) (int, error) { - return -1, netdev.ErrNotSupported -} - -func (s *Stack) Bind(sockfd int, ip net.IP, port int) error { - return netdev.ErrNotSupported -} - -func (s *Stack) Connect(sockfd int, host string, ip net.IP, port int) error { - return netdev.ErrNotSupported -} - -func (s *Stack) Listen(sockfd int, backlog int) error { - return netdev.ErrNotSupported -} - -func (s *Stack) Accept(sockfd int, ip net.IP, port int) (int, error) { - return -1, netdev.ErrNotSupported -} - -func (s *Stack) Send(sockfd int, buf []byte, flags int, deadline time.Time) (int, error) { - return 0, netdev.ErrNotSupported -} - -func (s *Stack) Recv(sockfd int, buf []byte, flags int, deadline time.Time) (int, error) { - return 0, netdev.ErrNotSupported -} - -func (s *Stack) Close(sockfd int) error { - return netdev.ErrNotSupported -} - -func (s *Stack) SetSockOpt(sockfd int, level int, opt int, value interface{}) error { - return netdev.ErrNotSupported -} diff --git a/tcpip/stack.go b/tcpip/stack.go deleted file mode 100644 index a08b5a955..000000000 --- a/tcpip/stack.go +++ /dev/null @@ -1,20 +0,0 @@ -package tcpip - -import ( - "tinygo.org/x/drivers/netlink" -) - -type Stack struct { - link netlink.Netlinker -} - -func NewStack(link netlink.Netlinker) *Stack { - s := Stack{link: link} - s.link.RecvEthHandle(s.recvEth) - return &s -} - -func (s *Stack) recvEth(pkt []byte) error { - println("recvEth", len(pkt)) - return nil -} diff --git a/wifinina/wifinina.go b/wifinina/wifinina.go index 40c2ab3b5..efcc765cd 100644 --- a/wifinina/wifinina.go +++ b/wifinina/wifinina.go @@ -498,13 +498,6 @@ func (w *wifinina) NetNotify(cb func(netlink.Event)) { w.notifyCb = cb } -func (w *wifinina) SendEth(pkt []byte) error { - return netlink.ErrNotSupported -} - -func (w *wifinina) RecvEthHandle(handler func(pkt []byte) error) { -} - func (w *wifinina) GetHostByName(name string) (net.IP, error) { if debugging(debugNetdev) {