Complete.Org: Mailing Lists: Archives: freeciv-dev: July 1999:
Re: [Freeciv-Dev] Endianess of packet data
Home

Re: [Freeciv-Dev] Endianess of packet data

[Top] [All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: David Pfitzner <dwp@xxxxxxxxxxxxxx>
Cc: freeciv-dev@xxxxxxxxxxxx
Subject: Re: [Freeciv-Dev] Endianess of packet data
From: Mitch Davis <mjd@xxxxxxxxxx>
Date: Fri, 16 Jul 1999 13:40:14 +1000

David Pfitzner wrote:
> 
> Which is why freeciv packets, to be machine independent, use a
> standard order ("network byte order") instead of the native
> endianness of the machine being used.

As lots of you know, there is a standard set of macros that people
can use to ensure that a packet has network-byte-order.

These standard macros are (usually) in #include <netinet/in.h>,
and are called htonl, htons, ntohl and ntohs.  These are no-ops
on big-endian machines.

Regards,

Mitch.
--
| mailto:mjd@xxxxxxxxxx       | Not the official view of: |
| mailto:mjd@xxxxxxxxxxxxxxxx | Australian Calculator Opn |
| Certified Linux Evangelist! | Hewlett Packard Australia |

[Prev in Thread] Current Thread [Next in Thread]