mirror of https://github.com/proxmox/mirror_qemu
win32 compile
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@1016 c046a42c-6fe2-441c-8c8c-71466251a162master
parent
ce93da6ffe
commit
379ff53dc9
|
@ -1,7 +1,11 @@
|
||||||
#ifndef _LIBSLIRP_H
|
#ifndef _LIBSLIRP_H
|
||||||
#define _LIBSLIRP_H
|
#define _LIBSLIRP_H
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
#include <winsock2.h>
|
||||||
|
#else
|
||||||
#include <sys/select.h>
|
#include <sys/select.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
void slirp_init(void);
|
void slirp_init(void);
|
||||||
|
|
||||||
|
|
|
@ -10,7 +10,6 @@
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define TOWRITEMAX 512
|
#define TOWRITEMAX 512
|
||||||
#define min(x,y) ((x) < (y) ? (x) : (y))
|
|
||||||
|
|
||||||
extern struct timeval tt;
|
extern struct timeval tt;
|
||||||
extern int link_up;
|
extern int link_up;
|
||||||
|
|
|
@ -326,7 +326,7 @@ fork_exec(so, ex, do_pty)
|
||||||
bind(s, (struct sockaddr *)&addr, addrlen) < 0 ||
|
bind(s, (struct sockaddr *)&addr, addrlen) < 0 ||
|
||||||
listen(s, 1) < 0) {
|
listen(s, 1) < 0) {
|
||||||
lprint("Error: inet socket: %s\n", strerror(errno));
|
lprint("Error: inet socket: %s\n", strerror(errno));
|
||||||
close(s);
|
closesocket(s);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
@ -421,7 +421,7 @@ fork_exec(so, ex, do_pty)
|
||||||
* of connect() fail in the child process
|
* of connect() fail in the child process
|
||||||
*/
|
*/
|
||||||
so->s = accept(s, (struct sockaddr *)&addr, &addrlen);
|
so->s = accept(s, (struct sockaddr *)&addr, &addrlen);
|
||||||
close(s);
|
closesocket(s);
|
||||||
opt = 1;
|
opt = 1;
|
||||||
setsockopt(so->s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int));
|
setsockopt(so->s,SOL_SOCKET,SO_REUSEADDR,(char *)&opt,sizeof(int));
|
||||||
opt = 1;
|
opt = 1;
|
||||||
|
@ -804,7 +804,7 @@ fd_nonblock(fd)
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
int opt = 1;
|
int opt = 1;
|
||||||
|
|
||||||
ioctl(fd, FIONBIO, &opt);
|
ioctlsocket(fd, FIONBIO, &opt);
|
||||||
#else
|
#else
|
||||||
int opt;
|
int opt;
|
||||||
|
|
||||||
|
@ -821,7 +821,7 @@ fd_block(fd)
|
||||||
#ifdef FIONBIO
|
#ifdef FIONBIO
|
||||||
int opt = 0;
|
int opt = 0;
|
||||||
|
|
||||||
ioctl(fd, FIONBIO, &opt);
|
ioctlsocket(fd, FIONBIO, &opt);
|
||||||
#else
|
#else
|
||||||
int opt;
|
int opt;
|
||||||
|
|
||||||
|
|
|
@ -106,7 +106,7 @@ sbappend(so, m)
|
||||||
* ottherwise it'll arrive out of order, and hence corrupt
|
* ottherwise it'll arrive out of order, and hence corrupt
|
||||||
*/
|
*/
|
||||||
if (!so->so_rcv.sb_cc)
|
if (!so->so_rcv.sb_cc)
|
||||||
ret = write(so->s, m->m_data, m->m_len);
|
ret = send(so->s, m->m_data, m->m_len, 0);
|
||||||
|
|
||||||
if (ret <= 0) {
|
if (ret <= 0) {
|
||||||
/*
|
/*
|
||||||
|
|
|
@ -28,8 +28,50 @@ fd_set *global_readfds, *global_writefds, *global_xfds;
|
||||||
|
|
||||||
static int get_dns_addr(struct in_addr *pdns_addr)
|
static int get_dns_addr(struct in_addr *pdns_addr)
|
||||||
{
|
{
|
||||||
/* XXX: add it */
|
FIXED_INFO *FixedInfo=NULL;
|
||||||
return -1;
|
ULONG BufLen;
|
||||||
|
DWORD ret;
|
||||||
|
IP_ADDR_STRING *pIPAddr;
|
||||||
|
struct in_addr tmp_addr;
|
||||||
|
|
||||||
|
FixedInfo = (FIXED_INFO *)GlobalAlloc(GPTR, sizeof(FIXED_INFO));
|
||||||
|
BufLen = sizeof(FIXED_INFO);
|
||||||
|
|
||||||
|
if (ERROR_BUFFER_OVERFLOW == GetNetworkParams(FixedInfo, &BufLen)) {
|
||||||
|
if (FixedInfo) {
|
||||||
|
GlobalFree(FixedInfo);
|
||||||
|
FixedInfo = NULL;
|
||||||
|
}
|
||||||
|
FixedInfo = GlobalAlloc(GPTR, BufLen);
|
||||||
|
}
|
||||||
|
|
||||||
|
if ((ret = GetNetworkParams(FixedInfo, &BufLen)) != ERROR_SUCCESS) {
|
||||||
|
printf("GetNetworkParams failed. ret = %08x\n", (u_int)ret );
|
||||||
|
if (FixedInfo) {
|
||||||
|
GlobalFree(FixedInfo);
|
||||||
|
FixedInfo = NULL;
|
||||||
|
}
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
pIPAddr = &(FixedInfo->DnsServerList);
|
||||||
|
inet_aton(pIPAddr->IpAddress.String, &tmp_addr);
|
||||||
|
*pdns_addr = tmp_addr;
|
||||||
|
#if 0
|
||||||
|
printf( "DNS Servers:\n" );
|
||||||
|
printf( "DNS Addr:%s\n", pIPAddr->IpAddress.String );
|
||||||
|
|
||||||
|
pIPAddr = FixedInfo -> DnsServerList.Next;
|
||||||
|
while ( pIPAddr ) {
|
||||||
|
printf( "DNS Addr:%s\n", pIPAddr ->IpAddress.String );
|
||||||
|
pIPAddr = pIPAddr ->Next;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
if (FixedInfo) {
|
||||||
|
GlobalFree(FixedInfo);
|
||||||
|
FixedInfo = NULL;
|
||||||
|
}
|
||||||
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
@ -73,10 +115,25 @@ static int get_dns_addr(struct in_addr *pdns_addr)
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
void slirp_cleanup(void)
|
||||||
|
{
|
||||||
|
WSACleanup();
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void slirp_init(void)
|
void slirp_init(void)
|
||||||
{
|
{
|
||||||
// debug_init("/tmp/slirp.log", DEBUG_DEFAULT);
|
// debug_init("/tmp/slirp.log", DEBUG_DEFAULT);
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
{
|
||||||
|
WSADATA Data;
|
||||||
|
WSAStartup(MAKEWORD(2,0), &Data);
|
||||||
|
atexit(slirp_cleanup);
|
||||||
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
link_up = 1;
|
link_up = 1;
|
||||||
|
|
||||||
if_init();
|
if_init();
|
||||||
|
@ -104,6 +161,16 @@ void slirp_init(void)
|
||||||
/*
|
/*
|
||||||
* curtime kept to an accuracy of 1ms
|
* curtime kept to an accuracy of 1ms
|
||||||
*/
|
*/
|
||||||
|
#ifdef _WIN32
|
||||||
|
static void updtime(void)
|
||||||
|
{
|
||||||
|
struct _timeb tb;
|
||||||
|
|
||||||
|
_ftime(&tb);
|
||||||
|
curtime = (u_int)tb.time * (u_int)1000;
|
||||||
|
curtime += (u_int)tb.millitm;
|
||||||
|
}
|
||||||
|
#else
|
||||||
static void updtime(void)
|
static void updtime(void)
|
||||||
{
|
{
|
||||||
gettimeofday(&tt, 0);
|
gettimeofday(&tt, 0);
|
||||||
|
@ -114,6 +181,7 @@ static void updtime(void)
|
||||||
if ((tt.tv_usec % 1000) >= 500)
|
if ((tt.tv_usec % 1000) >= 500)
|
||||||
curtime++;
|
curtime++;
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
void slirp_select_fill(int *pnfds,
|
void slirp_select_fill(int *pnfds,
|
||||||
fd_set *readfds, fd_set *writefds, fd_set *xfds)
|
fd_set *readfds, fd_set *writefds, fd_set *xfds)
|
||||||
|
|
|
@ -11,6 +11,30 @@
|
||||||
#include "config.h"
|
#include "config.h"
|
||||||
#include "slirp_config.h"
|
#include "slirp_config.h"
|
||||||
|
|
||||||
|
#ifdef _WIN32
|
||||||
|
# include <inttypes.h>
|
||||||
|
|
||||||
|
typedef uint8_t u_int8_t;
|
||||||
|
typedef uint16_t u_int16_t;
|
||||||
|
typedef uint32_t u_int32_t;
|
||||||
|
typedef uint64_t u_int64_t;
|
||||||
|
typedef char *caddr_t;
|
||||||
|
|
||||||
|
# include <winsock2.h>
|
||||||
|
# include <sys/timeb.h>
|
||||||
|
# include <iphlpapi.h>
|
||||||
|
|
||||||
|
# define EWOULDBLOCK WSAEWOULDBLOCK
|
||||||
|
# define EINPROGRESS WSAEINPROGRESS
|
||||||
|
# define ENOTCONN WSAENOTCONN
|
||||||
|
# define EHOSTUNREACH WSAEHOSTUNREACH
|
||||||
|
# define ENETUNREACH WSAENETUNREACH
|
||||||
|
# define ECONNREFUSED WSAECONNREFUSED
|
||||||
|
#else
|
||||||
|
# define ioctlsocket ioctl
|
||||||
|
# define closesocket(s) close(s)
|
||||||
|
#endif
|
||||||
|
|
||||||
#include <sys/types.h>
|
#include <sys/types.h>
|
||||||
#ifdef HAVE_SYS_BITYPES_H
|
#ifdef HAVE_SYS_BITYPES_H
|
||||||
# include <sys/bitypes.h>
|
# include <sys/bitypes.h>
|
||||||
|
@ -79,7 +103,9 @@ typedef unsigned char u_int8_t;
|
||||||
# include <strings.h>
|
# include <strings.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
#include <sys/uio.h>
|
#include <sys/uio.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifndef _P
|
#ifndef _P
|
||||||
#ifndef NO_PROTOTYPES
|
#ifndef NO_PROTOTYPES
|
||||||
|
@ -89,8 +115,10 @@ typedef unsigned char u_int8_t;
|
||||||
#endif
|
#endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
#include <netinet/in.h>
|
#include <netinet/in.h>
|
||||||
#include <arpa/inet.h>
|
#include <arpa/inet.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#ifdef GETTIMEOFDAY_ONE_ARG
|
#ifdef GETTIMEOFDAY_ONE_ARG
|
||||||
#define gettimeofday(x, y) gettimeofday(x)
|
#define gettimeofday(x, y) gettimeofday(x)
|
||||||
|
@ -119,7 +147,9 @@ int inet_aton _P((const char *cp, struct in_addr *ia));
|
||||||
#ifdef HAVE_SYS_SIGNAL_H
|
#ifdef HAVE_SYS_SIGNAL_H
|
||||||
# include <sys/signal.h>
|
# include <sys/signal.h>
|
||||||
#endif
|
#endif
|
||||||
|
#ifndef _WIN32
|
||||||
#include <sys/socket.h>
|
#include <sys/socket.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#if defined(HAVE_SYS_IOCTL_H)
|
#if defined(HAVE_SYS_IOCTL_H)
|
||||||
# include <sys/ioctl.h>
|
# include <sys/ioctl.h>
|
||||||
|
@ -232,8 +262,9 @@ extern int do_echo;
|
||||||
inline void remque_32 _P((void *));
|
inline void remque_32 _P((void *));
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#include <pwd.h>
|
#ifndef _WIN32
|
||||||
#include <netdb.h>
|
#include <netdb.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
#define DEFAULT_BAUD 115200
|
#define DEFAULT_BAUD 115200
|
||||||
|
|
||||||
|
@ -292,4 +323,9 @@ struct tcpcb *tcp_drop(struct tcpcb *tp, int err);
|
||||||
#define MAX_MRU 16384
|
#define MAX_MRU 16384
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
#ifndef _WIN32
|
||||||
|
#define min(x,y) ((x) < (y) ? (x) : (y))
|
||||||
|
#define max(x,y) ((x) > (y) ? (x) : (y))
|
||||||
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
|
@ -61,7 +61,10 @@
|
||||||
#define HAVE_STDLIB_H
|
#define HAVE_STDLIB_H
|
||||||
|
|
||||||
/* Define if you have sys/ioctl.h */
|
/* Define if you have sys/ioctl.h */
|
||||||
|
#undef HAVE_SYS_IOCTL_H
|
||||||
|
#ifndef _WIN32
|
||||||
#define HAVE_SYS_IOCTL_H
|
#define HAVE_SYS_IOCTL_H
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if you have sys/filio.h */
|
/* Define if you have sys/filio.h */
|
||||||
#undef HAVE_SYS_FILIO_H
|
#undef HAVE_SYS_FILIO_H
|
||||||
|
@ -93,6 +96,9 @@
|
||||||
|
|
||||||
/* Define if iovec needs to be declared */
|
/* Define if iovec needs to be declared */
|
||||||
#undef DECLARE_IOVEC
|
#undef DECLARE_IOVEC
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define DECLARE_IOVEC
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if a declaration of sprintf/fprintf is needed */
|
/* Define if a declaration of sprintf/fprintf is needed */
|
||||||
#undef DECLARE_SPRINTF
|
#undef DECLARE_SPRINTF
|
||||||
|
@ -101,13 +107,19 @@
|
||||||
#undef HAVE_SYS_WAIT_H
|
#undef HAVE_SYS_WAIT_H
|
||||||
|
|
||||||
/* Define if you have sys/select.h */
|
/* Define if you have sys/select.h */
|
||||||
|
#undef HAVE_SYS_SELECT_H
|
||||||
|
#ifndef _WIN32
|
||||||
#define HAVE_SYS_SELECT_H
|
#define HAVE_SYS_SELECT_H
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if you have strings.h */
|
/* Define if you have strings.h */
|
||||||
#define HAVE_STRING_H
|
#define HAVE_STRING_H
|
||||||
|
|
||||||
/* Define if you have arpa/inet.h */
|
/* Define if you have arpa/inet.h */
|
||||||
|
#undef HAVE_ARPA_INET_H
|
||||||
|
#ifndef _WIN32
|
||||||
#define HAVE_ARPA_INET_H
|
#define HAVE_ARPA_INET_H
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if you have sys/signal.h */
|
/* Define if you have sys/signal.h */
|
||||||
#undef HAVE_SYS_SIGNAL_H
|
#undef HAVE_SYS_SIGNAL_H
|
||||||
|
@ -147,7 +159,10 @@
|
||||||
#undef HAVE_SRANDOM
|
#undef HAVE_SRANDOM
|
||||||
|
|
||||||
/* Define if you have inet_aton */
|
/* Define if you have inet_aton */
|
||||||
|
#undef HAVE_INET_ATON
|
||||||
|
#ifndef _WIN32
|
||||||
#define HAVE_INET_ATON
|
#define HAVE_INET_ATON
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if you have setenv */
|
/* Define if you have setenv */
|
||||||
#undef HAVE_SETENV
|
#undef HAVE_SETENV
|
||||||
|
@ -169,6 +184,9 @@
|
||||||
|
|
||||||
/* Define if you DON'T have unix-domain sockets */
|
/* Define if you DON'T have unix-domain sockets */
|
||||||
#undef NO_UNIX_SOCKETS
|
#undef NO_UNIX_SOCKETS
|
||||||
|
#ifdef _WIN32
|
||||||
|
#define NO_UNIX_SOCKETS
|
||||||
|
#endif
|
||||||
|
|
||||||
/* Define if gettimeofday only takes one argument */
|
/* Define if gettimeofday only takes one argument */
|
||||||
#undef GETTIMEOFDAY_ONE_ARG
|
#undef GETTIMEOFDAY_ONE_ARG
|
||||||
|
|
|
@ -418,7 +418,7 @@ sorecvfrom(so)
|
||||||
*/
|
*/
|
||||||
len = M_FREEROOM(m);
|
len = M_FREEROOM(m);
|
||||||
/* if (so->so_fport != htons(53)) { */
|
/* if (so->so_fport != htons(53)) { */
|
||||||
ioctl(so->s, FIONREAD, &n);
|
ioctlsocket(so->s, FIONREAD, &n);
|
||||||
|
|
||||||
if (n > len) {
|
if (n > len) {
|
||||||
n = (m->m_data - m->m_dat) + m->m_len + n + 1;
|
n = (m->m_data - m->m_dat) + m->m_len + n + 1;
|
||||||
|
|
|
@ -47,9 +47,6 @@
|
||||||
|
|
||||||
struct socket tcb;
|
struct socket tcb;
|
||||||
|
|
||||||
#define min(x,y) ((x) < (y) ? (x) : (y))
|
|
||||||
#define max(x,y) ((x) > (y) ? (x) : (y))
|
|
||||||
|
|
||||||
int tcprexmtthresh = 3;
|
int tcprexmtthresh = 3;
|
||||||
struct socket *tcp_last_so = &tcb;
|
struct socket *tcp_last_so = &tcb;
|
||||||
|
|
||||||
|
|
|
@ -44,9 +44,6 @@
|
||||||
|
|
||||||
#include <slirp.h>
|
#include <slirp.h>
|
||||||
|
|
||||||
#define max(x,y) ((x) > (y) ? (x) : (y))
|
|
||||||
#define min(x,y) ((x) < (y) ? (x) : (y))
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Since this is only used in "stats socket", we give meaning
|
* Since this is only used in "stats socket", we give meaning
|
||||||
* names instead of the REAL names
|
* names instead of the REAL names
|
||||||
|
|
|
@ -301,7 +301,7 @@ tcp_close(tp)
|
||||||
/* clobber input socket cache if we're closing the cached connection */
|
/* clobber input socket cache if we're closing the cached connection */
|
||||||
if (so == tcp_last_so)
|
if (so == tcp_last_so)
|
||||||
tcp_last_so = &tcb;
|
tcp_last_so = &tcb;
|
||||||
close(so->s);
|
closesocket(so->s);
|
||||||
sbfree(&so->so_rcv);
|
sbfree(&so->so_rcv);
|
||||||
sbfree(&so->so_snd);
|
sbfree(&so->so_snd);
|
||||||
sofree(so);
|
sofree(so);
|
||||||
|
@ -477,7 +477,7 @@ tcp_connect(inso)
|
||||||
} else {
|
} else {
|
||||||
if ((so = socreate()) == NULL) {
|
if ((so = socreate()) == NULL) {
|
||||||
/* If it failed, get rid of the pending connection */
|
/* If it failed, get rid of the pending connection */
|
||||||
close(accept(inso->s,(struct sockaddr *)&addr,&addrlen));
|
closesocket(accept(inso->s,(struct sockaddr *)&addr,&addrlen));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (tcp_attach(so) < 0) {
|
if (tcp_attach(so) < 0) {
|
||||||
|
@ -508,7 +508,7 @@ tcp_connect(inso)
|
||||||
|
|
||||||
/* Close the accept() socket, set right state */
|
/* Close the accept() socket, set right state */
|
||||||
if (inso->so_state & SS_FACCEPTONCE) {
|
if (inso->so_state & SS_FACCEPTONCE) {
|
||||||
close(so->s); /* If we only accept once, close the accept() socket */
|
closesocket(so->s); /* If we only accept once, close the accept() socket */
|
||||||
so->so_state = SS_NOFDREF; /* Don't select it yet, even though we have an FD */
|
so->so_state = SS_NOFDREF; /* Don't select it yet, even though we have an FD */
|
||||||
/* if it's not FACCEPTONCE, it's already NOFDREF */
|
/* if it's not FACCEPTONCE, it's already NOFDREF */
|
||||||
}
|
}
|
||||||
|
|
|
@ -36,9 +36,6 @@
|
||||||
|
|
||||||
#include <slirp.h>
|
#include <slirp.h>
|
||||||
|
|
||||||
#define max(x,y) ((x) > (y) ? (x) : (y))
|
|
||||||
#define min(x,y) ((x) < (y) ? (x) : (y))
|
|
||||||
|
|
||||||
int tcp_keepidle = TCPTV_KEEP_IDLE;
|
int tcp_keepidle = TCPTV_KEEP_IDLE;
|
||||||
int tcp_keepintvl = TCPTV_KEEPINTVL;
|
int tcp_keepintvl = TCPTV_KEEPINTVL;
|
||||||
int tcp_maxidle;
|
int tcp_maxidle;
|
||||||
|
|
|
@ -329,7 +329,7 @@ udp_attach(so)
|
||||||
addr.sin_addr.s_addr = INADDR_ANY;
|
addr.sin_addr.s_addr = INADDR_ANY;
|
||||||
if(bind(so->s, (struct sockaddr *)&addr, sizeof(addr))<0) {
|
if(bind(so->s, (struct sockaddr *)&addr, sizeof(addr))<0) {
|
||||||
int lasterrno=errno;
|
int lasterrno=errno;
|
||||||
close(so->s);
|
closesocket(so->s);
|
||||||
so->s=-1;
|
so->s=-1;
|
||||||
errno=lasterrno;
|
errno=lasterrno;
|
||||||
} else {
|
} else {
|
||||||
|
@ -345,7 +345,7 @@ void
|
||||||
udp_detach(so)
|
udp_detach(so)
|
||||||
struct socket *so;
|
struct socket *so;
|
||||||
{
|
{
|
||||||
close(so->s);
|
closesocket(so->s);
|
||||||
/* if (so->so_m) m_free(so->so_m); done by sofree */
|
/* if (so->so_m) m_free(so->so_m); done by sofree */
|
||||||
|
|
||||||
sofree(so);
|
sofree(so);
|
||||||
|
@ -527,7 +527,7 @@ struct cu_header {
|
||||||
addr.sin_port = htons(518);
|
addr.sin_port = htons(518);
|
||||||
sendto(s, (char *)nmsg, sizeof(*nmsg), 0,
|
sendto(s, (char *)nmsg, sizeof(*nmsg), 0,
|
||||||
(struct sockaddr *) &addr, sizeof(addr));
|
(struct sockaddr *) &addr, sizeof(addr));
|
||||||
close(s) ;
|
closesocket(s) ;
|
||||||
|
|
||||||
omsg->type = nmsg->type = ANNOUNCE;
|
omsg->type = nmsg->type = ANNOUNCE;
|
||||||
OTOSIN(omsg, ctl_addr)->sin_port = temp_port;
|
OTOSIN(omsg, ctl_addr)->sin_port = temp_port;
|
||||||
|
@ -558,7 +558,7 @@ struct cu_header {
|
||||||
addr.sin_port = htons(518);
|
addr.sin_port = htons(518);
|
||||||
sendto(s, (char *)nmsg, sizeof(*nmsg), 0,
|
sendto(s, (char *)nmsg, sizeof(*nmsg), 0,
|
||||||
(struct sockaddr *)&addr, sizeof(addr));
|
(struct sockaddr *)&addr, sizeof(addr));
|
||||||
close(s);
|
closesocket(s);
|
||||||
|
|
||||||
OTOSIN(omsg, ctl_addr)->sin_port = temp_port;
|
OTOSIN(omsg, ctl_addr)->sin_port = temp_port;
|
||||||
OTOSIN(nmsg, ctl_addr)->sin_port = temp_port;
|
OTOSIN(nmsg, ctl_addr)->sin_port = temp_port;
|
||||||
|
|
Loading…
Reference in New Issue