Documentation ¶
Index ¶
- Variables
- func AppendTunnel(newTarget *NodeIDNData, targetMsg *bufio.Reader, chnl chn.Channel, ...) (io.Reader, <-chan *stream.NestedAESCFB)
- func End(nestedAES *stream.NestedAESCFB) (io.Reader, <-chan *stream.NestedAESCFB)
- func GetKeysNIVs(n []*NodeIDNData) (ivs [][]byte, keys [][]byte, er error)
- func GetPublicKey(ctx context.Context, pid peer.ID) (p *rsa.PublicKey, er error)
- func GetPublicKeyCH(ctx context.Context, pid peer.ID) <-chan PubKeyBundle
- func HeaderBytes(nextPID peer.ID, soln sln.Soln, channelID sln.ChannelID) (b []byte)
- func InitAlerts()
- func KeepOnlyConnectedNodes(ps []peer.ID) (nds []peer.ID)
- func Msg(targetMsg *bufio.Reader, nestedAES *stream.NestedAESCFB) (io.Reader, <-chan *stream.NestedAESCFB)
- func NewAlertListener() (a *alertListener)
- func NewCFBDecrypter(buf *bufio.Reader, symKey []byte) (d cipher.Stream, er error)
- func NewNodeMgr() (nm *nmgr)
- func NewTunnelMgr() (tm *tmgr)
- func RelayStream(remaining []byte, dst network.Stream) (i int, er error)
- func SendChunk(c []byte, s network.Stream) (i int, er error)
- func SetStreamHandler()
- func StartStream(ctx context.Context, pid peer.ID) (s network.Stream, er error)
- func StartTunnel(ticks []*NodeIDNData, targetMsg *bufio.Reader) (io.Reader, <-chan *stream.NestedAESCFB)
- func StreamHandler(s network.Stream)
- func TakeUpToNNodes(nodes []peer.ID, n int) (nds []peer.ID)
- type ErrWMutex
- type Header
- type IpfsNode
- type KeyPacket
- type NodeData
- type NodeID2PublicKey
- type NodeIDNData
- type NodeRegStatus
- type PID2PubKey
- type PayloadType
- type PubKeyBundle
- type Tunnel
Constants ¶
This section is empty.
Variables ¶
View Source
var G_NodeMgr = NewNodeMgr()
View Source
var G_TunnelMgr = NewTunnelMgr()
View Source
var PubKeyCache = new(NodeID2PublicKey)
Functions ¶
func AppendTunnel ¶
func AppendTunnel(newTarget *NodeIDNData, targetMsg *bufio.Reader, chnl chn.Channel, nestedAES *stream.NestedAESCFB) (io.Reader, <-chan *stream.NestedAESCFB)
func End ¶
func End(nestedAES *stream.NestedAESCFB) (io.Reader, <-chan *stream.NestedAESCFB)
func GetKeysNIVs ¶
func GetKeysNIVs(n []*NodeIDNData) (ivs [][]byte, keys [][]byte, er error)
function to extract from slice of NodeIDNData their ivs and keys
func GetPublicKey ¶
func GetPublicKeyCH ¶
func GetPublicKeyCH(ctx context.Context, pid peer.ID) <-chan PubKeyBundle
func HeaderBytes ¶
func InitAlerts ¶
func InitAlerts()
func Msg ¶
func Msg(targetMsg *bufio.Reader, nestedAES *stream.NestedAESCFB) (io.Reader, <-chan *stream.NestedAESCFB)
func NewAlertListener ¶
func NewAlertListener() (a *alertListener)
func NewCFBDecrypter ¶
func NewNodeMgr ¶
func NewNodeMgr() (nm *nmgr)
func NewTunnelMgr ¶
func NewTunnelMgr() (tm *tmgr)
func SetStreamHandler ¶
func SetStreamHandler()
func StartTunnel ¶
func StartTunnel(ticks []*NodeIDNData, targetMsg *bufio.Reader) (io.Reader, <-chan *stream.NestedAESCFB)
These functions are to form the slices for tunnel, msg, etc. Management of the channel/tunnel will be taken care of elsewhere.
func StreamHandler ¶
Types ¶
type KeyPacket ¶
type KeyPacket struct { NIDND *NodeIDNData // contains filtered or unexported fields }
type NodeID2PublicKey ¶
func (*NodeID2PublicKey) CheckCapacity ¶
func (n *NodeID2PublicKey) CheckCapacity()
func (*NodeID2PublicKey) CheckInit ¶
func (n *NodeID2PublicKey) CheckInit()
type NodeIDNData ¶
type NodeIDNData struct { NodeID peer.ID AESKey []byte EncAESKey []byte // encrypted w the rsa pubkey belonging to this node IV []byte }
func GenNodeIDNDatas ¶
func GenNodeIDNDatas(pid2pk *PID2PubKey) (n []*NodeIDNData, er error)
func PrepNodesForStartTunnel ¶
type NodeRegStatus ¶
type NodeRegStatus byte
const ( NeverRegistered NodeRegStatus = iota Registered Unregistered )
type PID2PubKey ¶
func GetPublicKeys ¶
func (*PID2PubKey) GetTarget ¶
func (p *PID2PubKey) GetTarget( target peer.ID) (targetOnly *PID2PubKey, er error)
note: always pick target before picking "first" the purpose of this function is so that we can call GenNodeIDNDatas on targetOnly and p without target to be sure that the resulting pair of slices can be ordered so that target is last
func (*PID2PubKey) PickFirst ¶
func (p *PID2PubKey) PickFirst() (firstOnly *PID2PubKey, er error)
note: always pick target before picking "first" A choice function picking from the map a "first" element
type PayloadType ¶
type PayloadType byte
const ( Relay PayloadType = iota Accept )
func (PayloadType) Byte ¶
func (p PayloadType) Byte() (b byte)
type PubKeyBundle ¶
Click to show internal directories.
Click to hide internal directories.