From e5c11e1cc2c30d097cf52ce8c936c58b9c595b2f Mon Sep 17 00:00:00 2001 From: JackDoan Date: Tue, 16 Dec 2025 11:07:30 -0600 Subject: [PATCH] tidy --- interface.go | 1 - packet/outpacket.go | 11 +++-------- packet/virtio.go | 11 ----------- 3 files changed, 3 insertions(+), 20 deletions(-) diff --git a/interface.go b/interface.go index cdf0d42..241c0c0 100644 --- a/interface.go +++ b/interface.go @@ -297,7 +297,6 @@ func (f *Interface) listenOut(q int) { li.ListenOut(func(pkts []*packet.Packet) { toSend = toSend[:0] for i := range outPackets { - outPackets[i].Valid = false outPackets[i].SegCounter = 0 } diff --git a/packet/outpacket.go b/packet/outpacket.go index 3ae13bb..ae2cc51 100644 --- a/packet/outpacket.go +++ b/packet/outpacket.go @@ -10,11 +10,9 @@ type OutPacket struct { SegmentPayloads [][]byte SegmentHeaders [][]byte SegmentIDs []uint16 - //todo virtio header? - SegSize int - SegCounter int - Valid bool - wasSegmented bool + + SegSize int + SegCounter int Scratch []byte } @@ -35,12 +33,9 @@ func (pkt *OutPacket) Reset() { pkt.SegmentHeaders = pkt.SegmentHeaders[:0] pkt.SegmentIDs = pkt.SegmentIDs[:0] pkt.SegSize = 0 - pkt.Valid = false - pkt.wasSegmented = false } func (pkt *OutPacket) UseSegment(segID uint16, seg []byte, isV6 bool) int { - pkt.Valid = true pkt.SegmentIDs = append(pkt.SegmentIDs, segID) pkt.Segments = append(pkt.Segments, seg) //todo do we need this? diff --git a/packet/virtio.go b/packet/virtio.go index d03bd86..e07a8ae 100644 --- a/packet/virtio.go +++ b/packet/virtio.go @@ -9,7 +9,6 @@ type VirtIOPacket struct { Header virtio.NetHdr Chains []uint16 ChainRefs [][]byte - // OfferDescriptorChains(chains []uint16, kick bool) error } func NewVIO() *VirtIOPacket { @@ -25,13 +24,3 @@ func (v *VirtIOPacket) Reset() { v.ChainRefs = v.ChainRefs[:0] v.Chains = v.Chains[:0] } - -type VirtIOTXPacket struct { - VirtIOPacket -} - -func NewVIOTX(isV4 bool) *VirtIOTXPacket { - out := new(VirtIOTXPacket) - out.VirtIOPacket = *NewVIO() - return out -}