* terms and conditions of the copyright.
*/
-#define WANT_SYS_IOCTL_H
#include <slirp.h>
u_int curtime, time_fasttimo, last_slowtimo;
}
#endif
-#ifndef HAVE_INET_ATON
-int
-inet_aton(cp, ia)
- const char *cp;
- struct in_addr *ia;
-{
- u_int32_t addr = inet_addr(cp);
- if (addr == 0xffffffff)
- return 0;
- ia->s_addr = addr;
- return 1;
-}
-#endif
-
/*
* Get our IP address and put it in our_addr
*/
void
-getouraddr()
+getouraddr(void)
{
char buff[256];
struct hostent *he = NULL;
our_addr.s_addr = loopback_addr.s_addr;
}
-#if SIZEOF_CHAR_P == 8
-
-struct quehead_32 {
- u_int32_t qh_link;
- u_int32_t qh_rlink;
-};
-
-inline void
-insque_32(a, b)
- void *a;
- void *b;
-{
- register struct quehead_32 *element = (struct quehead_32 *) a;
- register struct quehead_32 *head = (struct quehead_32 *) b;
- element->qh_link = head->qh_link;
- head->qh_link = (u_int32_t)element;
- element->qh_rlink = (u_int32_t)head;
- ((struct quehead_32 *)(element->qh_link))->qh_rlink
- = (u_int32_t)element;
-}
-
-inline void
-remque_32(a)
- void *a;
-{
- register struct quehead_32 *element = (struct quehead_32 *) a;
- ((struct quehead_32 *)(element->qh_link))->qh_rlink = element->qh_rlink;
- ((struct quehead_32 *)(element->qh_rlink))->qh_link = element->qh_link;
- element->qh_rlink = 0;
-}
-
-#endif /* SIZEOF_CHAR_P == 8 */
-
struct quehead {
struct quehead *qh_link;
struct quehead *qh_rlink;
};
inline void
-insque(a, b)
- void *a, *b;
+insque(void *a, void *b)
{
register struct quehead *element = (struct quehead *) a;
register struct quehead *head = (struct quehead *) b;
}
inline void
-remque(a)
- void *a;
+remque(void *a)
{
register struct quehead *element = (struct quehead *) a;
((struct quehead *)(element->qh_link))->qh_rlink = element->qh_rlink;
int
-add_exec(ex_ptr, do_pty, exec, addr, port)
- struct ex_list **ex_ptr;
- int do_pty;
- char *exec;
- int addr;
- int port;
+add_exec(struct ex_list **ex_ptr, int do_pty, char *exec, int addr, int port)
{
struct ex_list *tmp_ptr;
(*ex_ptr)->ex_fport = port;
(*ex_ptr)->ex_addr = addr;
(*ex_ptr)->ex_pty = do_pty;
- (*ex_ptr)->ex_exec = strdup(exec);
+ (*ex_ptr)->ex_exec = (do_pty == 3) ? exec : strdup(exec);
(*ex_ptr)->ex_next = tmp_ptr;
return 0;
}
argv[i++] = strdup(curarg);
} while (c);
- argv[i] = 0;
+ argv[i] = NULL;
execvp(argv[0], (char **)argv);
/* Ooops, failed, let's tell the user why */
fd_nonblock(so->s);
/* Append the telnet options now */
- if (so->so_m != 0 && do_pty == 1) {
+ if (so->so_m != NULL && do_pty == 1) {
sbappend(so, so->so_m);
- so->so_m = 0;
+ so->so_m = NULL;
}
return 1;
#endif
#ifdef CONFIG_QEMU
-extern void term_vprintf(const char *fmt, va_list ap);
+#include "monitor.h"
void lprint(const char *format, ...)
{
va_list args;
va_start(args, format);
- term_vprintf(format, args);
+ monitor_vprintf(cur_mon, format, args);
va_end(args);
}
#else
#endif
void
-u_sleep(usec)
- int usec;
+u_sleep(int usec)
{
struct timeval t;
fd_set fdset;
*/
void
-fd_nonblock(fd)
- int fd;
+fd_nonblock(int fd)
{
#ifdef FIONBIO
- int opt = 1;
+#ifdef _WIN32
+ long opt = 1;
+#else
+ int opt = 1;
+#endif
ioctlsocket(fd, FIONBIO, &opt);
#else
}
void
-fd_block(fd)
- int fd;
+fd_block(int fd)
{
#ifdef FIONBIO
int opt = 0;