SSF.OS
Class ICMP

java.lang.Object
  |
  +--SSF.OS.ProtocolSession
        |
        +--SSF.OS.ICMP
All Implemented Interfaces:
com.renesys.raceway.DML.Configurable

public class ICMP
extends ProtocolSession
implements com.renesys.raceway.DML.Configurable

This class implements a subset of the ICMP protocol.


Field Summary
static int ICMP_CODE_HOST_UNREACHABLE
           
static int ICMP_CODE_PORT_UNREACHABLE
           
static int ICMP_CODE_PROTOCOL_UNREACHABLE
           
static int ICMP_DESTINATION_UNREACHABLE
           
static int ICMP_ECHO_REQUEST
           
static int ICMP_ECHO_RESPONSE
           
static int ICMP_PARAMETER_FAULT
           
static int ICMP_REDIRECT
           
static int ICMP_SOURCE_QUENCH
           
static int ICMP_TIME_EXCEEDED
           
static int ICMP_TIMESTAMP_REQUEST
           
static int ICMP_TIMESTAMP_RESPONSE
           
 
Fields inherited from class SSF.OS.ProtocolSession
name, use
 
Constructor Summary
ICMP()
           
 
Method Summary
 void config(com.renesys.raceway.DML.Configuration cfg)
          Configure this ProtocolSession.
 void finished(ProtocolSession listener)
           
 void init()
          Initialization routine, called by the ProtocolGraph after instantiation.
 void listen(ProtocolSession listener)
           
 int ping(int len, int destaddr)
          Send a single ping of 'len' bytes to the given destination IP IP address.
 int ping(int len, int destaddr, int ct, double intervalSeconds)
           
 int ping(int len, int destaddr, int ct, double intervalSeconds, int ttl)
          Send 'ct' pings of 'len' bytes to the given destination IP IP address, one ping every 'intervalSeconds' seconds.
 boolean push(ProtocolMessage message, ProtocolSession fromSession)
          Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession.
static boolean suppressReporting(IpHeader badpkt)
          Returns true if no ICMP message should be generated when an ICMP packet is dropped.
 
Methods inherited from class SSF.OS.ProtocolSession
close, closed, debugIdentifier, inGraph, open, opened, pushAfterDelay, pushAfterDelayFailed, setGraph, version
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

ICMP_ECHO_RESPONSE

public static final int ICMP_ECHO_RESPONSE
See Also:
Constant Field Values

ICMP_DESTINATION_UNREACHABLE

public static final int ICMP_DESTINATION_UNREACHABLE
See Also:
Constant Field Values

ICMP_SOURCE_QUENCH

public static final int ICMP_SOURCE_QUENCH
See Also:
Constant Field Values

ICMP_REDIRECT

public static final int ICMP_REDIRECT
See Also:
Constant Field Values

ICMP_ECHO_REQUEST

public static final int ICMP_ECHO_REQUEST
See Also:
Constant Field Values

ICMP_TIME_EXCEEDED

public static final int ICMP_TIME_EXCEEDED
See Also:
Constant Field Values

ICMP_PARAMETER_FAULT

public static final int ICMP_PARAMETER_FAULT
See Also:
Constant Field Values

ICMP_TIMESTAMP_REQUEST

public static final int ICMP_TIMESTAMP_REQUEST
See Also:
Constant Field Values

ICMP_TIMESTAMP_RESPONSE

public static final int ICMP_TIMESTAMP_RESPONSE
See Also:
Constant Field Values

ICMP_CODE_HOST_UNREACHABLE

public static final int ICMP_CODE_HOST_UNREACHABLE
See Also:
Constant Field Values

ICMP_CODE_PROTOCOL_UNREACHABLE

public static final int ICMP_CODE_PROTOCOL_UNREACHABLE
See Also:
Constant Field Values

ICMP_CODE_PORT_UNREACHABLE

public static final int ICMP_CODE_PORT_UNREACHABLE
See Also:
Constant Field Values
Constructor Detail

ICMP

public ICMP()
Method Detail

suppressReporting

public static boolean suppressReporting(IpHeader badpkt)
Returns true if no ICMP message should be generated when an ICMP packet is dropped. ICMP error report packets disappear silently -- no errors about errors!


listen

public void listen(ProtocolSession listener)

finished

public void finished(ProtocolSession listener)

ping

public int ping(int len,
                int destaddr)
         throws ProtocolException
Send a single ping of 'len' bytes to the given destination IP IP address. Returns the integer id of the ping; to hear responses, first call listen(), and look for ICMP ECHO RESPONSE packets with the matching id among those pushed to you.

ProtocolException

ping

public int ping(int len,
                int destaddr,
                int ct,
                double intervalSeconds,
                int ttl)
         throws ProtocolException
Send 'ct' pings of 'len' bytes to the given destination IP IP address, one ping every 'intervalSeconds' seconds. Returns the integer id of the ping; to hear responses, first call listen(), and look for ICMP ECHO RESPONSE packets with the matching id among those pushed to you.

ProtocolException

ping

public int ping(int len,
                int destaddr,
                int ct,
                double intervalSeconds)
         throws ProtocolException
ProtocolException

push

public boolean push(ProtocolMessage message,
                    ProtocolSession fromSession)
             throws ProtocolException
Description copied from class: ProtocolSession
Routine to call when a message is being sent to ("pushed into") this ProtocolSession by another ProtocolSession. The pusher sends a reference to itself in the second argument. This push happens immediately, without any simulation time elapsing, regardless of other activities taking place in the ProtocolGraph.

If you desire "safe" interaction with other CPU activities, even though your push() consumes no measurable/modelable CPU cycles, define the "cpudelay true" attribute for the ProtocolGraph and use pushAfterDelay(message,fromSession,0.0). This will guarantee proper ordering; that is, the framework will wait until the CPU is free before proceeding with the requested push().

Specified by:
push in class ProtocolSession
ProtocolException

config

public void config(com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Description copied from class: ProtocolSession
Configure this ProtocolSession.

Specified by:
config in interface com.renesys.raceway.DML.Configurable
Overrides:
config in class ProtocolSession
com.renesys.raceway.DML.configException

init

public void init()
          throws ProtocolException
Description copied from class: ProtocolSession
Initialization routine, called by the ProtocolGraph after instantiation. The order of initialization of a set of protocols is unspecified, so other methods (like open()) may be called before init(). Resources (like connection tables) that may be needed by open() should therefore be created in the ProtocolSession constructor.

Overrides:
init in class ProtocolSession
ProtocolException