mirror of
https://github.com/soypat/lneto.git
synced 2026-08-21 15:09:05 +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:
@@ -79,3 +79,11 @@ func BytesEqual(a, b []byte) bool {
|
||||
}
|
||||
return unsafe.String(&a[0], len(a)) == unsafe.String(&b[0], len(b))
|
||||
}
|
||||
|
||||
func SliceDequeueFront[T any](a *[]T) T {
|
||||
s := *a
|
||||
v := s[0]
|
||||
n := copy(s, s[1:])
|
||||
*a = s[:n]
|
||||
return v
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user