Package java.net

Examples of java.net.InetAddress$CacheEntry


                FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "EPRT", null));
            return;
        }

        // get data server
        InetAddress dataAddr = null;
        try {
            dataAddr = InetAddress.getByName(host);
        } catch (UnknownHostException ex) {
            LOG.debug("Unknown host: " + host, ex);
            session
                    .write(LocalizedFtpReply
                            .translate(
                                    session,
                                    request,
                                    context,
                                    FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS,
                                    "EPRT.host", null));
            return;
        }

        // check IP
        if (dataCfg.isActiveIpCheck()) {
            if (session.getRemoteAddress() instanceof InetSocketAddress) {
                InetAddress clientAddr = ((InetSocketAddress) session
                        .getRemoteAddress()).getAddress();
                if (!dataAddr.equals(clientAddr)) {
                    session.write(LocalizedFtpReply.translate(session, request,
                            context, FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "EPRT.mismatch", null));
                    return;
View Full Code Here


        try {
            // 24-10-2007 - added check if PORT or PASV is issued, see
            // https://issues.apache.org/jira/browse/FTPSERVER-110
            DataConnectionFactory connFactory = session.getDataConnection();
            if (connFactory instanceof IODataConnectionFactory) {
                InetAddress address = ((IODataConnectionFactory) connFactory)
                        .getInetAddress();
                if (address == null) {
                    session.write(new DefaultFtpReply(
                            FtpReply.REPLY_503_BAD_SEQUENCE_OF_COMMANDS,
                            "PORT or PASV must be issued first"));
View Full Code Here

        }

        // check IP
        if (dataCfg.isActiveIpCheck()) {
            if (session.getRemoteAddress() instanceof InetSocketAddress) {
                InetAddress clientAddr = ((InetSocketAddress) session
                        .getRemoteAddress()).getAddress();
                if (!address.getAddress().equals(clientAddr)) {
                    session.write(LocalizedFtpReply.translate(session, request,
                            context, FtpReply.REPLY_501_SYNTAX_ERROR_IN_PARAMETERS_OR_ARGUMENTS, "PORT.mismatch", null));
                    return;
View Full Code Here

            //TODO move this block of code into the super class. Also, it makes
            //sense to have this as the first check before checking everything
            //else such as the file and its permissions. 
            DataConnectionFactory connFactory = session.getDataConnection();
            if (connFactory instanceof IODataConnectionFactory) {
                InetAddress address = ((IODataConnectionFactory) connFactory)
                        .getInetAddress();
                if (address == null) {
                    session.write(new DefaultFtpReply(
                            FtpReply.REPLY_503_BAD_SEQUENCE_OF_COMMANDS,
                            "PORT or PASV must be issued first"));
View Full Code Here

    super( _name, _port, _ssl, _apply_ip_filter, _start_up_ready );
   
    boolean  ok = false;
   
    try{
      InetAddress bind_ip = NetworkAdmin.getSingleton().getSingleHomedServiceBindAddress();
     
      String tr_bind_ip = COConfigurationManager.getStringParameter("Bind IP for Tracker", "");
     
      if ( tr_bind_ip.length() >= 7 ){
     
View Full Code Here

     
      while( it.hasNext()){
       
        GenericMessageConnectionIndirect con = (GenericMessageConnectionIndirect)it.next();
 
        InetAddress  originator = con.getEndpoint().getNotionalAddress().getAddress();
       
        Integer  i = (Integer)totals.get( originator );
       
        if ( i == null ){
         
View Full Code Here

   * check that the specified host/ip is allowed
   * @param addr
   * @return
   */
  private boolean isAllowed(InetSocketAddress addr) {
    InetAddress address = addr.getAddress();
    if( checkHost(address.getHostAddress()) )
      return true;
    else if( checkHost(address.getHostName()))
      return true;
    else
      return false;
  }
View Full Code Here

    data_dict.put("m", lt_ext_map);
    data_dict.put("v", client_name);
    data_dict.put("p", new Integer(localTcpPort));
    data_dict.put("e", new Long(require_crypto ? 1L : 0L));
    data_dict.put("upload_only", new Long(manager.isSeeding() && !( ENABLE_LAZY_BITFIELD || manual_lazy_bitfield_control )? 1L : 0L));
    InetAddress defaultV6 = NetworkAdmin.getSingleton().hasIPV6Potential(true) ? NetworkAdmin.getSingleton().getDefaultPublicAddressV6() : null;
    if(defaultV6 != null)
      data_dict.put("ipv6",defaultV6.getAddress());
    LTHandshake lt_handshake = new LTHandshake(
        data_dict, other_peer_bt_lt_ext_version
    );
    connection.getOutgoingMessageQueue().addMessage(lt_handshake, false);
  }
View Full Code Here

    int    address )
  {
    byte[]  bytes = { (byte)(address>>24), (byte)(address>>16),(byte)(address>>8),(byte)address };
   
    try{
      InetAddress  res = InetAddress.getByAddress(bytes);
           
      return( res );
     
    }catch( UnknownHostException e ){
       
View Full Code Here

      StringTokenizer  tok = new StringTokenizer( msg, "," );
     
      int  ttl   = Integer.parseInt( tok.nextToken().trim());
      int  time   = -1;
     
      InetAddress  address;
     
      if ( tok.hasMoreTokens()){
       
        int  i_addr = Integer.parseInt( tok.nextToken().trim());
       
View Full Code Here

TOP

Related Classes of java.net.InetAddress$CacheEntry

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.