mirror of
https://github.com/soypat/lneto.git
synced 2026-08-21 06:59:04 +00:00
refactor lneto2->lneto package
This commit is contained in:
+2
-2
@@ -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
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user