[Freeciv-Dev] 1.8.0 and network byte order
[Top] [All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index] [Thread Index]
To: |
Freeciv Developer Mailing List <freeciv-dev@xxxxxxxxxxx> |
Subject: |
[Freeciv-Dev] 1.8.0 and network byte order |
From: |
Mitch Davis <mjd@xxxxxxxxxx> |
Date: |
Wed, 03 Mar 1999 11:43:53 +1100 |
Dear Freeciv people,
Greetings to all. I've been a bit quite of late: Holidays, and
been very busy....
In common/packets.c there are routines such as get_int32 and
put_int32 which take data types and convert them into a stream
of bytes, for the Freeciv network packets.
As someone who was working on a Java client pointed out, the
original authors of Freeciv chose the (arguably) wrong way of
representing these, and it is not portably possible to get Freeciv
to talk with the Java client.
The *right* way is to use the htonl/htons/ntohl/ntohs macros
which appear in /usr/include/netinet/in.h on most machines.
These macros convert a native short or int into "network byte
order", and are implemented on each platform so that they are
either a no-op, or do a byte swap, as appropriate.
One of the reasons we didn't make this change earlier to Freeciv
is that it breaks the packet protocol, in a way that not even
capabilities can help. Thus we said we'd save this for 1.8:
http://www.complete.org/mailinglists/archives/freeciv-dev-199811/msg00159.html
Well, 1.8 is here! Can we make those changes now?
Regards,
Mitch.
--
| mailto:mjd@xxxxxxxxxx | Not the official view of: |
| mailto:mjd@xxxxxxxxxxxxxxxx | Australian Calculator Opn |
| Certified Linux Evangelist! | Hewlett Packard Australia |
- [Freeciv-Dev] 1.8.0 and network byte order,
Mitch Davis <=
- Re: [Freeciv-Dev] 1.8.0 and network byte order, Trent Piepho, 1999/03/02
- Re: [Freeciv-Dev] 1.8.0 and network byte order, Mitch Davis, 1999/03/02
- Re: [Freeciv-Dev] 1.8.0 and network byte order, Nicolas Brunel, 1999/03/03
- Re: [Freeciv-Dev] 1.8.0 and network byte order, David Pfitzner, 1999/03/03
- Re: [Freeciv-Dev] 1.8.0 and network byte order, Mitch Davis, 1999/03/03
- Re: [Freeciv-Dev] 1.8.0 and network byte order, Trent Piepho, 1999/03/03
- Re: [Freeciv-Dev] 1.8.0 and network byte order, David Pfitzner, 1999/03/04
- Re: [Freeciv-Dev] 1.8.0 and network byte order, David Pfitzner, 1999/03/04
- Re: [Freeciv-Dev] 1.8.0 and network byte order, Mitch Davis, 1999/03/04
|
|