#107 New CRC32 for Ethernet emulation drivers


The current tools/crc32.cc file (used by the two io
drivers io/sc90x/3c90x.cc and io/rtl8139/rtl8139.cc)
contains a lot of unused code and conditional
statements, and, worst of all, it returns an incorrect
CRC when called (you can check this by monitoring the
network with Ethereal).

I submit here two files (crc32.h and crc32.cc) that I
wrote for replacing the existing tools/crc32.h and

This is not a patch : these two files are completely
new. I rewrote them to be as much simple and efficient
as possible, using information found on Internet about
Ethernet CRC32.

If used, two others existing files (tools/crc32defs.h
and tools/crc32table.h) that are only #include'd in the
previous version of crc32.cc, can be completely discarded.

I discarded also the "copyright" comments at the
beginning, as I think that they no longer apply, and I
don't know the PearPc's rules for making new ones from
scratch. I hope that the PearPc team will add the
proper ones if they accept the change. :-)

I kept the "brief CRC tutorial" found at the end of the
old tools/crc32.cc file.

These new files have been compiled and tested by myself
with PearPc. Using them, Ethereal reports the CRC as



  • Anonymous - 2005-07-30

    Replacement files for tools/crc32.h & .cc

  • Anonymous - 2005-07-31

    Logged In: YES

    Note :
    I must add that this will very probably not work with big
    endian host machines, but it looks like that the previous
    code didn't do it either : the __LITTLE_ENDIAN option was
    hard #define'd, and was commented : "FIXME: HACKED / host

    I could easily add big endian support to this if required
    ... but I would be hardly able to test it, as I don't have
    any big endian machine.

    ... unless testing it inside PearPc itself ? :-)


  • Sebastian Biallas

    Logged In: YES

    in cvs

  • Sebastian Biallas

    • status: open --> closed-fixed

Log in to post a comment.