mirror of
https://github.com/soypat/lneto.git
synced 2026-08-07 08:23:42 +00:00
ec44889896
* begin adding icmp client * rely on anon structs * add tests * tests passing * icmp fleshed out * rework icmp to include ip addr * rename StackAsync.Demux/Encapsulate to RecvEthernet and SendEthernet * remove legacy unreachable TCP tests * remove uses of deprecated internet.StackNode in preference of lneto.StackNode * documentation * rename methods to signal no I/O happening
29 lines
574 B
Go
29 lines
574 B
Go
//go:build !tinygo
|
|
|
|
package internet
|
|
|
|
import "github.com/soypat/lneto"
|
|
|
|
func makecbnode(s lneto.StackNode) cbnode {
|
|
return cbnode{
|
|
_s: s,
|
|
}
|
|
}
|
|
|
|
type cbnode struct {
|
|
// Do not access outside of handlers/node logic.
|
|
_s lneto.StackNode
|
|
}
|
|
|
|
func (s cbnode) Encapsulate(carrierData []byte, offsetToIP, offsetToFrame int) (int, error) {
|
|
return s._s.Encapsulate(carrierData, offsetToIP, offsetToFrame)
|
|
}
|
|
|
|
func (s cbnode) Demux(carrierData []byte, frameOffset int) error {
|
|
return s._s.Demux(carrierData, frameOffset)
|
|
}
|
|
|
|
func (s cbnode) IsZeroed() bool {
|
|
return s._s == nil
|
|
}
|