|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.jnetpcap.util.checksum.Checksum
public class Checksum
Main base and utility class that provides native methods for calculating various CRC on buffers.
| Constructor Summary | |
|---|---|
Checksum()
|
|
| Method Summary | |
|---|---|
static int |
crc16CCITT(JBuffer buffer,
int offset,
int length)
Calculate CCITT CRC16 checksum using a CRC32 CCITT seed. |
static int |
crc16CCITTContinue(JBuffer buffer,
int offset,
int length,
int crc)
Calculate CCITT 16-bit checksum using a partially calculated CRC16. |
static int |
crc16CCITTSeed(JBuffer buffer,
int offset,
int length,
int seed)
Calculate CCITT 16-bit checksum using a custom seed. |
static int |
crc16X25CCITT(JBuffer buffer,
int offset,
int length)
Calculate CCITT CRC16 X.25 checksum using a CCITT seed. |
static int |
crc32c(JBuffer buffer,
int offset,
int length,
int crc)
Calculate a standard CRC32C checksum using a custom seed. |
static long |
crc32CCITT(JBuffer buffer,
int offset,
int length)
Calculate CCITT CRC32 checksum using a CRC32 CCITT seed. |
static int |
crc32CCITTContinue(JBuffer buffer,
int offset,
int length,
int crc)
Calculate a standard CRC32C checksum using a partially calculated CRC32. |
static int |
crc32CCITTSeed(JBuffer buffer,
int offset,
int length,
int seed)
Calculate CCITT CRC32 checksum using a custom seed. |
static long |
crc32IEEE802(JBuffer buffer,
int offset,
int length)
Calculates IEEE 802 based checksums including ethernet/802.3. |
static long |
flip(long c)
Flips the bytes from LITTLE to BIG ENDIAN. |
static int |
icmp(JBuffer buffer,
int ipOffset,
int icmpOffset)
Icmp. |
static int |
inChecksum(JBuffer buffer,
int offset,
int length)
Calculate a CRC16 using one's complement of one's complement algorithm. |
static int |
inChecksumShouldBe(int checksum,
int calculateChecksum)
Computes what the checksum should be based on calculated checksum and the checksum in the header's checksum field. |
static int |
pseudoTcp(JBuffer buffer,
int ipOffset,
int tcpOffset)
Pseudo tcp. |
static int |
pseudoUdp(JBuffer buffer,
int ipOffset,
int udpOffset)
Pseudo udp. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Checksum()
| Method Detail |
|---|
public static int crc16CCITT(JBuffer buffer,
int offset,
int length)
buffer - buffer to calculate crc onoffset - offset into the bufferlength - length within the buffer
public static int crc16CCITTContinue(JBuffer buffer,
int offset,
int length,
int crc)
buffer - buffer to calculate crc onoffset - offset into the bufferlength - length within the buffercrc - the preload value for the CRC16 computation
public static int crc16CCITTSeed(JBuffer buffer,
int offset,
int length,
int seed)
buffer - buffer to calculate crc onoffset - offset into the bufferlength - length within the bufferseed - starting seed
public static int crc16X25CCITT(JBuffer buffer,
int offset,
int length)
buffer - buffer to calculate crc onoffset - offset into the bufferlength - length within the buffer
public static int crc32c(JBuffer buffer,
int offset,
int length,
int crc)
buffer - buffer to calculate crc onoffset - offset into the bufferlength - length within the buffercrc - the preload value for the CRC32C computation
public static long crc32CCITT(JBuffer buffer,
int offset,
int length)
buffer - buffer to calculate crc onoffset - offset into the bufferlength - length within the buffer
public static int crc32CCITTContinue(JBuffer buffer,
int offset,
int length,
int crc)
buffer - buffer to calculate crc onoffset - offset into the bufferlength - length within the buffercrc - the preload value for the CRC32 computation
public static int crc32CCITTSeed(JBuffer buffer,
int offset,
int length,
int seed)
buffer - buffer to calculate crc onoffset - offset into the bufferlength - length within the bufferseed - starting seed
public static long crc32IEEE802(JBuffer buffer,
int offset,
int length)
buffer - buffer to calculate foroffset - offset into the buffer in byteslength - number of bytes to run calculation on
public static long flip(long c)
c - source value
public static int icmp(JBuffer buffer,
int ipOffset,
int icmpOffset)
buffer - the bufferipOffset - the ip offseticmpOffset - the icmp offset
public static int inChecksum(JBuffer buffer,
int offset,
int length)
buffer - buffer to reach the chunk of dataoffset - offset into the bufferlength - number of bytes to include in calculation
public static int inChecksumShouldBe(int checksum,
int calculateChecksum)
checksum - checksum within the header's fieldcalculateChecksum - checksum that was calculated
public static int pseudoTcp(JBuffer buffer,
int ipOffset,
int tcpOffset)
buffer - the bufferipOffset - the ip offsettcpOffset - the tcp offset
public static int pseudoUdp(JBuffer buffer,
int ipOffset,
int udpOffset)
buffer - the bufferipOffset - the ip offsetudpOffset - the udp offset
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||