+int
+net_read_prim (struct serial *scb, size_t count)
+{
+ /* Need to cast to silence -Wpointer-sign on MinGW, as Winsock's
+ 'recv' takes 'char *' as second argument, while 'scb->buf' is
+ 'unsigned char *'. */
+ return recv (scb->fd, (char *) scb->buf, count, 0);
+}
+
+int
+net_write_prim (struct serial *scb, const void *buf, size_t count)
+{
+ /* On Windows, the second parameter to send is a "const char *"; on
+ UNIX systems it is generally "const void *". The cast to "const
+ char *" is OK everywhere, since in C++ any data pointer type can
+ be implicitly converted to "const void *". */
+ return send (scb->fd, (const char *) buf, count, 0);
+}
+
+int
+ser_tcp_send_break (struct serial *scb)
+{
+ /* Send telnet IAC and BREAK characters. */
+ return (serial_write (scb, "\377\363", 2));
+}
+
+/* Support for "set tcp" and "show tcp" commands. */
+
+static void
+set_tcp_cmd (const char *args, int from_tty)
+{
+ help_list (tcp_set_cmdlist, "set tcp ", all_commands, gdb_stdout);
+}
+
+static void
+show_tcp_cmd (const char *args, int from_tty)
+{
+ help_list (tcp_show_cmdlist, "show tcp ", all_commands, gdb_stdout);
+}
+
+#ifndef USE_WIN32API
+
+/* The TCP ops. */
+
+static const struct serial_ops tcp_ops =
+{
+ "tcp",
+ net_open,
+ net_close,
+ NULL,
+ ser_base_readchar,
+ ser_base_write,
+ ser_base_flush_output,
+ ser_base_flush_input,
+ ser_tcp_send_break,
+ ser_base_raw,
+ ser_base_get_tty_state,
+ ser_base_copy_tty_state,
+ ser_base_set_tty_state,
+ ser_base_print_tty_state,
+ ser_base_setbaudrate,
+ ser_base_setstopbits,
+ ser_base_setparity,
+ ser_base_drain_output,
+ ser_base_async,
+ net_read_prim,
+ net_write_prim
+};
+
+#endif /* USE_WIN32API */
+