|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.sun.spot.ipv6.GenericPacket
com.sun.spot.ipv6.IPv6Packet
public class IPv6Packet
Basic IPv6 packet that includes an IPv6 header and data payload
| Field Summary | |
|---|---|
static boolean |
debug
|
static int |
HEADER_SIZE
|
| Fields inherited from class com.sun.spot.ipv6.GenericPacket |
|---|
bytes, headerSize, headerStart, length, link_destination, link_source |
| Constructor Summary | |
|---|---|
IPv6Packet()
Creates a new instance of IP6Packet |
|
IPv6Packet(byte[] src,
byte[] dest,
int payloadSize)
Create the full IP packet and initialize the IP header |
|
IPv6Packet(byte[] b,
int start,
int hSize)
Create an IP6Packet with an initial buffer |
|
IPv6Packet(int totalSize)
Creates a new IP6Packet object. |
|
| Method Summary | |
|---|---|
int |
calculatePseudoHeaderChecksum()
Calcualte the checksum of the IPv6 pseudo header |
void |
copy(int pos,
byte[] dst,
int dstPos,
int len)
|
String |
debug()
Returns a String representation of the IPv6 protocol header, including labels for readability and debugging. |
short |
get16(int pos)
|
int |
get32(int pos)
|
byte |
getData(int pos)
|
byte[] |
getDstAddress()
Gets the value of the destination address field of this IPv6 packet |
int |
getFlowLabel()
Gets the flow label field of the IPv6 protocol header |
short |
getHopLimit()
Get the hop limit field from the IPv6 protocol header |
IIPNetworkInterface |
getInterface()
|
int |
getNextHeader()
Gets the value of the next header field in the IPv6 protocol header. |
String |
getNextHeaderString(int hdr)
Returns a string representation of the next header value. |
int |
getPacketEnd()
Returns the index of the last byte in the payload buffer |
byte[] |
getPayloadBytes()
|
int |
getPayloadLength()
Returns the length of the payload portion of the packet. |
byte[] |
getSrcAddress()
Gets the value of the source address field of this IPv6 packet |
int |
getTotalLength()
Returns the total length of this packet. |
short |
getTrafficClass()
Get the Traffic class in the IPv6 protocol header |
int |
getVersion()
Returns the IP version number of this packet. |
void |
resetHopLimit()
|
void |
set16(int pos,
short val)
|
void |
set32(int pos,
int val)
|
void |
setChecksum()
Print an error if someone tries to set the checksum on a raw IP packet. |
void |
setData(int pos,
byte val)
|
void |
setDstAddress(byte[] addr)
Sets the value of the destination address field of this IPv6 packet |
void |
setFlowLabel(int flow)
Sets the flow label field of the IPv6 protocol header |
void |
setHopLimit(short hops)
Set the hop limit field from the IPv6 protocol header |
void |
setInterface(IIPNetworkInterface iface)
|
void |
setNextHeader(byte hdr)
Sets the next header value in the IPv6 protocol header |
void |
setPayloadLength(int len)
Sets the length field of the IP Header |
void |
setSrcAddress(byte[] addr)
Sets the value of the source address field of this IPv6 packet |
void |
setTrafficClass(int c)
Sets the traffic class value in the IPv6 protocol header |
void |
setVersion()
Sets the IP Version field of the packet |
String |
toString()
Returns a string representation of this IPv6 packet. |
| Methods inherited from class com.sun.spot.ipv6.GenericPacket |
|---|
getBytes, getDataOffset, getDataSize, getHeaderOffset, getHeaderSize, getLinkDestination, getLinkSource, setLinkDestination, setLinkSource, toBytes |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final boolean debug
public static final int HEADER_SIZE
| Constructor Detail |
|---|
public IPv6Packet()
public IPv6Packet(byte[] src,
byte[] dest,
int payloadSize)
src - Source Address of this packetdest - Destination Address of this packetpayloadSize - The total IP payload sizepublic IPv6Packet(int totalSize)
IP6Packet object.
totalSize - The total size of this packet.
public IPv6Packet(byte[] b,
int start,
int hSize)
b - The bufferstart - The index at which point the header starts.hSize - The size of the header in bytes| Method Detail |
|---|
public int getVersion()
public void setVersion()
public void resetHopLimit()
public int getPayloadLength()
public int getTotalLength()
public byte[] getPayloadBytes()
public void copy(int pos,
byte[] dst,
int dstPos,
int len)
public byte getData(int pos)
public void setData(int pos,
byte val)
public short get16(int pos)
public void set16(int pos,
short val)
public int get32(int pos)
public void set32(int pos,
int val)
public int getPacketEnd()
public void setPayloadLength(int len)
len - The number of bytes in the IP Payload portion of the packet.public short getTrafficClass()
public void setTrafficClass(int c)
c - the traffic class of this IPv6 packetpublic int getFlowLabel()
public void setFlowLabel(int flow)
flow - the new flow label for this IPv6 packetpublic int getNextHeader()
public void setNextHeader(byte hdr)
hdr - The index into the packet where the next protocol header begins.public short getHopLimit()
public void setHopLimit(short hops)
hops - the maximum number of hops for this IPv6 packetpublic byte[] getSrcAddress()
Inet6Address object. The source address of this packetpublic void setSrcAddress(byte[] addr)
addr - the new source address of this IPv6 packetpublic byte[] getDstAddress()
byte[] representing the address. The destination address of this packetpublic void setDstAddress(byte[] addr)
addr - the new destination address of this IPv6 packetpublic int calculatePseudoHeaderChecksum()
public String getNextHeaderString(int hdr)
hdr - The next header value to be translated.
String object. A String representation of the next header value.public void setInterface(IIPNetworkInterface iface)
public IIPNetworkInterface getInterface()
public String toString()
toString in class ObjectString object. A string of hex values representing the
contents of the IPv6 packet.public String debug()
public void setChecksum()
setChecksum in class GenericPacket
|
SunSPOT API V6.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||