arpa_inet.h(7POSIX)

πŸ’– arpa_inet.h β€” POSIX Programmer's Manual (7POSIX) πŸ’–

okay bestie, so this one is part of the POSIX Programmer's Manual. quick heads up before we go any further: the Linux implementation of this interface may differ from what's written here, so pls consult the corresponding Linux manual page for details on Linux behavior. OR, plot twist, the interface might not even be implemented on Linux at all. πŸ™ˆ vibe check accordingly.


✨ NAME ✨

arpa/inet.h β€” definitions for internet operations πŸ¦‹


🌸 SYNOPSIS 🌸

#include <arpa/inet.h>

πŸ‘‘ DESCRIPTION πŸ‘‘

so here's the tea. the <arpa/inet.h> header shall define the in_port_t and in_addr_t types as described in <netinet/in.h>.

it shall also define the in_addr structure, as described in <netinet/in.h>.

and it shall define the INET_ADDRSTRLEN and INET6_ADDRSTRLEN macros, again as described in <netinet/in.h>.

now, the following shall be declared as functions, or defined as macros, or both. if functions are declared, function prototypes shall be provided. no cap. ✨

uint32_t htonl(uint32_t);
uint16_t htons(uint16_t);
uint32_t ntohl(uint32_t);
uint16_t ntohs(uint16_t);

the <arpa/inet.h> header shall define the uint32_t and uint16_t types as described in <inttypes.h>. πŸ’…

next up, the following shall be declared as functions and may also be defined as macros. function prototypes shall be provided, periodt.

in_addr_t    inet_addr(const char *);
char        *inet_ntoa(struct in_addr);
const char  *inet_ntop(int, const void *restrict, char *restrict,
                 socklen_t);
int          inet_pton(int, const char *restrict, void *restrict);

inclusion of the <arpa/inet.h> header may also make visible all symbols from <netinet/in.h> and <inttypes.h>. she's generous like that. πŸŽ€

the following sections are informative. (aka: not the rules, just the commentary. lowkey important to know the difference.)

🫢 APPLICATION USAGE 🫢

None. (yeah. nothing. iconic of her honestly.)


πŸ’œ RATIONALE πŸ’œ

None. (also nothing. she said "no thoughts, just vibes." ✨)


🧚 FUTURE DIRECTIONS 🧚

None. (nothing here either. the future is unspecified and that's fine.)


🌈 SEE ALSO 🌈

  • <inttypes.h>
  • <netinet_in.h>

the System Interfaces volume of POSIX.1‐2017, htonl(), inet_addr(), inet_ntop() πŸ”₯


Portions of this text are reprinted and reproduced in electronic form from IEEE Std 1003.1-2017, Standard for Information Technology -- Portable Operating System Interface (POSIX), The Open Group Base Specifications Issue 7, 2018 Edition, Copyright (C) 2018 by the Institute of Electrical and Electronics Engineers, Inc and The Open Group. In the event of any discrepancy between this version and the original IEEE and The Open Group Standard, the original IEEE and The Open Group Standard is the referee document. The original Standard can be obtained online at http://www.opengroup.org/unix/online.html .

Any typographical or formatting errors that appear in this page are most likely to have been introduced during the conversion of the source files to man page format. To report such errors, see https://www.kernel.org/doc/man-pages/reporting_bugs.html .


okay that's the whole page bestie, go forth and #include responsibly πŸ₯°

β€” brought to you by IEEE/The Open Group, 2017, and this arpa_inet.h(7POSIX) moment πŸ’–βœ¨πŸŽ€