From: Lei Xia Date: Tue, 10 Feb 2009 03:08:36 +0000 (-0600) Subject: Modify Socket, Make V3_SOCK long X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?p=palacios.git;a=commitdiff_plain;h=50b2cfeb17c210c307b380fd90ae7e82c7d144ca Modify Socket, Make V3_SOCK long --- diff --git a/palacios/include/palacios/vmm_socket.h b/palacios/include/palacios/vmm_socket.h index f73830e..eb87f71 100644 --- a/palacios/include/palacios/vmm_socket.h +++ b/palacios/include/palacios/vmm_socket.h @@ -23,7 +23,7 @@ #include -#define V3_SOCK void * +#define V3_SOCK long #ifdef __V3VEE__ @@ -254,5 +254,4 @@ struct v3_socket_hooks { extern void V3_Init_Sockets(struct v3_socket_hooks * hooks); - #endif diff --git a/palacios/src/palacios/vmm_socket.c b/palacios/src/palacios/vmm_socket.c index 57ee546..c4736dd 100644 --- a/palacios/src/palacios/vmm_socket.c +++ b/palacios/src/palacios/vmm_socket.c @@ -27,7 +27,7 @@ struct v3_socket_hooks * sock_hooks = 0; -//static int v3_socket_api_test(void); +//int v3_socket_api_test(void); void V3_Init_Sockets(struct v3_socket_hooks * hooks) { @@ -119,7 +119,8 @@ void v3_zero_sockset(struct v3_sock_set * sock_set) { } #if 0 -static int + +int v3_socket_api_test(void) { unsigned int port; @@ -131,7 +132,7 @@ v3_socket_api_test(void) PrintDebug("\nIn Palacios: Test V3_Socket Macros\n"); sock = V3_Create_TCP_Socket(); - if( sock == NULL ){ + if( ((int)sock) < 0 ){ PrintDebug( "ERROR: tcp_socket() failed!\n"); return -1; } @@ -150,7 +151,7 @@ v3_socket_api_test(void) PrintDebug( "Going into mainloop: server listening on port %d\n", port); - client = V3_Accept_Socket(sock, &remote_ip , &port); + client = V3_Accept_Socket(sock, &remote_ip, &port); PrintDebug(" New connection from %d port: %d\n", remote_ip, port); @@ -159,7 +160,7 @@ v3_socket_api_test(void) while(1) { V3_Send(client, buf, rc); - rc = V3_Recv(client, buf, sizeof(buf)-1); + rc = V3_Recv(client, buf, sizeof(buf)-1); if( rc <= 0 ){ PrintDebug( "Closed connection\n"); V3_Close_Socket(client); @@ -177,6 +178,7 @@ v3_socket_api_test(void) #endif + #if 0 static int