All Packages  This Package  Class Hierarchy  Class Search  Index

Class edu.utah.janos.nodeos.ProtocolLayer
java.lang.Object
   |
   +----edu.utah.janos.nodeos.ProtocolLayer

  Summary

public abstract class  ProtocolLayer
     extends java.lang.Object
{
          // Fields 3
     private static Hashtable layers;
     private static int maxPacketLength;
     private static ProtocolLayer.PacketRecycler recycler;

          // Constructors 1
     public ProtocolLayer();

          // Methods 15
     static void attachRecycler(ProtocolLayer.PacketRecycler);
     static void detachRecycler(ProtocolLayer.PacketRecycler);
     static ProtocolLayer findLayer(String);
     static int getMaxPacketLength();
     static void installLayer(ProtocolLayer);
     static void recycle(ProtocolLayer.PacketBuffer);

     abstract void attachGenerator(ProtocolLayer.PacketGenerator);
     abstract void attachHandler(ProtocolLayer.PacketHandler) throws IOException;
     abstract ProtocolLayer.PacketAddress createAddress();
     abstract ProtocolLayer.PacketAddressMask createAddressMask();
     abstract void detachGenerator(ProtocolLayer.PacketGenerator);
     abstract void detachHandler(ProtocolLayer.PacketHandler);
     abstract void generatorReady(ProtocolLayer.PacketGenerator);
     abstract String getID();
     abstract int getPacketLength();

          // Inner Classes 7
     public static class ProtocolLayer.PacketAddressFormatException
     static interface ProtocolLayer.PacketAddress
     static interface ProtocolLayer.PacketAddressMask
     static final class ProtocolLayer.PacketBuffer
     abstract static class ProtocolLayer.PacketHandler
     abstract static class ProtocolLayer.PacketGenerator
     static interface ProtocolLayer.PacketRecycler
}

ProtocolLayer is supposed to act as an abstraction for simulating transport layers. Its made up of several interfaces and classes for moving packets through the layer to their destination.


  Cross Reference

Extended By:
UDPLayer

Returned By:
ProtocolLayer.findLayer()





  Fields

· maxPacketLength

Summary  |  Top
   private static int maxPacketLength

The maximum packet length for all the layers. Since packets are exchanged with users of the layers we have to make packets big enough to accomodate all the different protocol layers.


· layers

Summary  |  Top
   private static Hashtable layers

The table of all registered protocol layers.


· recycler

Summary  |  Top
   private static ProtocolLayer.PacketRecycler recycler

The global packet recycler.


  Constructors

· ProtocolLayer

Summary  |  Top

   public ProtocolLayer() 

Default constructor



  Methods

· getMaxPacketLength

Summary  |  Top
   static int getMaxPacketLength() 

Return the current value of maxPacketLength.



· installLayer

Summary  |  Top
   static void installLayer(ProtocolLayer pl) 

Install a new protocol layer, basically, this just makes the layer PACKAGEally available.



· findLayer

Summary  |  Top
   static ProtocolLayer findLayer(String id) 

Find an installed protocol layer with the given name.



· attachRecycler

Summary  |  Top
   static void attachRecycler(ProtocolLayer.PacketRecycler pr) 


· recycle

Summary  |  Top
   static void recycle(ProtocolLayer.PacketBuffer pb) 


· detachRecycler

Summary  |  Top
   static void detachRecycler(ProtocolLayer.PacketRecycler pr) 


· getID

Summary  |  Top
   abstract String getID() 

Return the string identifier for this protocol layer.



· getPacketLength

Summary  |  Top
   abstract int getPacketLength() 

Get the maximum packet length for this protocol layer. This is pretty much for internal use only.



· createAddress

Summary  |  Top
   abstract ProtocolLayer.PacketAddress createAddress() 

Create an address object that is compatible with this protocol layer.



· createAddressMask

Summary  |  Top
   abstract ProtocolLayer.PacketAddressMask createAddressMask() 

Create an address mask object that is compatible with this protocol layer.



· attachHandler

Summary  |  Top
   abstract void attachHandler(ProtocolLayer.PacketHandler ph)  throws IOException

Attach a packet handler to the layer. The source mask for the handler determines what packets will be dispatched to the handler.



· detachHandler

Summary  |  Top
   abstract void detachHandler(ProtocolLayer.PacketHandler ph) 

Detach a packet handler from the layer.



· attachGenerator

Summary  |  Top
   abstract void attachGenerator(ProtocolLayer.PacketGenerator pg) 

Attach a packet generator to the layer. The destination of the packet is determined by the destination address object in the packet generator object.



· generatorReady

Summary  |  Top
   abstract void generatorReady(ProtocolLayer.PacketGenerator pg) 

Signal that a generator has packets and is ready to be serviced.



· detachGenerator

Summary  |  Top
   abstract void detachGenerator(ProtocolLayer.PacketGenerator pg) 

Detach a packet generator from the protocol layer.



All Packages  This Package  Class Hierarchy  Class Search  Index
Freshly brewed Java API Documentation automatically generated with polardoc Version 1.0.7