compute_checksum (guint8 *in, guint16 ncbytes, guint32 seed)
{
    int no_ulongs;
    guint32 csum=0;
    guint32 temp;

    no_ulongs = ncbytes / 4;
    csum = seed;

    while (no_ulongs-- > 0) {
        temp = ((guint32) (*in++));
        temp |= (((guint32) (*in++)) << 8);
        temp |= (((guint32) (*in++)) << 16);
        temp |= (((guint32) (*in++)) << 24);

        csum ^= temp;
    }

    temp = 0;
    switch (ncbytes % 4) {
    case 3: temp |= (((guint32) (*in++)) << 16);
    /* fall-thru */
    case 2: temp |= (((guint32) (*in++)) << 8);
    /* fall-thru */
    case 1: temp |= ((guint32) (*in++));
    /* fall-thru */
    default: break;
    }

    csum ^= temp;

    return csum;
}
compute_checksum (guint8 *in, guint16 ncbytes, guint32 seed)
{
    int no_ulongs;
    guint32 csum=0;
    guint32 temp;

    no_ulongs = ncbytes / 4;
    csum = seed;

    while (no_ulongs-- > 0) {
        temp = ((guint32) (*in++));
        temp |= (((guint32) (*in++)) << 8);
        temp |= (((guint32) (*in++)) << 16);
        temp |= (((guint32) (*in++)) << 24);

        csum ^= temp;
    }

    temp = 0;
    switch (ncbytes % 4) {
    case 3: temp |= (((guint32) (*in++)) << 16);
     
    case 2: temp |= (((guint32) (*in++)) << 8);
     
    case 1: temp |= ((guint32) (*in++));
     
    default: break;
    }

    csum ^= temp;

    return csum;
}