All of lore.kernel.org
 help / color / mirror / Atom feed
* use getifaddrs()
@ 2012-10-11  8:44 Pietro Paolini
  2012-10-11 17:16 ` Lorenzo Beretta
  0 siblings, 1 reply; 2+ messages in thread
From: Pietro Paolini @ 2012-10-11  8:44 UTC (permalink / raw)
  To: linux-c-programming

Hello,

I'm not sure about the mailing list I should ask this.
I am rewrite a C program in order to make it portable between differents arch and I am a bit confused regarding byte order.

I am getting the list of my interfaces using the getifaddr() functions and it seems return me a list of interfaces with their IP addresses in network byte order instead of host byte order.
It is a regular behavior or I am wrong and confused ?

Many thanks,
Pietro

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: use getifaddrs()
  2012-10-11  8:44 use getifaddrs() Pietro Paolini
@ 2012-10-11 17:16 ` Lorenzo Beretta
  0 siblings, 0 replies; 2+ messages in thread
From: Lorenzo Beretta @ 2012-10-11 17:16 UTC (permalink / raw)
  To: linux-c-programming

On 11/10/2012 10:44, Pietro Paolini wrote:
> Hello,
>
> I'm not sure about the mailing list I should ask this.
> I am rewrite a C program in order to make it portable between differents arch and I am a bit confused regarding byte order.
>
> I am getting the list of my interfaces using the getifaddr() functions and it seems return me a list of interfaces with their IP addresses in network byte order instead of host byte order.
> It is a regular behavior or I am wrong and confused ?
>
> Many thanks,
> Pietro
> --
> To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>

Regular -- I'm not sure about getifaddrs, but most (all?) socket 
functions do the same, so sometimes (as in this case it sems) it's just 
assumed to be the default.
In general you can just check the manpage:
1. from your system -- "man getifaddrs"
2. from the posix std online
3. from www.freebsd.org -- its manpages section actually lets you look 
at manpages from a *lot* of unices (*BSD, linux, solaris, ...), it's 
very very handy


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2012-10-11 17:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-10-11  8:44 use getifaddrs() Pietro Paolini
2012-10-11 17:16 ` Lorenzo Beretta

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.