[Olsr-dev] Serialize and Deserialize message
Henning Rogge
(spam-protected)
Fri Mar 26 15:40:15 CET 2010
Am Freitag 26 März 2010 15:28:54 schrieb Airton Ishimori:
> Hey,
>
> In the last times, I have problem with olsrd execution, but this problem is
> solucioned. Thanks the all peoples that help me.
How was the problem resolved ?
> But now, I am have other challenge. How to serialize and deserialize
> message in C to sent inside the network? Most specifically, int (size 32
> bit and 16 bit) and float type?
For int/short just use "htonl/htons" for serialization and "ntohl/ntohs" for
deserialization. I would NOT try to serialize floating points, that can be a
real pain. OLSRd use a format defined in the RFC to encode vtimes into a
single byte value.
> Another question, the olsrd works with time in ms or seconds? and both
> works with float type or int type?
Olsrd works with an internal circular time (based on gettimesofday()) measured
in milliseconds. The scheduler makes sure that the time will only step forward
and not backward.
Henning
--
1) You can't win.
2) You can't break even.
3) You can't leave the game.
— The Laws of Thermodynamics, summarized
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: This is a digitally signed message part.
URL: <http://lists.olsr.org/pipermail/olsr-dev/attachments/20100326/eeceee04/attachment.sig>
More information about the Olsr-dev
mailing list