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

inet_addr.3p (3927B)


  1. '\" et
  2. .TH INET_ADDR "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. inet_addr,
  12. inet_ntoa
  13. \(em IPv4 address manipulation
  14. .SH SYNOPSIS
  15. .LP
  16. .nf
  17. #include <arpa/inet.h>
  18. .P
  19. in_addr_t inet_addr(const char *\fIcp\fP);
  20. char *inet_ntoa(struct in_addr \fIin\fP);
  21. .fi
  22. .SH DESCRIPTION
  23. The
  24. \fIinet_addr\fR()
  25. function shall convert the string pointed to by
  26. .IR cp ,
  27. in the standard IPv4 dotted decimal notation, to an integer value
  28. suitable for use as an Internet address.
  29. .P
  30. The
  31. \fIinet_ntoa\fR()
  32. function shall convert the Internet host address specified by
  33. .IR in
  34. to a string in the Internet standard dot notation.
  35. .P
  36. The
  37. \fIinet_ntoa\fR()
  38. function need not be thread-safe.
  39. .P
  40. All Internet addresses shall be returned in network order (bytes
  41. ordered from left to right).
  42. .P
  43. Values specified using IPv4 dotted decimal notation take one of the
  44. following forms:
  45. .IP "\fRa.b.c.d\fP" 10
  46. When four parts are specified, each shall be interpreted as a byte of
  47. data and assigned, from left to right, to the four bytes of an Internet
  48. address.
  49. .IP "\fRa.b.c\fP" 10
  50. When a three-part address is specified, the last part shall be
  51. interpreted as a 16-bit quantity and placed in the rightmost two bytes
  52. of the network address. This makes the three-part address format
  53. convenient for specifying Class B network addresses as
  54. .BR \(dq128.net.host\(dq .
  55. .IP "\fRa.b\fP" 10
  56. When a two-part address is supplied, the last part shall be interpreted
  57. as a 24-bit quantity and placed in the rightmost three bytes of the
  58. network address. This makes the two-part address format convenient for
  59. specifying Class A network addresses as
  60. .BR \(dqnet.host\(dq .
  61. .IP "\fRa\fP" 10
  62. When only one part is given, the value shall be stored directly in the
  63. network address without any byte rearrangement.
  64. .P
  65. All numbers supplied as parts in IPv4 dotted decimal notation may be
  66. decimal, octal, or hexadecimal, as specified in the ISO\ C standard (that is, a
  67. leading 0x or 0X implies hexadecimal; otherwise, a leading
  68. .BR '0'
  69. implies octal; otherwise, the number is interpreted as decimal).
  70. .SH "RETURN VALUE"
  71. Upon successful completion,
  72. \fIinet_addr\fR()
  73. shall return the Internet address. Otherwise, it shall return (\c
  74. .BR in_addr_t )(\-1).
  75. .P
  76. The
  77. \fIinet_ntoa\fR()
  78. function shall return a pointer to the network address in Internet
  79. standard dot notation.
  80. .SH ERRORS
  81. No errors are defined.
  82. .LP
  83. .IR "The following sections are informative."
  84. .SH "EXAMPLES"
  85. None.
  86. .SH "APPLICATION USAGE"
  87. The return value of
  88. \fIinet_ntoa\fR()
  89. may point to static data that may be overwritten by subsequent calls to
  90. \fIinet_ntoa\fR().
  91. .SH "RATIONALE"
  92. None.
  93. .SH "FUTURE DIRECTIONS"
  94. None.
  95. .SH "SEE ALSO"
  96. .IR "\fIendhostent\fR\^(\|)",
  97. .IR "\fIendnetent\fR\^(\|)"
  98. .P
  99. The Base Definitions volume of POSIX.1\(hy2017,
  100. .IR "\fB<arpa_inet.h>\fP"
  101. .\"
  102. .SH COPYRIGHT
  103. Portions of this text are reprinted and reproduced in electronic form
  104. from IEEE Std 1003.1-2017, Standard for Information Technology
  105. -- Portable Operating System Interface (POSIX), The Open Group Base
  106. Specifications Issue 7, 2018 Edition,
  107. Copyright (C) 2018 by the Institute of
  108. Electrical and Electronics Engineers, Inc and The Open Group.
  109. In the event of any discrepancy between this version and the original IEEE and
  110. The Open Group Standard, the original IEEE and The Open Group Standard
  111. is the referee document. The original Standard can be obtained online at
  112. http://www.opengroup.org/unix/online.html .
  113. .PP
  114. Any typographical or formatting errors that appear
  115. in this page are most likely
  116. to have been introduced during the conversion of the source files to
  117. man page format. To report such errors, see
  118. https://www.kernel.org/doc/man-pages/reporting_bugs.html .