Package org.tinyradius.util

Examples of org.tinyradius.util.RadiusEndpoint


      proxyPacketReceived(request, remoteAddress);
      return null;
    }
   
    // handle auth/acct packet
    RadiusEndpoint radiusClient = new RadiusEndpoint(remoteAddress, sharedSecret);
    RadiusEndpoint radiusServer = getProxyServer(request, radiusClient);
    if (radiusServer != null) {
      // proxy incoming packet to other radius server
      RadiusProxyConnection proxyConnection = new RadiusProxyConnection(radiusServer, radiusClient, request, localAddress.getPort());
      logger.info("proxy packet to " + proxyConnection);
      proxyPacket(request, proxyConnection);
View Full Code Here


        logger.warn("received packet on proxy port without saved proxy connection - duplicate?");
        return;
      }
     
      // retrieve client
      RadiusEndpoint client = proxyConnection.getRadiusClient();
         if (logger.isInfoEnabled()) {
           logger.info("received proxy packet: " + packet);
           logger.info("forward packet to " + client.getEndpointAddress().toString() + " with secret " + client.getSharedSecret());
         }
        
         // remove only own Proxy-State (last attribute)
         packet.removeLastAttribute(33);

         // re-encode answer packet with authenticator of the original packet
         RadiusPacket answer = new RadiusPacket(packet.getPacketType(), packet.getPacketIdentifier(), packet.getAttributes());
         DatagramPacket datagram = makeDatagramPacket(answer, client.getSharedSecret(), client.getEndpointAddress().getAddress(), client.getEndpointAddress().getPort(), proxyConnection.getPacket());       
       
         // send back using correct socket
         DatagramSocket socket;
         if (proxyConnection.getPort() == getAuthPort())
           socket = getAuthSocket();
View Full Code Here

    try {
      InetAddress address = InetAddress.getByAddress(new byte[]{127,0,0,1});
      int port = 10000;
      if (packet instanceof AccountingRequest)
        port = 10001;
      return new RadiusEndpoint(new InetSocketAddress(address, port), "testing123");
    } catch (UnknownHostException uhe) {
      uhe.printStackTrace();
      return null;
    }
  }
View Full Code Here

TOP

Related Classes of org.tinyradius.util.RadiusEndpoint

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.