mirror of
https://github.com/soypat/lneto.git
synced 2026-09-12 17:49:32 +00:00
Add ICMPv4 and lneto.StackNode and deprecate internet.StackNode (#65)
* 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
This commit is contained in:
@@ -6,6 +6,10 @@ import (
|
||||
"github.com/soypat/lneto"
|
||||
)
|
||||
|
||||
const (
|
||||
sizeHeader = 8
|
||||
)
|
||||
|
||||
type Type uint8
|
||||
|
||||
const (
|
||||
@@ -54,7 +58,7 @@ const (
|
||||
)
|
||||
|
||||
func NewFrame(buf []byte) (Frame, error) {
|
||||
if len(buf) < 8 {
|
||||
if len(buf) < sizeHeader {
|
||||
return Frame{}, lneto.ErrShortBuffer
|
||||
}
|
||||
return Frame{buf: buf}, nil
|
||||
|
||||
Reference in New Issue
Block a user