mirror of
https://github.com/go-i2p/go-i2p.git
synced 2025-07-05 14:13:30 -04:00
more progress:
* add tunnel crypto * add base boilter plate for tunnel message processing
This commit is contained in:
20
lib/tunnel/message.go
Normal file
20
lib/tunnel/message.go
Normal file
@ -0,0 +1,20 @@
|
||||
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]
|
||||
}
|
Reference in New Issue
Block a user