mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-12-26 03:16:18 +00:00
Patch #7815 by James Smith: added inet_ntop/inet_pton
This commit is contained in:
parent
2f02120fee
commit
cffe54d094
@ -423,6 +423,20 @@ int lwip_fcntl(int s, int cmd, int val);
|
|||||||
#define fcntl(a,b,c) lwip_fcntl(a,b,c)
|
#define fcntl(a,b,c) lwip_fcntl(a,b,c)
|
||||||
#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */
|
#endif /* LWIP_POSIX_SOCKETS_IO_NAMES */
|
||||||
|
|
||||||
|
#if LWIP_IPV6
|
||||||
|
#define inet_ntop(af,src,dst,size) \
|
||||||
|
(((af) == AF_INET6) ? ip6addr_ntoa_r((src),(dst),(size)) \
|
||||||
|
: (((af) == AF_INET) ? ipaddr_ntoa_r((src),(dst),(size)) : NULL))
|
||||||
|
#define inet_pton(af,src,dst) \
|
||||||
|
(((af) == AF_INET6) ? inet6_aton((src),(dst)) \
|
||||||
|
: (((af) == AF_INET) ? inet_aton((src),(dst)) : 0))
|
||||||
|
#else /* LWIP_IPV6 */
|
||||||
|
#define inet_ntop(af,src,dst,size) \
|
||||||
|
(((af) == AF_INET) ? ipaddr_ntoa_r((src),(dst),(size)) : NULL)
|
||||||
|
#define inet_pton(af,src,dst) \
|
||||||
|
(((af) == AF_INET) ? inet_aton((src),(dst)) : 0)
|
||||||
|
#endif /* LWIP_IPV6 */
|
||||||
|
|
||||||
#endif /* LWIP_COMPAT_SOCKETS */
|
#endif /* LWIP_COMPAT_SOCKETS */
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
Loading…
Reference in New Issue
Block a user