mirror of
https://github.com/slackhq/nebula.git
synced 2025-11-22 16:34:25 +01:00
24 lines
440 B
Go
24 lines
440 B
Go
package packet
|
|
|
|
type OutPacket struct {
|
|
Segments [][]byte
|
|
//todo virtio header?
|
|
SegSize int
|
|
SegCounter int
|
|
Valid bool
|
|
wasSegmented bool
|
|
|
|
Scratch []byte
|
|
}
|
|
|
|
func NewOut() *OutPacket {
|
|
out := new(OutPacket)
|
|
const numSegments = 64
|
|
out.Segments = make([][]byte, numSegments)
|
|
for i := 0; i < numSegments; i++ { //todo this is dumb
|
|
out.Segments[i] = make([]byte, Size)
|
|
}
|
|
out.Scratch = make([]byte, Size)
|
|
return out
|
|
}
|