renamed client and package to relay
This commit is contained in:
21
pkg/relay/helper-sendexit.go
Normal file
21
pkg/relay/helper-sendexit.go
Normal file
@@ -0,0 +1,21 @@
|
||||
package relay
|
||||
|
||||
import (
|
||||
"git-indra.lan/indra-labs/indra/pkg/crypto/nonce"
|
||||
"git-indra.lan/indra-labs/indra/pkg/onion"
|
||||
"git-indra.lan/indra-labs/indra/pkg/traffic"
|
||||
"git-indra.lan/indra-labs/indra/pkg/util/slice"
|
||||
)
|
||||
|
||||
func (en *Engine) SendExit(port uint16, message slice.Bytes, id nonce.ID,
|
||||
target *traffic.Session, hook func(id nonce.ID, b slice.Bytes)) {
|
||||
|
||||
hops := []byte{0, 1, 2, 3, 4, 5}
|
||||
s := make(traffic.Sessions, len(hops))
|
||||
s[2] = target
|
||||
se := en.Select(hops, s)
|
||||
var c traffic.Circuit
|
||||
copy(c[:], se)
|
||||
o := onion.SendExit(port, message, id, se[len(se)-1], c, en.KeySet)
|
||||
en.SendOnion(c[0].AddrPort, o, hook)
|
||||
}
|
||||
Reference in New Issue
Block a user