|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.clackrouter.protocol.data.VNSData net.clackrouter.packets.VNSPacket net.clackrouter.packets.IPPacket
public class IPPacket
Encapsulates an Internet Protocol packet. Defined in RFC 791.
Nested Class Summary | |
---|---|
class |
IPPacket.Header
Encapsulates IP packet header. |
Field Summary | |
---|---|
static byte |
PPROTO_ENCAP
|
static byte |
PPROTO_HELLO
|
static byte |
PROTO_AH
|
static byte |
PROTO_CLACK_OSPF
|
static byte |
PROTO_CLACK_RIP
|
static byte |
PROTO_DSTOPTS
|
static byte |
PROTO_EGP
|
static byte |
PROTO_EON
|
static byte |
PROTO_ESP
|
static byte |
PROTO_FRAGMENT
|
static byte |
PROTO_GGP
|
static byte |
PROTO_HOPOPTS
|
static byte |
PROTO_ICMP
|
static byte |
PROTO_ICMPV6
|
static byte |
PROTO_IDP
|
static byte |
PROTO_IGMP
|
static byte |
PROTO_IP
Protocols |
static byte |
PROTO_IPV6
|
static byte |
PROTO_ND
|
static byte |
PROTO_NONE
|
static byte |
PROTO_PIM
|
static byte |
PROTO_PUP
|
static byte |
PROTO_ROUTING
|
static byte |
PROTO_RSVP
|
static byte |
PROTO_TCP
|
static byte |
PROTO_UDP
|
Fields inherited from class net.clackrouter.packets.VNSPacket |
---|
m_inputInterfaceName, m_length, m_level2Type, m_local_packet, m_nextHopIPAddr, m_nextHopMacAddr, m_outputInterfaceName, m_packetByteBuffer, mParentHeader |
Constructor Summary | |
---|---|
IPPacket(java.nio.ByteBuffer packetByteBuffer)
Constucts an IP packet given valid bytes representing an IP packet, consisting of an IP header and the payload (body). |
Method Summary | |
---|---|
java.nio.ByteBuffer |
getBodyBuffer()
Returns the byte buffer containing the body of an IP packet. |
byte[] |
getBodyBytes()
Returns a byte array that contains the payload of an IP packet. |
int |
getBodyLength()
Returns length, in bytes, of an IP packet's body. |
java.net.InetAddress |
getDestinationAddress()
|
IPPacket.Header |
getHeader()
Returns the header of the IP packet. |
VNSPacket |
getPayload()
|
byte |
getProtocol()
|
java.net.InetAddress |
getSourceAddress()
|
void |
pack()
|
void |
setBodyBuffer(java.nio.ByteBuffer new_bb)
|
java.lang.String |
toString()
Represents an IP packet in a readable format, by field. |
static IPPacket |
wrap(VNSPacket packet,
byte protocol,
java.nio.ByteBuffer srcAddr,
java.nio.ByteBuffer dstAddr)
Creates an IP packet by using the supplied packet as a payload. |
static IPPacket |
wrap(VNSPacket packet,
byte protocol,
java.net.InetAddress srcAddr,
java.net.InetAddress destAddr)
|
Methods inherited from class net.clackrouter.packets.VNSPacket |
---|
addToPath, get16bit, get32bit, getByteBuffer, getInputInterfaceName, getLength, getLevel2Type, getNextHopIPAddress, getNextHopMacAddress, getOutputInterfaceName, getParentHeader, getStringBuffer, isPacket, needsSourceAddress, setByteBuffer, setInputInterfaceName, setLevel2Type, setNeedsSourceAddress, setNextHopIPAddress, setNextHopMacAddress, setOutputInterfaceName, setParentHeader |
Methods inherited from class net.clackrouter.protocol.data.VNSData |
---|
isBanner, isClose, isHWInfo |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final byte PROTO_IP
public static final byte PROTO_HOPOPTS
public static final byte PROTO_ICMP
public static final byte PROTO_IGMP
public static final byte PROTO_GGP
public static final byte PPROTO_ENCAP
public static final byte PROTO_TCP
public static final byte PROTO_EGP
public static final byte PROTO_PUP
public static final byte PROTO_UDP
public static final byte PROTO_IDP
public static final byte PROTO_IPV6
public static final byte PROTO_ROUTING
public static final byte PROTO_FRAGMENT
public static final byte PROTO_RSVP
public static final byte PROTO_ESP
public static final byte PROTO_AH
public static final byte PROTO_ICMPV6
public static final byte PROTO_NONE
public static final byte PROTO_DSTOPTS
public static final byte PPROTO_HELLO
public static final byte PROTO_ND
public static final byte PROTO_EON
public static final byte PROTO_PIM
public static final byte PROTO_CLACK_RIP
public static final byte PROTO_CLACK_OSPF
Constructor Detail |
---|
public IPPacket(java.nio.ByteBuffer packetByteBuffer)
packetByteBuffer
- Byte buffer containing the IP packetMethod Detail |
---|
public void setBodyBuffer(java.nio.ByteBuffer new_bb)
public void pack()
public IPPacket.Header getHeader()
IPPacket.Header
public java.nio.ByteBuffer getBodyBuffer()
public VNSPacket getPayload()
public int getBodyLength()
public byte[] getBodyBytes()
public static IPPacket wrap(VNSPacket packet, byte protocol, java.net.InetAddress srcAddr, java.net.InetAddress destAddr) throws VNSInvalidPacketException
VNSInvalidPacketException
public static IPPacket wrap(VNSPacket packet, byte protocol, java.nio.ByteBuffer srcAddr, java.nio.ByteBuffer dstAddr) throws VNSInvalidPacketException
packet
- Any packet, except IP packetprotocol
- ProtocolsrcAddr
- Source IP addressdstAddr
- Destination IP address
VNSInvalidPacketException
public java.lang.String toString()
toString
in class VNSPacket
public java.net.InetAddress getSourceAddress()
public java.net.InetAddress getDestinationAddress()
public byte getProtocol()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |