gov.nist.antd.ssf.net
Class InputTrafficMonitor

java.lang.Object
  |
  +--gov.nist.antd.ssf.net.InputTrafficMonitor
All Implemented Interfaces:
InputMonitor

public class InputTrafficMonitor
extends java.lang.Object
implements InputMonitor

Monitor the incoming packets. Provides information about the bandwidth, packet count and bytes received by the _NIC.

 This class was developed at the National Institute of Standards and
 Technology by employees of the Federal Government in the course of
 their official duties. Pursuant to title 17 Section 105 of the United
 States Code this software is not subject to copyright protection and
 is in the public domain.
 NIST assumes no responsibility whatsoever for its use by other parties,
 and makes no guarantees, expressed or implied, about its quality,
 reliability, or any other characteristic.
 
We would appreciate acknowledgement if the software is used.
NIST ALLOWS FREE USE OF THIS SOFTWARE IN ITS "AS IS" CONDITION AND DISCLAIM ANY LIABILITY OF ANY KIND FOR ANY DAMAGES WHATSOEVER RESULTING FROM THE USE OF THIS SOFTWARE.

Author:
borchert
, rouil

Field Summary
private  boolean debug
          Indicates if debug information should be printed.
private  java.text.DecimalFormat fm
          Specifies the format for the time.
private  long frequency
          The frequency of the Network.
private  int hostcode
          The code for the local host.
private  double intervalSec
          The interval between to samples (in seconds).
private  long intervalTick
          The interval between to samples (in tick).
private  Router localHost
          The Router that contains the NIC.
private  NIC nic
          The NIC to monitor.
private  long noBytes
          The number of bytes sent.
private  int pkts
          The number of packets in current interval.
private  SSF.Util.Streams.StreamInterface streamInt
          The stream (Recorder) to write monitor information.
private  int typeCode
          The code for this type of monitor information.
 
Constructor Summary
InputTrafficMonitor()
           
 
Method Summary
 void config(NIC ownerNIC, com.renesys.raceway.DML.Configuration cfg)
          Method called by NIC during model configuration phase if the attribute interface.monitor is present.
 void init()
          Method called by NIC during model initialization phase Any configuration actions depending on other protocols should be done in the "init" phase.
 void receive(ProtocolMessage packet)
          Method called by class implementing SSF.Net.packetQueue when a packet is enqueued.
 void sendRecord()
          Send the information related to this lambda.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

localHost

private Router localHost
The Router that contains the NIC.


nic

private NIC nic
The NIC to monitor.


streamInt

private SSF.Util.Streams.StreamInterface streamInt
The stream (Recorder) to write monitor information.


hostcode

private int hostcode
The code for the local host.


typeCode

private int typeCode
The code for this type of monitor information.


intervalTick

private long intervalTick
The interval between to samples (in tick).


intervalSec

private double intervalSec
The interval between to samples (in seconds).


debug

private boolean debug
Indicates if debug information should be printed.


frequency

private long frequency
The frequency of the Network.


pkts

private int pkts
The number of packets in current interval.


noBytes

private long noBytes
The number of bytes sent.


fm

private java.text.DecimalFormat fm
Specifies the format for the time.

Constructor Detail

InputTrafficMonitor

public InputTrafficMonitor()
Method Detail

config

public void config(NIC ownerNIC,
                   com.renesys.raceway.DML.Configuration cfg)
            throws com.renesys.raceway.DML.configException
Method called by NIC during model configuration phase if the attribute interface.monitor is present. Required attributes:
interface [
    ...
     inputMonitor [
       use "classname"

       ... any user-defined monitor attributes here
     ]
   ]

Specified by:
config in interface InputMonitor
Parameters:
ownerNIC - The NIC to monitor
cfg - The DML configuration of the monitor
com.renesys.raceway.DML.configException

init

public void init()
Method called by NIC during model initialization phase Any configuration actions depending on other protocols should be done in the "init" phase.

Specified by:
init in interface InputMonitor

receive

public void receive(ProtocolMessage packet)
Method called by class implementing SSF.Net.packetQueue when a packet is enqueued.

Specified by:
receive in interface InputMonitor
Parameters:
packet - The ProtocolMessage that entered the queue

sendRecord

public void sendRecord()
Send the information related to this lambda.