/* Serial interface for raw TCP connections on Un*x like systems.
- Copyright (C) 1992-2019 Free Software Foundation, Inc.
+ Copyright (C) 1992-2020 Free Software Foundation, Inc.
This file is part of GDB.
#include "gdbcmd.h"
#include "cli/cli-decode.h"
#include "cli/cli-setshow.h"
-#include "common/filestuff.h"
-#include "common/netstuff.h"
+#include "gdbsupport/filestuff.h"
+#include "gdbsupport/netstuff.h"
#include <sys/types.h>
#include <sys/ioctl.h> /* For FIONBIO. */
#endif
-#include "common/gdb_sys_time.h"
+#include "gdbsupport/gdb_sys_time.h"
#ifdef USE_WIN32API
-#include <winsock2.h>
-#include <wspiapi.h>
+#include <ws2tcpip.h>
#ifndef ETIMEDOUT
#define ETIMEDOUT WSAETIMEDOUT
#endif
/* Whether to auto-retry refused connections. */
-static int tcp_auto_retry = 1;
+static bool tcp_auto_retry = true;
/* Timeout period for connections, in seconds. */
/* Flag to indicate whether we've got a connection refused. It will
be true if any of the connections tried was refused. */
bool got_connrefused;
- /* If a connection succeeeds, SUCCESS_AINFO will point to the
+ /* If a connection succeeds, SUCCESS_AINFO will point to the
'struct addrinfo' that succeed. */
struct addrinfo *success_ainfo = NULL;
unsigned int polls = 0;
{
got_connrefused = false;
- for (struct addrinfo *iter = ainfo; iter != NULL; iter = iter->ai_next)
+ for (addrinfo *iter = ainfo; iter != NULL; iter = iter->ai_next)
{
/* Iterate over the list of possible addresses to connect
to. For each, we'll try to connect and see if it
#endif /* USE_WIN32API */
add_prefix_cmd ("tcp", class_maintenance, set_tcp_cmd, _("\
-TCP protocol specific variables\n\
-Configure variables specific to remote TCP connections"),
+TCP protocol specific variables.\n\
+Configure variables specific to remote TCP connections."),
&tcp_set_cmdlist, "set tcp ",
0 /* allow-unknown */, &setlist);
add_prefix_cmd ("tcp", class_maintenance, show_tcp_cmd, _("\
-TCP protocol specific variables\n\
-Configure variables specific to remote TCP connections"),
+TCP protocol specific variables.\n\
+Configure variables specific to remote TCP connections."),
&tcp_show_cmdlist, "show tcp ",
0 /* allow-unknown */, &showlist);
add_setshow_boolean_cmd ("auto-retry", class_obscure,
&tcp_auto_retry, _("\
-Set auto-retry on socket connect"), _("\
-Show auto-retry on socket connect"),
+Set auto-retry on socket connect."), _("\
+Show auto-retry on socket connect."),
NULL, NULL, NULL,
&tcp_set_cmdlist, &tcp_show_cmdlist);
add_setshow_uinteger_cmd ("connect-timeout", class_obscure,
&tcp_retry_limit, _("\
-Set timeout limit in seconds for socket connection"), _("\
-Show timeout limit in seconds for socket connection"), _("\
+Set timeout limit in seconds for socket connection."), _("\
+Show timeout limit in seconds for socket connection."), _("\
If set to \"unlimited\", GDB will keep attempting to establish a\n\
connection forever, unless interrupted with Ctrl-c.\n\
The default is 15 seconds."),