Files
go-i2p/lib/tunnel/message.go
2016-06-17 21:07:16 -07:00

21 lines
347 B
Go

package tunnel
import (
"encoding/binary"
"github.com/hkparker/go-i2p/lib/crypto"
)
type TunnelID uint32
// data sent down a tunnel
type TunnelMessage crypto.TunnelData
func (tm TunnelMessage) ID() (tid TunnelID) {
tid = TunnelID(binary.BigEndian.Uint32(tm[:4]))
return
}
func (tm TunnelMessage) IV() crypto.TunnelIV {
return tm[4:20]
}