X-Git-Url: http://v3vee.org/palacios/gitweb/gitweb.cgi?a=blobdiff_plain;f=palacios%2Fsrc%2Fpalacios%2Fvmm_socket.c;h=21063b96f251ef9f27673a666b5b39df97a6e0f9;hb=b65297c305017bb77bdbc6d056702df0565673ad;hp=57ee546fd44b41218b93d21019485157488e56b2;hpb=413abe8daa6db12345b9229976457c2c03412f4f;p=palacios.git diff --git a/palacios/src/palacios/vmm_socket.c b/palacios/src/palacios/vmm_socket.c index 57ee546..21063b9 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) { @@ -36,7 +36,7 @@ void V3_Init_Sockets(struct v3_socket_hooks * hooks) { PrintDebug("V3 sockets inited\n"); - //v3_socket_api_test(); + v3_socket_api_test(); return; } @@ -118,8 +118,9 @@ void v3_zero_sockset(struct v3_sock_set * sock_set) { } } -#if 0 -static int +#if 1 + +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