simnet
Class SimpleDropPolicy

java.lang.Object
  extended bysimnet.DropPolicy
      extended bysimnet.SimpleDropPolicy
All Implemented Interfaces:
Pluggable

public class SimpleDropPolicy
extends DropPolicy
implements Pluggable

An example of a trivial drop policy. Note that this early dropper will only drop packets that would have been dropped anyway due to lack of space in the transmission buffer.


Field Summary
protected  java.util.Date last
           
protected  int packet_count
           
 
Fields inherited from class simnet.DropPolicy
qsize
 
Constructor Summary
SimpleDropPolicy()
           
 
Method Summary
 boolean earlyDropPacket(Frame f, int remaining_bytes)
          Drop the packet if we don't have enough room.
 boolean prePlugout(java.lang.Object replacement)
          No special cleanup is required.
 
Methods inherited from class simnet.DropPolicy
finalize, initialize, updateSize
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

packet_count

protected int packet_count

last

protected java.util.Date last
Constructor Detail

SimpleDropPolicy

public SimpleDropPolicy()
Method Detail

earlyDropPacket

public boolean earlyDropPacket(Frame f,
                               int remaining_bytes)
Drop the packet if we don't have enough room. Note that this is redundant since this is the same criteria that the link will use to drop the packet anyway. That is, this is just here as an example.

Specified by:
earlyDropPacket in class DropPolicy

prePlugout

public boolean prePlugout(java.lang.Object replacement)
No special cleanup is required.

Specified by:
prePlugout in interface Pluggable
Returns:
if this object can now be removed (was the operation sucessful)