func (l *PacketList) PushFrontList(other *PacketList) {
	l.lazyInit()
	for i, e := other.Len(), other.Back(); i > 0; i, e = i-1, e.Prev() {
		l.insertValue(e.Value, &l.root)
	}
}
PushFrontList inserts a copy of an other list at the front of list l.
The lists l and other may be the same. They must not be nil.
package ackhandler
type PacketElement struct {
	next, prev *PacketElement
	list *PacketList
	Value Packet
}
func (e *PacketElement) Next() *PacketElement {
	if p := e.next; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
func (e *PacketElement) Prev() *PacketElement {
	if p := e.prev; e.list != nil && p != &e.list.root {
		return p
	}
	return nil
}
type PacketList struct {
	root PacketElement  
	len  int            
}
func (l *PacketList) Init() *PacketList {
	l.root.next = &l.root
	l.root.prev = &l.root
	l.len = 0
	return l
}
func NewPacketList() *PacketList { return new(PacketList).Init() }
func (l *PacketList) Len() int { return l.len }
func (l *PacketList) Front() *PacketElement {
	if l.len == 0 {
		return nil
	}
	return l.root.next
}
func (l *PacketList) Back() *PacketElement {
	if l.len == 0 {
		return nil
	}
	return l.root.prev
}
func (l *PacketList) lazyInit() {
	if l.root.next == nil {
		l.Init()
	}
}
func (l *PacketList) insert(e, at *PacketElement) *PacketElement {
	n := at.next
	at.next = e
	e.prev = at
	e.next = n
	n.prev = e
	e.list = l
	l.len++
	return e
}
func (l *PacketList) insertValue(v Packet, at *PacketElement) *PacketElement {
	return l.insert(&PacketElement{Value: v}, at)
}
func (l *PacketList) remove(e *PacketElement) *PacketElement {
	e.prev.next = e.next
	e.next.prev = e.prev
	e.next = nil  
	e.prev = nil  
	e.list = nil
	l.len--
	return e
}
func (l *PacketList) Remove(e *PacketElement) Packet {
	if e.list == l {
		l.remove(e)
	}
	return e.Value
}
func (l *PacketList) PushFront(v Packet) *PacketElement {
	l.lazyInit()
	return l.insertValue(v, &l.root)
}
func (l *PacketList) PushBack(v Packet) *PacketElement {
	l.lazyInit()
	return l.insertValue(v, l.root.prev)
}
func (l *PacketList) InsertBefore(v Packet, mark *PacketElement) *PacketElement {
	if mark.list != l {
		return nil
	}
	return l.insertValue(v, mark.prev)
}
func (l *PacketList) InsertAfter(v Packet, mark *PacketElement) *PacketElement {
	if mark.list != l {
		return nil
	}
	return l.insertValue(v, mark)
}
func (l *PacketList) MoveToFront(e *PacketElement) {
	if e.list != l || l.root.next == e {
		return
	}
	l.insert(l.remove(e), &l.root)
}
func (l *PacketList) MoveToBack(e *PacketElement) {
	if e.list != l || l.root.prev == e {
		return
	}
	l.insert(l.remove(e), l.root.prev)
}
func (l *PacketList) MoveBefore(e, mark *PacketElement) {
	if e.list != l || e == mark || mark.list != l {
		return
	}
	l.insert(l.remove(e), mark.prev)
}
func (l *PacketList) MoveAfter(e, mark *PacketElement) {
	if e.list != l || e == mark || mark.list != l {
		return
	}
	l.insert(l.remove(e), mark)
}
func (l *PacketList) PushBackList(other *PacketList) {
	l.lazyInit()
	for i, e := other.Len(), other.Front(); i > 0; i, e = i-1, e.Next() {
		l.insertValue(e.Value, l.root.prev)
	}
}