logo

oasis-root

Compiled tree of Oasis Linux based on own branch at <https://hacktivis.me/git/oasis/> git clone https://anongit.hacktivis.me/git/oasis-root.git

htonl.3p (2552B)


  1. '\" et
  2. .TH HTONL "3P" 2017 "IEEE/The Open Group" "POSIX Programmer's Manual"
  3. .\"
  4. .SH PROLOG
  5. This manual page is part of the POSIX Programmer's Manual.
  6. The Linux implementation of this interface may differ (consult
  7. the corresponding Linux manual page for details of Linux behavior),
  8. or the interface may not be implemented on Linux.
  9. .\"
  10. .SH NAME
  11. htonl,
  12. htons,
  13. ntohl,
  14. ntohs
  15. \(em convert values between host and network byte order
  16. .SH SYNOPSIS
  17. .LP
  18. .nf
  19. #include <arpa/inet.h>
  20. .P
  21. uint32_t htonl(uint32_t \fIhostlong\fP);
  22. uint16_t htons(uint16_t \fIhostshort\fP);
  23. uint32_t ntohl(uint32_t \fInetlong\fP);
  24. uint16_t ntohs(uint16_t \fInetshort\fP);
  25. .fi
  26. .SH DESCRIPTION
  27. These functions shall convert 16-bit and 32-bit quantities between
  28. network byte order and host byte order.
  29. .P
  30. On some implementations, these functions are defined as macros.
  31. .P
  32. The
  33. .BR uint32_t
  34. and
  35. .BR uint16_t
  36. types are defined in
  37. .IR <inttypes.h> .
  38. .SH "RETURN VALUE"
  39. The
  40. \fIhtonl\fR()
  41. and
  42. \fIhtons\fR()
  43. functions shall return the argument value converted from host to
  44. network byte order.
  45. .P
  46. The
  47. \fIntohl\fR()
  48. and
  49. \fIntohs\fR()
  50. functions shall return the argument value converted from network to
  51. host byte order.
  52. .SH ERRORS
  53. No errors are defined.
  54. .LP
  55. .IR "The following sections are informative."
  56. .SH "EXAMPLES"
  57. None.
  58. .SH "APPLICATION USAGE"
  59. These functions are most often used in conjunction with IPv4 addresses
  60. and ports as returned by
  61. \fIgethostent\fR()
  62. and
  63. \fIgetservent\fR().
  64. .SH "RATIONALE"
  65. None.
  66. .SH "FUTURE DIRECTIONS"
  67. None.
  68. .SH "SEE ALSO"
  69. .IR "\fIendhostent\fR\^(\|)",
  70. .IR "\fIendservent\fR\^(\|)"
  71. .P
  72. The Base Definitions volume of POSIX.1\(hy2017,
  73. .IR "\fB<arpa_inet.h>\fP",
  74. .IR "\fB<inttypes.h>\fP"
  75. .\"
  76. .SH COPYRIGHT
  77. Portions of this text are reprinted and reproduced in electronic form
  78. from IEEE Std 1003.1-2017, Standard for Information Technology
  79. -- Portable Operating System Interface (POSIX), The Open Group Base
  80. Specifications Issue 7, 2018 Edition,
  81. Copyright (C) 2018 by the Institute of
  82. Electrical and Electronics Engineers, Inc and The Open Group.
  83. In the event of any discrepancy between this version and the original IEEE and
  84. The Open Group Standard, the original IEEE and The Open Group Standard
  85. is the referee document. The original Standard can be obtained online at
  86. http://www.opengroup.org/unix/online.html .
  87. .PP
  88. Any typographical or formatting errors that appear
  89. in this page are most likely
  90. to have been introduced during the conversion of the source files to
  91. man page format. To report such errors, see
  92. https://www.kernel.org/doc/man-pages/reporting_bugs.html .