Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 19 Oct 2002 13:47:56 +0200
From:      Erik Trulsson <ertr1013@student.uu.se>
To:        Angelin Lazarov Lalev <alalev@uni-svishtov.bg>
Cc:        questions@freebsd.org
Subject:   Re: C programming help ?
Message-ID:  <20021019114756.GA3069@falcon.midgard.homeip.net>
In-Reply-To: <3DB13F5D.1060908@uni-svishtov.bg>
References:  <3DB13F5D.1060908@uni-svishtov.bg>

next in thread | previous in thread | raw e-mail | index | archive | help
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)?

htonl(3), ntohl(3), htons(3) and ntohs(3) seems to be exactly what you
need.


-- 
<Insert your favourite quote here.>
Erik Trulsson
ertr1013@student.uu.se

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-questions" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021019114756.GA3069>