On Mon, 2007-08-20 at 14:51 +0100, Joao wrote:
[...]
> I've noticed that in the definition of  struct tcmsg neigh_info neigh[1] 
> was used to allocate IP addresses. Is there any advantage of using this 
> instead of a regular pointer?

If you refer to the definition in olsr_protocol.h:
Yes, because the above is an array of 1 element - and not a pointer
(read: the address of) to an one or more such elements.

The struct's there define the sequence of bytes in a message - therefore
the __attribute__ ((packed)) is there since you don't want padding
somewhere.
And 1 element arrays are often used in that situation as "here come
several of these elements" so that they can be indexed.

	Bernd
-- 
Firmix Software GmbH                   http://www.firmix.at/
mobil: +43 664 4416156                 fax: +43 1 7890849-55
          Embedded Linux Development and Services




