mirror of
https://github.com/soypat/lneto.git
synced 2026-09-10 08:39:30 +00:00
Lay out device/stack interfaces - Netdev/Netlink (#92)
* good code today * add netdev.Runner * round off APIs more * better interface method documentation * improve DHCP netstack API * add pico w netdev example * remove temp file * keep thinking about this. this is hard :/ * fix ci * small fixer * working dhcp * fix rebase API mismatches * begin adding espradio example * keep working on espradio, icmp not working * fix icmp by fixing dhcp
This commit is contained in:
@@ -119,6 +119,7 @@ func (s *StackAsync) IngressEthernet(ethernetFrame []byte) error {
|
||||
defer s.mu.Unlock()
|
||||
s.stats.TotalReceived += uint64(len(ethernetFrame))
|
||||
err := s.link.Demux(ethernetFrame, 0)
|
||||
debugPacket("IN ", ethernetFrame)
|
||||
if err == nil {
|
||||
s.arpt.learnFromIngressEthernet(ethernetFrame)
|
||||
}
|
||||
@@ -132,6 +133,9 @@ func (s *StackAsync) EgressEthernet(dstEthernetFrame []byte) (int, error) {
|
||||
defer s.mu.Unlock()
|
||||
n, err := s.link.Encapsulate(dstEthernetFrame, -1, 0)
|
||||
s.stats.TotalSent += uint64(n)
|
||||
if n > 0 {
|
||||
debugPacket("OUT", dstEthernetFrame[:n])
|
||||
}
|
||||
return n, err
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user