org.jnetpcap.protocol.network
Class Rip

java.lang.Object
  extended by org.jnetpcap.nio.JMemory
      extended by org.jnetpcap.nio.JBuffer
          extended by org.jnetpcap.packet.JHeader
              extended by org.jnetpcap.protocol.network.Rip
All Implemented Interfaces:
JPayloadAccessor
Direct Known Subclasses:
Rip1

@Header(suite=TCP_IP,
        description="Routing Information Protocol")
public abstract class Rip
extends JHeader

Routing Information Protocol (RIP). This is a baseclass for subclasses Rip1 and Rip2 which parse rip version 1 and version 2 protocols.

Author:
Mark Bednarczyk, Sly Technologies, Inc.

Nested Class Summary
static class Rip.Command
          Valid values for RIP OpCode field.
 
Nested classes/interfaces inherited from class org.jnetpcap.packet.JHeader
JHeader.State
 
Nested classes/interfaces inherited from class org.jnetpcap.nio.JMemory
JMemory.Type
 
Field Summary
protected  int count
          The count.
 
Fields inherited from class org.jnetpcap.packet.JHeader
annotatedHeader, BYTE, EMPTY_HEADER_ARRAY, isSubHeader, packet, state
 
Fields inherited from class org.jnetpcap.nio.JMemory
JNETPCAP_LIBRARY_NAME, MAX_DIRECT_MEMORY_DEFAULT, POINTER
 
Constructor Summary
Rip()
           
 
Method Summary
static boolean bindToUdp(JPacket packet, Udp udp)
          Bind to UDP port 520 which is the default for RIP.
 int command()
          Command.
 java.lang.String commandDescription()
          Command description.
 Rip.Command commandEnum()
          Command enum.
 int count()
          Gets the number of entries in the routing table.
protected  void decodeHeader()
          The routing table is the only thing that needs decoding.
static int headerLength(JBuffer buffer, int offset)
          Header length.
 int version()
          Version.
 
Methods inherited from class org.jnetpcap.packet.JHeader
decode, getAnnotatedHeader, getDescription, getFields, getGap, getGapLength, getGapOffset, getHeader, getHeaderLength, getHeaderOffset, getId, getIndex, getLength, getName, getNextHeaderId, getNextHeaderOffset, getNicname, getOffset, getPacket, getParent, getPayload, getPayloadLength, getPayloadOffset, getPostfix, getPostfixLength, getPostfixOffset, getPrefix, getPrefixLength, getPrefixOffset, getPreviousHeaderId, getPreviousHeaderOffset, getState, getSubHeaders, hasDescription, hasGap, hasNextHeader, hasPayload, hasPostfix, hasPrefix, hasPreviousHeader, hasSubHeaders, isFragmented, isGapTruncated, isHeaderTruncated, isPayloadTruncated, isPostfixTruncated, isPrefixTruncated, peer, peer, peerPayloadTo, setPacket, setSubHeaders, sizeof, toString, transferPayloadTo, transferPayloadTo, transferPayloadTo, validateHeader
 
Methods inherited from class org.jnetpcap.nio.JBuffer
findUTF8String, getByte, getByteArray, getByteArray, getByteArray, getDouble, getFloat, getInt, getLong, getShort, getUByte, getUInt, getUShort, getUTF8Char, getUTF8String, getUTF8String, getUTF8String, getUTF8String, isReadonly, order, order, peer, peer, peer, peer, setByte, setByteArray, setByteBuffer, setDouble, setFloat, setInt, setLong, setShort, setShort0, setUByte, setUInt, setUShort, transferFrom, transferFrom, transferFrom, transferTo, transferTo, transferTo
 
Methods inherited from class org.jnetpcap.nio.JMemory
availableDirectMemory, check, cleanup, createReference, isInitialized, isJMemoryBasedOwner, isOwner, maxDirectMemory, peer, reservedDirectMemory, setSize, size, softDirectMemory, toDebugString, toHexdump, toHexdump, totalActiveAllocated, totalAllocateCalls, totalAllocated, totalAllocatedSegments0To255Bytes, totalAllocatedSegments256OrAbove, totalDeAllocateCalls, totalDeAllocated, transferFrom, transferFrom, transferFromDirect, transferOwnership, transferTo, transferTo, transferTo, transferTo, transferTo, transferTo0
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

count

protected int count
The count.

Constructor Detail

Rip

public Rip()
Method Detail

bindToUdp

@Bind(to=Udp.class)
public static boolean bindToUdp(JPacket packet,
                                                Udp udp)
Bind to UDP port 520 which is the default for RIP.

Parameters:
packet - current packet
udp - udp header within this packet
Returns:
true if binding succeeded or false if failed

headerLength

@HeaderLength
public static int headerLength(JBuffer buffer,
                                            int offset)
Header length.

Parameters:
buffer - the buffer
offset - the offset
Returns:
the int

command

@Field(offset=0,
       length=8)
public int command()
Command.

Returns:
the int

commandDescription

@Dynamic(value=DESCRIPTION)
public java.lang.String commandDescription()
Command description.

Returns:
the string

commandEnum

public Rip.Command commandEnum()
Command enum.

Returns:
the command

count

public int count()
Gets the number of entries in the routing table.

Returns:
count of number of 20 byte entries in the routing table

decodeHeader

protected void decodeHeader()
The routing table is the only thing that needs decoding. The routing table is lazy decoded.

Overrides:
decodeHeader in class JHeader

version

@Field(offset=8,
       length=8)
public int version()
Version.

Returns:
the int