changed u_long to u_int32_t; some fixes from sunos version