AXL Software

com.theorem.radserver3.radutil
Class Replay

Object
  extended byReplay

public class Replay
extends Object

Class to replay an Access-Request packet suitable for extraction by PacketDump.

 Usage: Replay filename server [port] secret 
 
The port is optional and defaults to 1812.

The file Replay uses can take packets extracted from the debug log of the form:

<82> -------------------------- Packet About to be Sent ------------------------
<82> Address: 127.0.0.1:1574  Packet Length: 34 Type: Access-Accept(2)
 Cut below this line and place it in a text file. *********
02 52 00 22 1F D7 2B 1C - 10 66 43 16 98 99 F6 19   .R."..+. - .fC.....
72 E9 99 09 0C 06 00 00 - 04 00 12 08 48 6F 77 64   r....... - ....Howd
79 2E 00 00 00 00 00 00 - 00 00 00 00 00 00 00 00   y....... - ........
 
Please see DumpPacket for additional formats Replay will accept. Replay will not play multiple packets in a single text file.

Servers that detect duplicate packets may reject repeated replay attempts that are run frequently.


Constructor Summary
Replay(InetAddress server, int port, String secret, int timeout)
          Constructor to set up the radius client for a packet replay.
 
Method Summary
 int getError()
          Retrieve the error number.
 String getErrorString()
          Retrieve the error string
static void main(String[] args)
          Main method for standalone operation.
 void reset()
          Reset the client for a new replay.
 int send(byte[] packetData)
          Send the raw packet data.
 void setDebug(boolean enable)
          Enable or disable debugging output from the client.
 
Methods inherited from class Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Replay

public Replay(InetAddress server,
              int port,
              String secret,
              int timeout)
       throws SocketException
Constructor to set up the radius client for a packet replay.

Parameters:
server - RADIUS Server address.
port - port number for packet replay.
secret - Shared secret.
timeout - Packet time out in milliseconds.
Method Detail

getError

public int getError()
             throws SocketException
Retrieve the error number. See the RADIUSClient for the error numbers.

Returns:
error number.
Throws:
SocketException

getErrorString

public String getErrorString()
                                throws SocketException
Retrieve the error string

Returns:
error string value.
Throws:
SocketException

main

public static void main(String[] args)
Main method for standalone operation.

Parameters:
args - List of arguments as follows:
filename - name of file containing the hex dump of a packet.
server Name or address of the server.
port If present this is the port number on the server. The default is the authentication port on the server.
secret Shared secret between client and server.

reset

public void reset()
           throws SocketException
Reset the client for a new replay. This will cause the client to send the packet from a different port. If a real duplication is to be sent don't call this as the server may not respect this as a duplicate packet.

Throws:
SocketException

send

public int send(byte[] packetData)
         throws ClientSendException,
                ClientReceiveException
Send the raw packet data.

Parameters:
packetData - Raw RADIUS packet.
Throws:
ClientSendException
ClientReceiveException

setDebug

public void setDebug(boolean enable)
Enable or disable debugging output from the client.

Parameters:
enable - True to enable debugging.

AXL Software

Submit a bug report or feature request

Copyright 1998-2010 AXL Software PO Box 97, Viola, Delaware 19979, U.S.A. All Rights Reserved.