mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-04 13:32:52 -04:00
21 lines
355 B
Go
21 lines
355 B
Go
![]() |
package tunnel
|
||
|
|
||
|
import (
|
||
|
"github.com/bounce-chat/go-i2p/lib/crypto"
|
||
|
"encoding/binary"
|
||
|
)
|
||
|
|
||
|
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]
|
||
|
}
|