Exemplo n.º 1
0
        /*
         * public void SendTunnelGateway( I2NPMessage msg )
         * {
         *  lock ( SendQueue )
         *  {
         *      SendRawQueue.AddFirst( new TunnelGateway( new I2NPHeader16( msg ), SendTunnelId ) );
         *  }
         * }*/

        public I2NPMessage CreateBuildRequest(InboundTunnel replytunnel)
        {
            var vtb = VariableTunnelBuildMessage.BuildOutboundTunnel(TunnelSetup,
                                                                     replytunnel.Destination, replytunnel.GatewayTunnelId,
                                                                     TunnelBuildReplyMessageId);

            //Logging.Log( vtb.ToString() );

            return(vtb);
        }
Exemplo n.º 2
0
        public void Test(InboundTunnel tunnel)
        {
            if (tunnel == null)
            {
                return;
            }

            var test = TestResults.Get(tunnel);

            if (test != null && test.Pass > 0)
            {
                return;
            }
            if (OutstandingTests.Get(tunnel) != null)
            {
                return;
            }

            lock ( InboundTunnels )
            {
                InboundTunnels.AddLast(tunnel);
            }
            TunnelAdded.Set();
        }
Exemplo n.º 3
0
 internal void AddInboundPending(InboundTunnel tunnel)
 {
     lock (InboundPending) InboundPending.Add(tunnel);
 }
Exemplo n.º 4
0
 void RemoveTunnelFromLeaseSet(InboundTunnel tunnel)
 {
     LeaseSet.RemoveLease(tunnel.Destination, tunnel.GatewayTunnelId);
     LeaseSetUpdated(false);
 }
Exemplo n.º 5
0
 void AddTunnelToLeaseSet(InboundTunnel tunnel)
 {
     LeaseSet.AddLease(new I2PLease(tunnel.Destination, tunnel.GatewayTunnelId, new I2PDate(DateTime.UtcNow.AddMinutes(10))));
     Destinations.LocalLeaseSetUpdated(LeaseSet);
     LeaseSetUpdated(PublishDestination);
 }