64 #ifndef __INCLUDE_ARPA_INET_H 65 #define __INCLUDE_ARPA_INET_H 71 #include <tinyara/config.h> 73 #include <sys/types.h> 75 #include <netinet/in.h> 82 #define INET_ADDRSTRLEN 16 86 #define INET6_ADDRSTRLEN 46 97 #ifdef CONFIG_ENDIAN_BIG 98 # define HTONS(ns) (ns) 99 # define HTONL(nl) (nl) 103 (((((unsigned short)(ns)) & 0x00ff) << 8) | \ 104 ((((unsigned short)(ns)) >> 8) & 0x00ff)) 107 (((((unsigned long)(nl)) & 0x000000ffUL) << 24) | \ 108 ((((unsigned long)(nl)) & 0x0000ff00UL) << 8) | \ 109 ((((unsigned long)(nl)) & 0x00ff0000UL) >> 8) | \ 110 ((((unsigned long)(nl)) & 0xff000000UL) >> 24)) 113 #define NTOHS(hs) HTONS(hs) 114 #define NTOHL(hl) HTONL(hl) 116 #ifdef CONFIG_NET_LWIP 153 #define EXTERN extern "C" 157 #define EXTERN extern 169 uint32_t
ntohl(uint32_t nl);
178 uint16_t
ntohs(uint16_t ns);
187 uint32_t
htonl(uint32_t hl);
196 uint16_t
htons(uint16_t hs);
207 int inet_aton(FAR
const char *cp, FAR
struct in_addr *inp);
219 in_addr_t inet_network(FAR
const char *cp);
222 #ifdef CONFIG_CAN_PASS_STRUCTS 230 FAR
char *inet_ntoa(
struct in_addr in);
233 in_addr_t inet_lnaof(
struct in_addr in);
234 in_addr_t inet_netof(
struct in_addr in);
237 FAR
char *_inet_ntoa(in_addr_t in);
239 # define inet_ntoa(in) _inet_ntoa(in.s_addr); 241 in_addr_t _inet_lnaof(in_addr_t in);
242 # define inet_lnaof(in) _inet_lnaof(in.s_addr); 244 in_addr_t _inet_netof(in_addr_t in);
245 # define inet_netof(in) _inet_netof(in.s_addr); 248 struct in_addr inet_makeaddr(in_addr_t net, in_addr_t host);
251 int inet_pton(
int af, FAR
const char *src, FAR
void *dst);
252 const char *inet_ntop(
int af, FAR
const void *src, FAR
char *dst, socklen_t size);
uint16_t ntohs(uint16_t ns)
Convert the unsigned short integer netshort from network byte order to host byte order.
uint16_t htons(uint16_t hs)
Convert the unsigned short integer hostshort from host byte order to network byte order...
uint32_t htonl(uint32_t hl)
Convert the unsigned integer hostlong from host byte order to network byte order. ...
int inet_aton(FAR const char *cp, FAR struct in_addr *inp)
Convert the Internet host address from the IPv4 numbers-and-dots notation into binary form...
in_addr_t inet_addr(FAR const char *cp)
Convert the Internet host address from the IPv4 numbers-and-dots notation into binary data in network...
uint32_t ntohl(uint32_t nl)
Convert the unsigned integer netlong from network byte order to host byte order.