mirror of
https://github.com/soypat/lneto.git
synced 2026-08-21 06:59:04 +00:00
slight changes to tinygo cbnode
This commit is contained in:
@@ -4,26 +4,26 @@ package internet
|
|||||||
|
|
||||||
func makecbnode(s StackNode) cbnode {
|
func makecbnode(s StackNode) cbnode {
|
||||||
return cbnode{
|
return cbnode{
|
||||||
demux: s.Demux,
|
_demux: s.Demux,
|
||||||
encapsulate: s.Encapsulate,
|
_encapsulate: s.Encapsulate,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
type cbnode struct {
|
type cbnode struct {
|
||||||
// Do not access outside of handlers/node logic.
|
// Do not access outside of handlers/node logic.
|
||||||
demux func([]byte, int) error
|
_demux func([]byte, int) error
|
||||||
// Do not access outside of handlers/node logic.
|
// Do not access outside of handlers/node logic.
|
||||||
encapsulate func([]byte, int, int) (int, error)
|
_encapsulate func([]byte, int, int) (int, error)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *cbnode) Encapsulate(carrierData []byte, offsetToIP, offsetToFrame int) (int, error) {
|
func (s *cbnode) Encapsulate(carrierData []byte, offsetToIP, offsetToFrame int) (int, error) {
|
||||||
return s.encapsulate(carrierData, offsetToIP, offsetToFrame)
|
return s._encapsulate(carrierData, offsetToIP, offsetToFrame)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s *cbnode) Demux(carrierData []byte, frameOffset int) error {
|
func (s *cbnode) Demux(carrierData []byte, frameOffset int) error {
|
||||||
return s.demux(carrierData, frameOffset)
|
return s._demux(carrierData, frameOffset)
|
||||||
}
|
}
|
||||||
|
|
||||||
func (s cbnode) IsZeroed() bool {
|
func (s cbnode) IsZeroed() bool {
|
||||||
return s.demux == nil || s.encapsulate == nil
|
return s._demux == nil || s._encapsulate == nil
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user