diff options
author | Anders Broman <anders.broman@ericsson.com> | 2011-10-03 04:53:17 +0000 |
---|---|---|
committer | Anders Broman <anders.broman@ericsson.com> | 2011-10-03 04:53:17 +0000 |
commit | f08f09ecd42493885c2db0e2c97b5d4ffefc0995 (patch) | |
tree | 4d41cf36dedde631475e9d980680375b32c1dd8f /wsutil/crc32.h | |
parent | b7bdb4a98518e64c087d8bcbd4de7b3e476f92b9 (diff) |
From Michael Mann:
Condense all SCTP CRC routines to wsutil/crc32.[ch]. Also made
crc32_ccitt_table not explicitly accessible (must use crc32_ccitt_table_lookup).
https://bugs.wireshark.org/bugzilla/show_bug.cgi?id=6298
svn path=/trunk/; revision=39233
Diffstat (limited to 'wsutil/crc32.h')
-rw-r--r-- | wsutil/crc32.h | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/wsutil/crc32.h b/wsutil/crc32.h index 514a437596..bb998d1c6e 100644 --- a/wsutil/crc32.h +++ b/wsutil/crc32.h @@ -41,14 +41,6 @@ extern "C" { ((crc32c_value & 0x0000ff00) << 8) | \ ((crc32c_value & 0x000000ff) << 24)) -#define CRC32C(c,d) (c=(c>>8)^crc32c_table_lookup((c^(d))&0xFF)) - -extern const guint32 crc32_ccitt_table[256]; - -/** Lookup the crc value in the crc32c_table - @param pos Position in the table. */ -extern guint32 crc32c_table_lookup (guchar pos); - /** Lookup the crc value in the crc32_ccitt_table @param pos Position in the table. */ extern guint32 crc32_ccitt_table_lookup (guchar pos); @@ -60,6 +52,14 @@ extern guint32 crc32_ccitt_table_lookup (guchar pos); @return The CRC32C checksum. */ extern guint32 crc32c_calculate(const void *buf, int len, guint32 crc); +/** Compute CRC32C checksum of a buffer of data without swapping seed crc + or completed checksum + @param buf The buffer containing the data. + @param len The number of bytes to include in the computation. + @param crc The preload value for the CRC32C computation. + @return The CRC32C checksum. */ +extern guint32 crc32c_calculate_no_swap(const void *buf, int len, guint32 crc); + /** Compute CRC32 CCITT checksum of a buffer of data. @param buf The buffer containing the data. @param len The number of bytes to include in the computation. |