Use of Address Translation Functions under Cygwin.

xiaoxiao2021-03-06  42

1. inet_aton (), inet_addr (), inet_ntoa () converts IPv4 addresses between the 32-bit network word sequence binary between the descent decimal number. 2. INET_PTON (), INET_NTOP () is a newer function, processing IPv4 and IPv6 addresses. In the Cygwin environment, I cannot pass when I use the inet_pton () or inet_ntop () function. Open Arpa / INET.H: / * ARPA / INET.H

CopyRight 1997, 1998, 2001 Red Hat, Inc.

This File is part of cygwin.

This Software is a copyrighted work licwind Under The Terms of thecy. Please "cygwin_license" forDetails. * /

#ifndef _arpa_inet_h # define _arpa_inet_h

#include

#ifdef __cplusplusextern "c" {# ENDIF

#ifndef __INSIDE_CYGWIN_NET__unsigned long inet_addr (const char *); int inet_aton (const char *, struct in_addr *); unsigned long inet_lnaof (struct in_addr); struct in_addr inet_makeaddr (unsigned long, unsigned long); unsigned int inet_netof (struct in_addr); Unsigned int inet_network (const char *); char * inet_ntoa (struct in_addr); # ENDIF

#ifdef __cplusplus}; # ENDIF

#ENDIF / * _ARPA_INET_H * / You can see that Cygwin does not support two newer functions, that is, Cygwin may not support IPv6. I only use inet_aton (), inet_addr (), inet_ntoa ().

转载请注明原文地址:https://www.9cbs.com/read-68373.html

New Post(0)