Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Init ¶
func Init(tunIO io.ReadWriteCloser)
func NewFrameBufs ¶ added in v0.4.0
Types ¶
type Dispatcher ¶
type Dispatcher struct {
// contains filtered or unexported fields
}
Dispatcher reads new encapsulated packets, classifies the packet by source ISD-AS -> source host Addr -> Sess Id and hands it off to the appropriate Worker, starting a new one if none currently exists.
func NewDispatcher ¶ added in v0.4.0
func NewDispatcher(tio io.ReadWriteCloser) *Dispatcher
func (*Dispatcher) Run ¶
func (d *Dispatcher) Run() error
type FrameBuf ¶
type FrameBuf struct {
// contains filtered or unexported fields
}
FrameBuf is a struct used to reassemble encapsulated packets spread over multiple SIG frames. It contains the raw bytes and metadata needed for reassembly.
func (*FrameBuf) ProcessCompletePkts ¶
func (fb *FrameBuf) ProcessCompletePkts()
ProcessCompletePkts write all complete packets in the frame to the wire and sets the correct metadata in case there is a fragment at the end of the frame.
func (*FrameBuf) Processed ¶
Processed returns true if all fragments in the frame have been processed,
func (*FrameBuf) Release ¶
func (fb *FrameBuf) Release()
Release reset the FrameBuf and releases it back to the ringbuf (if set).
func (*FrameBuf) SetProcessed ¶
func (fb *FrameBuf) SetProcessed()
SetProcessed marks a frame as being processed.
type ReassemblyList ¶
type ReassemblyList struct {
// contains filtered or unexported fields
}
ReassemblyList is used to keep a doubly linked list of SIG frames that are outstanding for reassembly. The frames kept in the reassambly list sorted by their sequence numbers. There is always one reassembly list per epoch to ensure that sequence numbers are monotonically increasing.
func NewReassemblyList ¶
func NewReassemblyList(epoch int, capacity int, s sender) *ReassemblyList
NewReassemblyList returns a ReassemblyList object for the given epoch and with given maximum capacity.
func (*ReassemblyList) Insert ¶
func (l *ReassemblyList) Insert(frame *FrameBuf)
Insert inserts a frame into the reassembly list. After inserting the frame at the correct position, Insert tries to reassemble packets that involve the newly added frame. Completely processed frames get removed from the list and released to the pool of frame buffers.
type Worker ¶
type Worker struct { log.Logger Remote *snet.Addr SessId mgmt.SessionType Ring *ringbuf.Ring // contains filtered or unexported fields }
Worker handles decapsulation of SIG frames.
func NewWorker ¶
func NewWorker(remote *snet.Addr, sessId mgmt.SessionType, tunIO io.ReadWriteCloser) *Worker