Files
go-i2p/lib/tunnel/message.go

21 lines
350 B
Go
Raw Normal View History

package tunnel
import (
2016-01-29 07:22:31 -05:00
"encoding/binary"
"github.com/bounce-chat/go-i2p/lib/crypto"
)
type TunnelID uint32
// data sent down a tunnel
type TunnelMessage crypto.TunnelData
func (tm TunnelMessage) ID() (tid TunnelID) {
2016-01-29 07:22:31 -05:00
tid = TunnelID(binary.BigEndian.Uint32(tm[:4]))
return
}
func (tm TunnelMessage) IV() crypto.TunnelIV {
2016-01-29 07:22:31 -05:00
return tm[4:20]
}