home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #31 / NN_1992_31.iso / spool / comp / sys / amiga / programm / 17751 < prev    next >
Encoding:
Text File  |  1992-12-23  |  1.7 KB  |  51 lines

  1. Path: sparky!uunet!cis.ohio-state.edu!rutgers!ub!dsinc!bagate!cbmvax!bj
  2. From: bj@cbmvax.commodore.com (Brian Jackson - Amiga Networking)
  3. Newsgroups: comp.sys.amiga.programmer
  4. Subject: Re: What is htonl() ?
  5. Message-ID: <38127@cbmvax.commodore.com>
  6. Date: 23 Dec 92 16:29:18 GMT
  7. References: <72250@cup.portal.com> <1107@blue.cis.pitt.edu>
  8. Reply-To: bj@cbmvax.commodore.com (Brian Jackson - Amiga Networking)
  9. Organization: Commodore, West Chester, PA
  10. Lines: 39
  11.  
  12. Benjamin Reich writes:
  13.  
  14. >I am stumped by one line of code:
  15. >
  16. >     *lmark = htonl(*lmark);
  17. >
  18. >I have no idea what this function is or does.  
  19. > [...]
  20. >I would appreciate any info as to what this function does, so that
  21. >I may either emulate it or throw it out.
  22. >
  23. >Benjamin Reich
  24. >Counsellor@cup.portal.com
  25.  
  26. Eric G Stern replies:
  27. >
  28. >htonl() is a function from the BSD networking library.  It converts
  29. >a long from "host byte order" to "network byte order".  This is to
  30. >deal with certain architectures that store four byte objects with
  31. >the least significant byte in the lower byte address, while the
  32. >(BSD) network specifications say that four byte objects (network addresses
  33. >for instance) are stored and transmitted with the most significant byte
  34. >first.  For the Amiga, and most unix-boxes (except DEC) this function
  35. >is probably a no-op.
  36. >
  37. >                Eric Stern
  38.                     
  39. Yup. 
  40.  
  41. #ifdef AMIGA
  42. #define htonl(x)        (x)
  43. #define ntohl(x)        (x)
  44. #endif
  45.  
  46.        +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +  +
  47.        Brian Jackson    Amiga Networking Group, Commodore-Amiga Inc.
  48.                         bj@cbmvax.commodore.com
  49.      {uunet|rutgers}!cbmvax!bj    or   networking@cbmvax.commodore.com
  50.                        uva uvam vivendo varia fit 
  51.