On Sat, Oct 19, 2002 at 02:17:49PM +0300, Angelin Lazarov Lalev wrote:
> I need to convert some bytes, which are not an internet address, from 
> machine to network byte order (described in RFC1700). I could do it 
> mannualy, assuming a I386 (or some other) architecture, but then my code 
> will be a lot less portable. Is there any function in libc or somewhere 
> else which will do that conversion for me (and will be updated when new 
> architecture is added)?

inet_ntoa(3), inet_aton(3) will do that conversion for you[*].

        Cheers,

        Matthew

[*] Although the man page suggests that nowadays addr2ascii(3) and
ascii2addr(3) should be preferred, but the current implementation of
those functions is based on inet_ntoa(3), inet_aton(3).

-- 
Dr Matthew J Seaman MA, D.Phil.                       26 The Paddocks
                                                      Savill Way
                                                      Marlow
Tel: +44 1628 476614                                  Bucks., SL7 1TH UK

To Unsubscribe: send mail to [EMAIL PROTECTED]
with "unsubscribe freebsd-questions" in the body of the message

Reply via email to