# NET - [Overview](#section1787027955165622) - [Summary](#section1322897020165622) - [Files](#files) - [Data Structures](#nested-classes) - [Macros](#define-members) - [Typedefs](#typedef-members) - [Functions](#func-members) - [Details](#section2074466484165622) - [Function](#section1845007127165622) - [accept\(\)](#ga0807af5ac9dfc2a63624e8c3e0ae95ef) - [bind\(\)](#ga82199bcd81894331533a25f08e172480) - [connect\(\)](#gacdfd99b6c59c833776412fbb0c539efb) - [dn\_comp\(\)](#ga0438570faf515401bffa1a0d9c94a266) - [dn\_expand\(\)](#ga91eb2055a64b28e4942a3a760d747243) - [ether\_aton\(\)](#gaab4c5b65c36fc0ea96a017daabc3770a) - [ether\_aton\_r\(\)](#gac0954821754bace30f674e61bb9f4e5f) - [ether\_ntoa\(\)](#ga07e34e6ee9e272c4799780915d11677c) - [ether\_ntoa\_r\(\)](#ga245e21de8e82756712a5182c2674c2ad) - [freeifaddrs\(\)](#gabfdd6ca5469fe73ed88ba94bf8db57cc) - [getpeername\(\)](#ga13d77555ad4ed62dfef0ce32dd16755c) - [getprotobyname\(\)](#ga83ac8a97dd9d895cda658af3aa46fd55) - [getprotobynumber\(\)](#gac01697dc4a5b8e434522220913bd46ea) - [getprotoent\(\)](#gaca0da70657afbc3e723990bb229deec3) - [getsockname\(\)](#ga62577da7dba23abb9c99cf5c2800ab24) - [getsockopt\(\)](#gacfcf672e255123afb75ed4d326257073) - [herror\(\)](#gaa68de2578d4e0849f82d70b2f5b9af70) - [hstrerror\(\)](#gac1752c48d9cf2ff87e29f29df6caa585) - [htonl\(\)](#gac7eed08cd3b67f42bf56063157c8fd55) - [htons\(\)](#gaabce0f8d453c3380e5b8a3d4947eb48c) - [if\_freenameindex\(\)](#ga7fe55c04ac2116fa501338fdcb279cc9) - [inet\_addr\(\)](#ga617651ec952a1f4c9cbddbf78f4b2e2e) - [inet\_aton\(\)](#ga26ee8e8e3949699a9c0e02ece272d370) - [inet\_lnaof\(\)](#ga1facb1380b7657ca9c72fb2633b60e3b) - [inet\_makeaddr\(\)](#gab28732d1d740597f53fb65a09d97800c) - [inet\_netof\(\)](#ga3a96aa4e6abe8e6959ea63fe338174dd) - [inet\_network\(\)](#ga6f478437c4810fce89cf0e77d94181f8) - [inet\_ntoa\(\)](#ga08b9fff487151e004d9862cbf34a51ad) - [inet\_ntop\(\)](#gae9a2182ca3255f16723adeea14665b55) - [inet\_pton\(\)](#ga3f6e2b2dae98a409d77c6e3b0cebc04b) - [listen\(\)](#ga5989c21d05cb17caba26cef496a7beea) - [ntohl\(\)](#gae68530d41f32dfef707f20b2bbaa5a44) - [ntohs\(\)](#gaf8c87af507c59bd8fef112e5e35fe537) - [recv\(\)](#ga5d049263cd0e3206b93530e68dfd7403) - [recvfrom\(\)](#ga3089d3ee59e26bd4def3ef870175540e) - [recvmsg\(\)](#gaaba92f19a31c01b93e3391671a8b3dd5) - [send\(\)](#ga4053f5c8e26fd490ef54e2a0abf5c89f) - [sendmsg\(\)](#ga70c97d3a1eab72cba4461d66a1778570) - [sendto\(\)](#ga2587b27d2c6014c6b568a974655f41c5) - [setprotoent\(\)](#ga6a806414e4ae5bffb09e3a1d25d8db75) - [setsockopt\(\)](#ga81983de50d79d797b2ac0f0d0f28953f) - [shutdown\(\)](#ga402425b8e1ceab40ac38a949babcf1aa) - [socket\(\)](#gaf4e0711877c45a41168ac677b0670ccd) ## **Overview** **Description:** Provides functions and data structures related to network operations. **Since:** 1.0 **Version:** 1.0 ## **Summary** ## Files
AF_INET PF_INET |
|
AF_INET6 PF_INET6 |
|
Defines the message type that more data is to be transferred. |
|
htonl (uint32_t n) |
Converts an integer from the host byte order to the network byte order. |
htons (uint16_t n) |
Converts a 16-bit integer from the host byte order to the network byte order. |
ntohl (uint32_t n) |
Converts an integer from the network byte order to the host byte order. |
ntohs (uint16_t n) |
Converts a 16-bit integer from the network byte order to the host byte order. |
inet_addr (const char *p) |
Converts a string from the IPv4 numbers-and-dots notation to the binary data in network byte order. |
inet_network (const char *p) |
Converts a string from the IPv4 numbers-and-dots notation to the binary data in host byte order. |
|
Converts a network address to a string in dotted-decimal format. |
|
inet_pton (int af, const char *__restrict s, void *__restrict a0) |
Converts a string to a network address in the specified address family. |
inet_ntop (int af, const void *restrict a0, char *restrict s, socklen_t l) |
Converts a network address in the specified address family to a string. |
|
Converts an IP address from the string format to the 32-bit binary format in network byte order. |
|
inet_makeaddr (in_addr_t n, in_addr_t h) |
struct in_addr Converts the network number and host address to the network address. |
inet_lnaof (struct in_addr in) |
Converts an IP address into a host ID in host byte order without network bits. |
inet_netof (struct in_addr in) |
Extracts the network number from the in_addr structure and converts it to the host byte order. |
freeifaddrs (struct ifaddrs *ifp) |
Frees the network interface information obtained by getifaddrs. |
if_freenameindex (struct if_nameindex *idx) |
Frees the network adapter information obtained by if_nameindex. |
setprotoent (int stayopen) |
Opens a connection to the database and sets the next entry to the first entry. |
getprotoent (void) |
struct protoent * |
getprotobyname (const char *name) |
struct protoent * |
getprotobynumber (int num) |
struct protoent * Retrieves the information about a protocol with the specified number. |
herror (const char *msg) |
|
hstrerror (int ecode) |
Retrieves error information associated with the specified error number. |
ether_ntoa (const struct ether_addr *p_a) |
Converts binary data in network byte order into a standard 48-bit Ethernet host address in the colon hexadecimal notation. |
ether_aton (const char *x) |
struct ether_addr * Converts a standard 48-bit Ethernet host address in the colon hexadecimal notation into binary data in network byte order. |
ether_ntoa_r (const struct ether_addr *p_a, char *x) |
Converts binary data in network byte order into a standard 48-bit Ethernet host address in the colon hexadecimal notation. This function is reentrant. |
ether_aton_r (const char *x, struct ether_addr *p_a) |
struct ether_addr * Converts a standard 48-bit Ethernet host address in the colon hexadecimal notation into binary data in network byte order. This function is reentrant. |
dn_comp (const char *src, unsigned char *dst, int space, unsigned char **dnptrs, unsigned char **lastdnptr) |
|
dn_expand (const unsigned char *base, const unsigned char *end, const unsigned char *src, char *dest, int space) |
|
socket (int domain, int type, int protocol) |
|
shutdown (int sockfd, int how) |
|
bind (int sockfd, const struct sockaddr *addr, socklen_t addrlen) |
|
connect (int sockfd, const struct sockaddr *addr, socklen_t addrlen) |
|
listen (int sockfd, int backlog) |
|
accept (int sockfd, struct sockaddr *__restrict addr, socklen_t *__restrict addrlen) |
|
getsockname (int fd, struct sockaddr *restrict addr, socklen_t *restrict len) |
|
getpeername (int fd, struct sockaddr *restrict addr, socklen_t *restrict len) |
|
send (int fd, const void *buf, size_t len, int flags) |
|
recv (int fd, void *buf, size_t len, int flags) |
|
sendto (int fd, const void *buf, size_t len, int flags, const struct sockaddr *addr, socklen_t alen) |
|
recvfrom (int fd, void *__restrict buf, size_t len, int flags, struct sockaddr *__restrict addr, socklen_t *__restrict alen) |
|
sendmsg (int fd, const struct msghdr *msg, int flags) |
|
recvmsg (int fd, struct msghdr *msg, int flags) |
|
getsockopt (int fd, int level, int optname, void *__restrict optval, socklen_t *__restrict optlen) |
|
setsockopt (int fd, int level, int optname, const void *optval, socklen_t optlen) |
| sockfd | Indicates the socket descriptor. |
| addr | Indicates the pointer to the socket address requiring for the connection. |
| addrlen | Indicates the length of the address structure pointed to by addr. |
The socket requiring for the connection is not of the NETCONN_TCP type. |
|
| sockfd | Indicates the socket descriptor. |
| addr | Indicates the address to be bound to the socket. |
| addrlen | Indicates the length of the address structure pointed to by addr. |
| sockfd | Indicates the socket descriptor. |
| addr | Indicates the pointer to the address to be connected. |
| addrlen | Indicates the length of the address structure pointed to by addr. |
Incorrect connection type obtained based on the socket descriptor |
|
| x | Indicates the pointer to the host address to be converted. |
| x | Indicates the pointer to the host address to be converted. |
| p_a | Indicates the pointer to the temporary buffer during conversion. |
| p_a | Indicates the pointer to the binary data to be converted. |
| p_a | Indicates the pointer to the binary data to be converted. |
| x | Indicates the pointer to the temporary buffer during conversion. |
| ifp | Indicates the pointer to the network interface information to be freed. |
| fd | Indicates the socket descriptor. |
| addr | Indicates the pointer to the address to be retrieved. |
| len | Indicates the pointer to the length of the address pointed to by addr. |
| name | Indicates the pointer to the protocol name. |
| num | Indicates the protocol number. |
| fd | Indicates the socket descriptor. |
| addr | Indicates the pointer to the address to be retrieved. |
| len | Indicates the pointer to the length of the address pointed to by addr. |
| fd | Indicates the socket descriptor. |
| level | Indicates the protocol level at which the option resides. Only SOL_SOCKET is supported. |
| optname | Indicates the socket options to be retrieved, which has the following values:
|
| optval | Indicates the pointer to the option data. |
| optlen | Indicates the pointer to the size of the buffer pointed to by optval. |
| msg | Indicates the pointer to the string to be printed together with the error information. This parameter can be null. |
| ecode | Indicates the error number. |
| n | Indicates the integer in host byte order. |
| n | Indicates the integer in host byte order. |
| idx | Indicates the pointer to the network adapter to be freed. |
| p | Indicates the pointer to the string to be converted. |
| s0 | Indicates the pointer to the IP address to be converted. |
| dest | Indicates the pointer to the structure for conversion. |
| in | Indicates the network address structure. |
| n | Indicates the network number. |
| h | Indicates the host address. |
| in | Indicates the network address structure. |
| p | Indicates the pointer to the string to be converted. |
| in | Indicates the network address to be converted. |
| af | Indicates the address family. Currently, only AF_INET and AF_INET6 are supported. |
| s | Indicates the pointer to the string to be converted. |
| a0 | Indicates the pointer to the converted data. |
| sockfd | Indicates the socket descriptor. |
| backlog | Indicates the maximum length of the queue to accept incoming connection requests. |
Incorrect connection type obtained based on the socket descriptor |
| n | Indicates the integer in network byte order. |
| n | Indicates the integer in network byte order. |
| fd | Indicates the socket descriptor. |
| msg | Indicates the pointer to the address to receive the message header. |
| flags | Indicates the socket flags. This parameter has the following values: |
Incorrect connection type obtained based on the socket descriptor |
Incorrect connection type obtained based on the socket descriptor |
| fd | Indicates the socket descriptor. |
| msg | Indicates the pointer to the address of the message header to be sent. |
| flags | Indicates the socket flags. This parameter has the following values: |
Incorrect connection type obtained based on the socket descriptor |
|
Incorrect connection type obtained based on the socket descriptor |
| stayopen | Reserved for interface compatibility (not used currently). |
| fd | Indicates the socket descriptor. |
| level | Indicates the protocol level at which the option resides. Only SOL_SOCKET is supported. |
| optname | Indicates the socket options to set, which has the following values:
|
| optval | Indicates the pointer to the option data. |
| optlen | Indicates the size of the buffer pointed to by optval. |
| sockfd | Indicates the socket descriptor. |
| how | Indicates how to shut down the socket. You can disable either receptions by SHUT_RD or transmissions by SHUT_WR, or both by SHUT_RDWR. |
Incorrect connection type obtained based on the socket descriptor |
| domain | Indicates the socket family. |
| type | Indicates the socket type. |
| protocol | Indicates the socket protocol. |