File tree Expand file tree Collapse file tree 1 file changed +0
-32
lines changed
lldb/tools/debugserver/source Expand file tree Collapse file tree 1 file changed +0
-32
lines changed Original file line number Diff line number Diff line change 30
30
#include " lockdown.h"
31
31
#endif
32
32
33
- /* Once we have a RNBSocket object with a port # specified,
34
- this function is called to wait for an incoming connection.
35
- This function blocks while waiting for that connection. */
36
-
37
- bool ResolveIPV4HostName (const char *hostname, in_addr_t &addr) {
38
- if (hostname == NULL || hostname[0 ] == ' \0 ' ||
39
- strcmp (hostname, " localhost" ) == 0 ||
40
- strcmp (hostname, " 127.0.0.1" ) == 0 ) {
41
- addr = htonl (INADDR_LOOPBACK);
42
- return true ;
43
- } else if (strcmp (hostname, " *" ) == 0 ) {
44
- addr = htonl (INADDR_ANY);
45
- return true ;
46
- } else {
47
- // See if an IP address was specified as numbers
48
- int inet_pton_result = ::inet_pton (AF_INET, hostname, &addr);
49
-
50
- if (inet_pton_result == 1 )
51
- return true ;
52
-
53
- struct hostent *host_entry = gethostbyname (hostname);
54
- if (host_entry) {
55
- std::string ip_str (
56
- ::inet_ntoa (*(struct in_addr *)*host_entry->h_addr_list));
57
- inet_pton_result = ::inet_pton (AF_INET, ip_str.c_str (), &addr);
58
- if (inet_pton_result == 1 )
59
- return true ;
60
- }
61
- }
62
- return false ;
63
- }
64
-
65
33
rnb_err_t RNBSocket::Listen (const char *listen_host, uint16_t port,
66
34
PortBoundCallback callback,
67
35
const void *callback_baton) {
You can’t perform that action at this time.
0 commit comments