home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!cis.ohio-state.edu!rutgers!ub!dsinc!bagate!cbmvax!bj
- From: bj@cbmvax.commodore.com (Brian Jackson - Amiga Networking)
- Newsgroups: comp.sys.amiga.programmer
- Subject: Re: What is htonl() ?
- Message-ID: <38127@cbmvax.commodore.com>
- Date: 23 Dec 92 16:29:18 GMT
- References: <72250@cup.portal.com> <1107@blue.cis.pitt.edu>
- Reply-To: bj@cbmvax.commodore.com (Brian Jackson - Amiga Networking)
- Organization: Commodore, West Chester, PA
- Lines: 39
-
- Benjamin Reich writes:
-
- >I am stumped by one line of code:
- >
- > *lmark = htonl(*lmark);
- >
- >I have no idea what this function is or does.
- > [...]
- >I would appreciate any info as to what this function does, so that
- >I may either emulate it or throw it out.
- >
- >Benjamin Reich
- >Counsellor@cup.portal.com
-
- Eric G Stern replies:
- >
- >htonl() is a function from the BSD networking library. It converts
- >a long from "host byte order" to "network byte order". This is to
- >deal with certain architectures that store four byte objects with
- >the least significant byte in the lower byte address, while the
- >(BSD) network specifications say that four byte objects (network addresses
- >for instance) are stored and transmitted with the most significant byte
- >first. For the Amiga, and most unix-boxes (except DEC) this function
- >is probably a no-op.
- >
- > Eric Stern
-
- Yup.
-
- #ifdef AMIGA
- #define htonl(x) (x)
- #define ntohl(x) (x)
- #endif
-
- + + + + + + + + + + + + + + + + + + + + +
- Brian Jackson Amiga Networking Group, Commodore-Amiga Inc.
- bj@cbmvax.commodore.com
- {uunet|rutgers}!cbmvax!bj or networking@cbmvax.commodore.com
- uva uvam vivendo varia fit
-