Package org.gudy.azureus2.plugins.ipfilter

Examples of org.gudy.azureus2.plugins.ipfilter.IPFilter


      final String color){

    Thread makeFilter = new Thread() {
      public void run() {
        try{
          IPFilter ipf = new IPFilterImpl();
          RGB rgb = Utils.getRGB(color);
          if (!ipf.isInRange(peerIP)){
            //peer.setSnubbed(true);
            //System.out.println(Utils.parseString(peerID) + " : Blocked -- Peer: " + peerClient);
            IPRange ipr = Plugin.getPluginInterface().getIPFilter().createRange(true);
            ipr.setStartIP(peerIP);
            ipr.setEndIP(peerIP);
            ipr.setDescription("Stuffer - " + Utils.parseString(peerClient) + " Killed"+ " c#" + Utils.getHexfromRGB(rgb));
            ipr.checkValid();
            ipf.addRange(ipr);
            if(Plugin.getTab1() != null){
              Plugin.getTab1().addElement(peerIP,peerID,peerClient,downloadName, color);
              Plugin.getTab1().totalChange();
            }
View Full Code Here



        if(!Plugin.config_getter.getPluginBooleanParameter("stuffer_noauto",false))
        {

          IPFilter ipf = new IPFilterImpl();
          IPRange[] ipr = ipf.getRanges();
          for(int i = 0; i < ipr.length; i++){
            if (ipr[i].getDescription().startsWith("Stuffer") || ipr[i].getDescription().startsWith("stuffer")){
              ipr[i].delete();
              if(Plugin.getTab1() != null)
                Plugin.getTab1().addElementPeer(ipr[i].getDescription(), ipr[i].getStartIP(), "Interval");
View Full Code Here


      if(!Plugin.config_getter.getPluginBooleanParameter("stuffer_noauto",false))
      {

        IPFilter ipf = new IPFilterImpl();
        IPRange[] ipr = ipf.getRanges();
        for(int i = 0; i < ipr.length; i++){
          if (ipr[i].getDescription().startsWith("Stuffer")|| ipr[i].getDescription().startsWith("stuffer")){
            ipr[i].delete();
            if(Plugin.getTab1() != null)
              Plugin.getTab1().addElementPeer(ipr[i].getDescription(), ipr[i].getStartIP(), "Interval");
View Full Code Here

  }


  public static void manualPurge(){
    try {
        IPFilter ipf = new IPFilterImpl();
        IPRange[] ipr = ipf.getRanges();
        for(int i = 0; i < ipr.length; i++){
          if (ipr[i].getDescription().startsWith("Stuffer")|| ipr[i].getDescription().startsWith("stuffer")){
            ipr[i].delete();
            if(Plugin.getTab1() != null)
              Plugin.getTab1().addElementPeer(ipr[i].getDescription(), ipr[i].getStartIP(), "Manual");
View Full Code Here

  public MessageStreamEncoderAdapter( MessageStreamEncoder plug_encoder ) {
    this.plug_encoder = plug_encoder;
  }
 
  public com.aelitis.azureus.core.networkmanager.RawMessage[] encodeMessage( com.aelitis.azureus.core.peermanager.messaging.Message message ) {
    Message plug_msg;
   
    if( message instanceof MessageAdapter ) {  //original message created by plugin, unwrap
      plug_msg = ((MessageAdapter)message).getPluginMessage();
    }
    else {
View Full Code Here

 
    throws MessageException
  {
    if ( incoming ){
     
      throw( new MessageException( "Already connected" ));
    }
   
    if ( connecting ){
     
      throw( new MessageException( "Connect already performed" ));
    }
   
    connecting  = true;
   
    if ( closed ){
     
      throw( new MessageException( "Connection has been closed" ));
    }
   
    InetSocketAddress  tcp_ep = endpoint.getTCP();
       
    if ( tcp_ep != null ){
     
      connectTCP( initial_data, tcp_ep );
     
    }else{
     
      InetSocketAddress  udp_ep = endpoint.getUDP();

      if ( udp_ep != null ){
       
        connectUDP( initial_data, udp_ep, false );
       
      }else{
       
        throw( new MessageException( "No protocols availabld" ));
      }
    }
  }
View Full Code Here

                delegate.close();
               
              }catch( Throwable e ){
              }
             
              reportFailed( new MessageException( "Connection has been closed" ));

            }else{
             
              reportConnected();
            }
View Full Code Here

              final InetSocketAddress  target,
              Map            reply )
            {
              if ( closed ){
                             
                reportFailed( new MessageException( "Connection has been closed" ));

              }else{
               
                connect_method_count++;

                if ( TEST_TUNNEL ){
                 
                  initial_data.rewind();
                 
                  connectTunnel( initial_data, gen_udp, rendezvous, target );
                 
                }else{
               
                  udp_delegate.connect(
                      initial_data,
                      new GenericMessageConnectionAdapter.ConnectionListener()
                      {
                        private boolean  connected;
                       
                        public void
                        connectSuccess()
                        {
                          connected  = true;
                         
                          setDelegate( udp_delegate );
                         
                          if ( closed ){
                           
                            try{
                              delegate.close();
                             
                            }catch( Throwable e ){                         
                            }
                           
                            reportFailed( new MessageException( "Connection has been closed" ));
                           
                          }else{
                           
                            reportConnected();
                          }                       
                        }
                       
                        public void
                        connectFailure(
                          Throwable failure_msg )
                        {
                          if ( connected ){
                           
                            reportFailed( failure_msg );
                           
                          }else{
                           
                            initial_data.rewind();
 
                            connectTunnel( initial_data, gen_udp, rendezvous, target );
                          }
                        }
                      });
                }
              }
            }
           
            public void
            failed(
              int      failure_type )
            {
              reportFailed( new MessageException( "UDP connection attempt failed - NAT traversal failed (" + NATTraversalObserver.FT_STRINGS[ failure_type ] + ")"));
            }
           
            public void
            failed(
              Throwable   cause )
            {
              reportFailed( cause );
            }
           
            public void
            disabled()
            {
              reportFailed( new MessageException( "UDP connection attempt failed as DDB is disabled" ));
            }
          });
    }else{
 
      udp_delegate.connect(
          initial_data,
          new GenericMessageConnectionAdapter.ConnectionListener()
          {
            private boolean  connected;
           
            public void
            connectSuccess()
            {
              connected  = true;
             
              setDelegate( udp_delegate );
             
              if ( closed ){
               
                try{
                  delegate.close();
                 
                }catch( Throwable e ){ 
                }
               
                reportFailed( new MessageException( "Connection has been closed" ));

              }else{
               
                reportConnected();
              }
View Full Code Here

               
              }catch( Throwable e ){
               
              }
             
              reportFailed( new MessageException( "Connection has been closed" ));

            }else{
             
              reportConnected();
            }
View Full Code Here

  {
    int  size = ((PooledByteBufferImpl)message).getBuffer().remaining( DirectByteBuffer.SS_EXTERNAL );
   
    if ( size > getMaximumMessageSize()){
     
      throw( new MessageException( "Message is too large: supplied is " + size + ", maximum is " + getMaximumMessageSize()));
    }
   
    delegate.send( message );
  }
View Full Code Here

TOP

Related Classes of org.gudy.azureus2.plugins.ipfilter.IPFilter

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.