Difference for arch/win32/ipx_win.c from version 1.1 to 1.2


version 1.1 version 1.2
Line 10
 
Line 10
   
 #include "mono.h"  #include "mono.h"
   
 #define n_printf(format, args...) mprintf((1, format, ## args))  //#define n_printf(format, args...) mprintf((1, format, ## args))
   
 static int ipx_win_GetMyAddress( void )  static int ipx_win_GetMyAddress( void )
 {  {
Line 26
 
Line 26
   
   if(sock==-1)    if(sock==-1)
   {    {
     n_printf("IPX: could not open socket in GetMyAddress\n");      mprintf((1,"IPX: could not open socket in GetMyAddress\n"));
     return(-1);      return(-1);
   }    }
   
Line 41
 
Line 41
      
   if(bind(sock,(struct sockaddr *)&ipxs,sizeof(ipxs))==-1)    if(bind(sock,(struct sockaddr *)&ipxs,sizeof(ipxs))==-1)
   {    {
     n_printf("IPX: could bind to network 0 in GetMyAddress\n");      mprintf((1,"IPX: could bind to network 0 in GetMyAddress\n"));
     closesocket( sock );      closesocket( sock );
     return(-1);      return(-1);
   }    }
      
   len = sizeof(ipxs2);    len = sizeof(ipxs2);
   if (getsockname(sock,(struct sockaddr *)&ipxs2,&len) < 0) {    if (getsockname(sock,(struct sockaddr *)&ipxs2,&len) < 0) {
     n_printf("IPX: could not get socket name in GetMyAddress\n");      mprintf((1,"IPX: could not get socket name in GetMyAddress\n"));
     closesocket( sock );      closesocket( sock );
     return(-1);      return(-1);
   }    }
Line 77
 
Line 77
   /* DANG_FIXTHIS - kludge to support broken linux IPX stack */    /* DANG_FIXTHIS - kludge to support broken linux IPX stack */
   /* need to convert dynamic socket open into a real socket number */    /* need to convert dynamic socket open into a real socket number */
 /*  if (port == 0) {  /*  if (port == 0) {
     n_printf("IPX: using socket %x\n", nextDynamicSocket);      mprintf((1,"IPX: using socket %x\n", nextDynamicSocket));
     port = nextDynamicSocket++;      port = nextDynamicSocket++;
   }    }
 */  */
Line 85
 
Line 85
 //  sock = socket(AF_IPX, SOCK_DGRAM, PF_IPX);  //  sock = socket(AF_IPX, SOCK_DGRAM, PF_IPX);
   sock = socket(AF_IPX, SOCK_DGRAM, 0);    sock = socket(AF_IPX, SOCK_DGRAM, 0);
   if (sock == -1) {    if (sock == -1) {
     n_printf("IPX: could not open IPX socket.\n");      mprintf((1,"IPX: could not open IPX socket.\n"));
     return -1;      return -1;
   }    }
   
Line 94
 
Line 94
   /* Permit broadcast output */    /* Permit broadcast output */
   if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST,    if (setsockopt(sock, SOL_SOCKET, SO_BROADCAST,
  (const char *)&opt, sizeof(opt)) == -1) {   (const char *)&opt, sizeof(opt)) == -1) {
     n_printf("IPX: could not set socket option for broadcast.\n");      mprintf((1,"IPX: could not set socket option for broadcast.\n"));
     return -1;      return -1;
   }    }
   ipxs.sa_family = AF_IPX;    ipxs.sa_family = AF_IPX;
Line 107
 
Line 107
   
   /* now bind to this port */    /* now bind to this port */
   if (bind(sock, (struct sockaddr *) &ipxs, sizeof(ipxs)) == -1) {    if (bind(sock, (struct sockaddr *) &ipxs, sizeof(ipxs)) == -1) {
     n_printf("IPX: could not bind socket to address\n");      mprintf((1,"IPX: could not bind socket to address\n"));
     closesocket( sock );      closesocket( sock );
     return -1;      return -1;
   }    }
Line 124
 
Line 124
 //    }  //    }
   len = sizeof(ipxs2);    len = sizeof(ipxs2);
   if (getsockname(sock,(struct sockaddr *)&ipxs2,&len) < 0) {    if (getsockname(sock,(struct sockaddr *)&ipxs2,&len) < 0) {
     n_printf("IPX: could not get socket name in IPXOpenSocket\n");      mprintf((1,"IPX: could not get socket name in IPXOpenSocket\n"));
     closesocket( sock );      closesocket( sock );
     return -1;      return -1;
   }     }
   if (port == 0) {    if (port == 0) {
     port = htons(ipxs2.sa_socket);      port = htons(ipxs2.sa_socket);
     n_printf("IPX: opened dynamic socket %04x\n", port);      mprintf((1,"IPX: opened dynamic socket %04x\n", port));
   }    }
   
   memcpy(ipx_MyAddress, ipxs2.sa_netnum, 4);    memcpy(ipx_MyAddress, ipxs2.sa_netnum, 4);
Line 143
 
Line 143
   
 static void ipx_win_CloseSocket(ipx_socket_t *mysock) {  static void ipx_win_CloseSocket(ipx_socket_t *mysock) {
   /* now close the file descriptor for the socket, and free it */    /* now close the file descriptor for the socket, and free it */
   n_printf("IPX: closing file descriptor on socket %x\n", mysock->socket);    mprintf((1,"IPX: closing file descriptor on socket %x\n", mysock->socket));
   closesocket(mysock->fd);    closesocket(mysock->fd);
 }  }
   

Legend:
line(s) removed in v.1.1 
line(s) changed
 line(s) added in v.1.2