All Packages  This Package  Class Hierarchy  Class Search  Index

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

  Summary

class  pj_DemultiplexKey
     extends java.lang.Object
{
          // Fields 2
     private final Vector segments;
     private int totalLength;

          // Constructors 1
     pj_DemultiplexKey(pj_Flow);

          // Methods 8
     int length();
     void match(int, int, byte[], boolean[]);
     void matchANEP(int, byte, boolean, short);
     void matchIPv4(int, int, int, int);
     void matchTCP(int, int, int);
     void matchUDP(int, int, int);
     int matches(byte[], int, int);
     public String toString();

          // Inner Classes 3
     private abstract static class pj_DemultiplexKey.KeySegment
     protected static class pj_DemultiplexKey.ByteMask
     private static class pj_DemultiplexKey.ANEPHeader
}

A key for matching incoming packets.

Author:
Janos Ministry of Development


  Cross Reference

Extended By:
DemultiplexKey

Returned By:
DemultiplexKey.getNativeKey()





  Fields

· segments

Summary  |  Top
   private final Vector segments

The set of segments that make up this key. The are matched based on their ordering.


· totalLength

Summary  |  Top
   private int totalLength

The approximate length of data that this key will match.


  Constructors

· pj_DemultiplexKey

Summary  |  Top

   pj_DemultiplexKey(pj_Flow flow) 


  Methods

· match

Summary  |  Top
   void match(int offset, 
              int length, 
              byte[] sequence, 
              boolean[] mask) 

Add a segment that matches the given sequence of bytes.

Parameter Description
offset The offset from the previous segment to start matching
length The length of the bytes to match
sequence The sequence of bytes to match
mask If non-null, its a bit mask that indicates which bytes in `sequence' should be matched.



· matchIPv4

Summary  |  Top
   void matchIPv4(int offset, 
                  int source, 
                  int dest, 
                  int protocol) 

Add a segment to match an IPv4 header



· matchUDP

Summary  |  Top
   void matchUDP(int offset, 
                 int srcPort, 
                 int destPort) 

Add a segment to match a UDP header, needs to be preceded by an IPv4 segment



· matchTCP

Summary  |  Top
   void matchTCP(int offset, 
                 int srcPort, 
                 int destPort) 

Add a segment to match a TCP header, needs to be preceded by an IPv4 segment



· matchANEP

Summary  |  Top
   void matchANEP(int offset, 
                  byte version, 
                  boolean allVersions, 
                  short protocolID) 

Add a segment that matches an ANEP header

Parameter Description
offset The offset from the previous segment
version The ANEP version number to match
allVersions Match any version of ANEP
protocolID The protocolID to match



· length

Summary  |  Top
   int length() 

Get the approximate length of the bytes that the can matches on.



· matches

Summary  |  Top
   int matches(byte[] payload, 
               int payloadStart, 
               int payloadLength) 

Test a packet to see if this key matches.

Parameter Description
payload The packet data
payloadStart The place to start matching in `payload'
payloadLength The length of data in payload, including bytes up to payloadStart.

Returns:
0 if there was an error otherwise the index of the first byte after the end of the key.


· toString

Summary  |  Top
   public String toString() 
Overrides:
toString in class Object


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