/*
* CDDL HEADER START
*
* The contents of this file are subject to the terms of the
* Common Development and Distribution License (the "License").
* You may not use this file except in compliance with the License.
*
* You can obtain a copy of the license at usr/src/OPENSOLARIS.LICENSE
* See the License for the specific language governing permissions
* and limitations under the License.
*
* When distributing Covered Code, include this CDDL HEADER in each
* file and include the License file at usr/src/OPENSOLARIS.LICENSE.
* If applicable, add the following below this CDDL HEADER, with the
* fields enclosed by brackets "[]" replaced with your own identifying
* information: Portions Copyright [yyyy] [name of copyright owner]
*
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
/*
* Fast CRC32 calculation algorithm suggested by Ferenc Rakoczi
* (ferenc.rakoczi@sun.com). The basic idea is to look at it
* four bytes (one word) at a time, using four tables. The
* standard algorithm in RFC 3309 uses one table.
*/
/*
* polynomial 0x1EDC6F41L
*/
/* The four CRC tables. */
static uint32_t
{
int i;
for (i = 0; i < 32; i++) {
if (b & 1) {
}
b >>= 1;
}
return (rw);
}
#ifdef _BIG_ENDIAN
/*
* This function is only used for big endian processor.
*/
static uint32_t
{
return (((w >> 24) | ((w >> 8) & 0xff00) | ((w << 8) & 0xff0000) |
(w << 24)));
}
#endif
void
sctp_crc32_init(void)
{
for (i = 0; i < 256; i++) {
crc = reflect_32(i);
for (k = 0; k < 4; k++) {
for (j = 0; j < 8; j++) {
}
#ifdef _BIG_ENDIAN
#else
#endif
}
}
}
static void
{
int i;
for (i = 0; i < len; i++) {
#ifdef _BIG_ENDIAN
#else
#endif
}
}
static void
{
int i;
for (i = 0; i < len; i++) {
}
}
{
int rem;
if (rem != 0) {
}
}
if (len > 3) {
}
if (rem != 0) {
}
return (crc32);
}