1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21
|
/* These routines convert fmmo network to host byte order and back. They */
/* should only be used on machines where the OS does not already define */
/* the relevant functions */
/* Sam Southard, Jr. */
/* Created: 22-Apr-1993 */
unsigned short ntohs (netshort)
unsigned short netshort;
{
unsigned short retval;
retval = (((netshort & 0xFF) << 8) | (netshort >> 8));
return (retval);
}
unsigned short htons (hostshort)
unsigned short hostshort;
{
return (ntohs (hostshort));
}
|