refactor lneto2->lneto package

This commit is contained in:
soypat
2025-03-06 23:11:42 -03:00
parent d04d287ab6
commit d5d729b961
17 changed files with 57 additions and 53 deletions
+2 -2
View File
@@ -7,8 +7,8 @@ import (
"net"
"net/netip"
"github.com/soypat/lneto"
"github.com/soypat/lneto/ethernet"
"github.com/soypat/lneto/lneto2"
)
// NewARPFrame returns a ARPFrame with data set to buf.
@@ -135,7 +135,7 @@ func (afrm Frame) SwapTargetSender() {
//
// ValidateSize checks the frame's size fields and compares with the actual buffer
// the frame. It returns a non-nil error on finding an inconsistency.
func (afrm Frame) ValidateSize(v *lneto2.Validator) {
func (afrm Frame) ValidateSize(v *lneto.Validator) {
_, hlen := afrm.Hardware()
_, ilen := afrm.Protocol()
minLen := 8 + 2*(hlen+ilen)
+2 -2
View File
@@ -4,8 +4,8 @@ import (
"bytes"
"errors"
"github.com/soypat/lneto"
"github.com/soypat/lneto/ethernet"
"github.com/soypat/lneto/lneto2"
)
type Handler struct {
@@ -133,7 +133,7 @@ func (c *Handler) Recv(b []byte) error {
if err != nil {
return err
}
var vld lneto2.Validator
var vld lneto.Validator
afrm.ValidateSize(&vld)
if vld.HasError() {
return vld.Err()