Changeset 78190 in vbox for trunk/src/VBox/GuestHost/OpenGL/util
- Timestamp:
- Apr 18, 2019 12:07:07 AM (6 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 19 deleted
- 10 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk
- Property svn:mergeinfo
-
old new 9 9 /branches/VBox-5.1:112367,115992,116543,116550,116568,116573 10 10 /branches/VBox-5.2:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124260,124263,124271,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812 11 /branches/aeichner/vbox-chromium-cleanup:129816,129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130036,130094-130095 11 12 /branches/andy/draganddrop:90781-91268 12 13 /branches/andy/guestctrl20:78916,78930
-
- Property svn:mergeinfo
-
trunk/src/VBox
- Property svn:mergeinfo
-
old new 9 9 /branches/VBox-5.1/src/VBox:112367,116543,116550,116568,116573 10 10 /branches/VBox-5.2/src/VBox:119536,120083,120099,120213,120221,120239,123597-123598,123600-123601,123755,124263,124273,124277-124279,124284-124286,124288-124290,125768,125779-125780,125812,127158-127159,127162-127167,127180 11 /branches/aeichner/vbox-chromium-cleanup/src/VBox:129818-129851,129853-129861,129871-129872,129876,129880,129882,130013-130015,130094-130095 11 12 /branches/andy/draganddrop/src/VBox:90781-91268 12 13 /branches/andy/guestctrl20/src/VBox:78916,78930
-
- Property svn:mergeinfo
-
trunk/src/VBox/GuestHost/OpenGL/util/blitter.cpp
r78116 r78190 34 34 # include "cr_error.h" 35 35 # include "cr_net.h" 36 # include "cr_rand.h"37 36 # include "cr_mem.h" 38 37 # include "cr_string.h" -
trunk/src/VBox/GuestHost/OpenGL/util/error.c
r76553 r78190 25 25 #include <iprt/buildconfig.h> 26 26 27 27 28 #include <VBox/log.h> 29 #include <iprt/env.h> 28 30 29 31 #ifdef RT_OS_WINDOWS 30 32 # include <iprt/win/windows.h> 31 # include "cr_environment.h"32 33 # include "cr_error.h" 33 34 # include "VBox/VBoxGuestLib.h" … … 100 101 /* Log last error on windows. */ 101 102 dwLastErr = GetLastError(); 102 if (dwLastErr != 0 && crGetenv("CR_WINDOWS_ERRORS") != NULL)103 if (dwLastErr != 0 && RTEnvGet("CR_WINDOWS_ERRORS") != NULL) 103 104 { 104 105 LPTSTR pszWindowsMessage; -
trunk/src/VBox/GuestHost/OpenGL/util/htable.cpp
r76553 r78190 28 28 #include "cr_error.h" 29 29 #include "cr_net.h" 30 #include "cr_rand.h"31 30 #include "cr_mem.h" 32 31 #include "cr_string.h" -
trunk/src/VBox/GuestHost/OpenGL/util/net.c
r69392 r78190 22 22 #include "cr_error.h" 23 23 #include "cr_string.h" 24 #include "cr_url.h"25 24 #include "cr_net.h" 26 25 #include "cr_netserver.h" 27 26 #include "cr_pixeldata.h" 28 #include "cr_environment.h"29 #include "cr_endian.h"30 27 #include "cr_bufpool.h" 31 28 #include "cr_threads.h" … … 47 44 48 45 /* Number of connections using each type of interface: */ 49 int use_tcpip;50 int use_ib;51 int use_file;52 int use_udp;53 int use_gm;54 int use_sdp;55 int use_teac;56 int use_tcscomm;57 46 int use_hgcm; 58 47 … … 60 49 61 50 #ifdef CHROMIUM_THREADSAFE 62 CRmutex mutex; 63 #endif 64 int my_rank; /* Teac/TSComm only */ 51 CRmutex mutex; 52 #endif 65 53 } cr_net; 66 54 … … 73 61 */ 74 62 static void 75 InitConnection(CRConnection *conn , const char *protocol, unsigned int mtu63 InitConnection(CRConnection *conn 76 64 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 77 65 , struct VBOXUHGSMI *pHgsmi … … 79 67 ) 80 68 { 81 if (!crStrcmp(protocol, "devnull"))82 {83 crDevnullInit(cr_net.recv_list, cr_net.close_list, mtu);84 crDevnullConnection(conn);85 }86 else if (!crStrcmp(protocol, "file"))87 {88 cr_net.use_file++;89 crFileInit(cr_net.recv_list, cr_net.close_list, mtu);90 crFileConnection(conn);91 }92 else if (!crStrcmp(protocol, "swapfile"))93 {94 /* file with byte-swapping */95 cr_net.use_file++;96 crFileInit(cr_net.recv_list, cr_net.close_list, mtu);97 crFileConnection(conn);98 conn->swap = 1;99 }100 else if (!crStrcmp(protocol, "tcpip"))101 {102 cr_net.use_tcpip++;103 crTCPIPInit(cr_net.recv_list, cr_net.close_list, mtu);104 crTCPIPConnection(conn);105 }106 else if (!crStrcmp(protocol, "udptcpip"))107 {108 cr_net.use_udp++;109 crUDPTCPIPInit(cr_net.recv_list, cr_net.close_list, mtu);110 crUDPTCPIPConnection(conn);111 }112 69 #ifdef VBOX_WITH_HGCM 113 else if (!crStrcmp(protocol, "vboxhgcm")) 114 { 115 cr_net.use_hgcm++; 116 crVBoxHGCMInit(cr_net.recv_list, cr_net.close_list, mtu); 117 crVBoxHGCMConnection(conn 118 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 119 , pHgsmi 120 #endif 121 ); 122 } 123 #endif 124 #ifdef GM_SUPPORT 125 else if (!crStrcmp(protocol, "gm")) 126 { 127 cr_net.use_gm++; 128 crGmInit(cr_net.recv_list, cr_net.close_list, mtu); 129 crGmConnection(conn); 130 } 131 #endif 132 #ifdef TEAC_SUPPORT 133 else if (!crStrcmp(protocol, "quadrics")) 134 { 135 cr_net.use_teac++; 136 crTeacInit(cr_net.recv_list, cr_net.close_list, mtu); 137 crTeacConnection(conn); 138 } 139 #endif 140 #ifdef TCSCOMM_SUPPORT 141 else if (!crStrcmp(protocol, "quadrics-tcscomm")) 142 { 143 cr_net.use_tcscomm++; 144 crTcscommInit(cr_net.recv_list, cr_net.close_list, mtu); 145 crTcscommConnection(conn); 146 } 147 #endif 148 #ifdef SDP_SUPPORT 149 else if (!crStrcmp(protocol, "sdp")) 150 { 151 cr_net.use_sdp++; 152 crSDPInit(cr_net.recv_list, cr_net.close_list, mtu); 153 crSDPConnection(conn); 154 } 155 #endif 156 #ifdef IB_SUPPORT 157 else if (!crStrcmp(protocol, "ib")) 158 { 159 cr_net.use_ib++; 160 crDebug("Calling crIBInit()"); 161 crIBInit(cr_net.recv_list, cr_net.close_list, mtu); 162 crIBConnection(conn); 163 crDebug("Done Calling crIBInit()"); 164 } 165 #endif 166 #ifdef HP_MULTICAST_SUPPORT 167 else if (!crStrcmp(protocol, "hpmc")) 168 { 169 cr_net.use_hpmc++; 170 crHPMCInit(cr_net.recv_list, cr_net.close_list, mtu); 171 crHPMCConnection(conn); 172 } 173 #endif 174 else 175 { 176 crError("Unknown protocol: \"%s\"", protocol); 177 } 70 cr_net.use_hgcm++; 71 crVBoxHGCMInit(cr_net.recv_list, cr_net.close_list); 72 crVBoxHGCMConnection(conn 73 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 74 , pHgsmi 75 #endif 76 ); 77 #endif 178 78 } 179 79 … … 192 92 * the mothership 193 93 */ 194 CRConnection * crNetConnectToServer( const char *server, unsigned short default_port,int mtu, int broker94 CRConnection * crNetConnectToServer( const char *server, int mtu, int broker 195 95 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 196 96 , struct VBOXUHGSMI *pHgsmi … … 198 98 ) 199 99 { 200 char hostname[4096], protocol[4096];201 unsigned short port;202 100 CRConnection *conn; 203 101 204 crDebug( "In crNetConnectToServer( \"%s\", port=%d,mtu=%d, broker=%d )",205 server, default_port,mtu, broker );102 crDebug( "In crNetConnectToServer( \"%s\", mtu=%d, broker=%d )", 103 server, mtu, broker ); 206 104 207 105 CRASSERT( cr_net.initialized ); … … 212 110 "but the minimum MTU is %d", server, mtu, CR_MINIMUM_MTU ); 213 111 } 214 215 /* Tear the URL apart into relevant portions. */216 if ( !crParseURL( server, protocol, hostname, &port, default_port ) ) {217 crError( "Malformed URL: \"%s\"", server );218 }219 220 /* If the host name is "localhost" replace it with the _real_ name221 * of the localhost. If we don't do this, there seems to be222 * confusion in the mothership as to whether or not "localhost" and223 * "foo.bar.com" are the same machine.224 */225 if (crStrcmp(hostname, "localhost") == 0) {226 int rv = crGetHostname(hostname, 4096);227 CRASSERT(rv == 0);228 (void) rv;229 }230 231 /* XXX why is this here??? I think it could be moved into the232 * crTeacConnection() function with no problem. I.e. change the233 * connection's port, teac_rank and tcscomm_rank there. (BrianP)234 */235 if ( !crStrcmp( protocol, "quadrics" ) ||236 !crStrcmp( protocol, "quadrics-tcscomm" ) ) {237 /* For Quadrics protocols, treat "port" as "rank" */238 if ( port > CR_QUADRICS_HIGHEST_RANK ) {239 crWarning( "Invalid crserver rank, %d, defaulting to %d\n",240 port, CR_QUADRICS_LOWEST_RANK );241 port = CR_QUADRICS_LOWEST_RANK;242 }243 }244 crDebug( "Connecting to %s on port %d, with protocol %s",245 hostname, port, protocol );246 247 #ifdef SDP_SUPPORT248 /* This makes me ill, but we need to "fix" the hostname for sdp. MCH */249 if (!crStrcmp(protocol, "sdp")) {250 char* temp;251 temp = strtok(hostname, ".");252 crStrcat(temp, crGetSDPHostnameSuffix());253 crStrcpy(hostname, temp);254 crDebug("SDP rename hostname: %s", hostname);255 }256 #endif257 112 258 113 conn = (CRConnection *) crCalloc( sizeof(*conn) ); … … 263 118 conn->type = CR_NO_CONNECTION; /* we don't know yet */ 264 119 conn->recv_credits = CR_INITIAL_RECV_CREDITS; 265 conn->hostname = crStrdup( hostname );266 conn->port = port;267 120 conn->mtu = mtu; 268 121 conn->buffer_size = mtu; 269 122 conn->broker = broker; 270 conn->endianness = crDetermineEndianness();271 /* XXX why are these here??? Move them into the crTeacConnection()272 * and crTcscommConnection() functions.273 */274 conn->teac_id = -1;275 conn->teac_rank = port;276 conn->tcscomm_id = -1;277 conn->tcscomm_rank = port;278 123 279 124 crInitMessageList(&conn->messageList); 280 125 281 126 /* now, just dispatch to the appropriate protocol's initialization functions. */ 282 InitConnection(conn , protocol, mtu127 InitConnection(conn 283 128 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 284 129 , pHgsmi … … 311 156 ) 312 157 { 313 /*314 unsigned int len = sizeof(CRMessageNewClient);315 CRMessageNewClient msg;316 317 CRASSERT( conn );318 319 if (conn->swap)320 msg.header.type = (CRMessageType) SWAP32(CR_MESSAGE_NEWCLIENT);321 else322 msg.header.type = CR_MESSAGE_NEWCLIENT;323 324 crNetSend( conn, NULL, &msg, len );325 */326 327 158 crNetServerConnect( ns 328 159 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) … … 349 180 CRConnection *conn; 350 181 182 RT_NOREF(hostname); 351 183 CRASSERT( cr_net.initialized ); 352 184 … … 358 190 conn->type = CR_NO_CONNECTION; /* we don't know yet */ 359 191 conn->recv_credits = CR_INITIAL_RECV_CREDITS; 360 conn->port = port;361 192 conn->mtu = mtu; 362 193 conn->buffer_size = mtu; 363 194 conn->broker = broker; 364 conn->endianness = crDetermineEndianness();365 conn->teac_id = -1;366 conn->teac_rank = -1;367 conn->tcscomm_id = -1;368 conn->tcscomm_rank = -1;369 195 370 196 crInitMessageList(&conn->messageList); … … 374 200 protocol, (int) port, (int) mtu); 375 201 376 /* special case */ 377 if ( !crStrncmp( protocol, "file", crStrlen( "file" ) ) || 378 !crStrncmp( protocol, "swapfile", crStrlen( "swapfile" ) ) ) 379 { 380 char filename[4096]; 381 char protocol_only[4096]; 382 383 cr_net.use_file++; 384 if (!crParseURL(protocol, protocol_only, filename, NULL, 0)) 385 { 386 crError( "Malformed URL: \"%s\"", protocol ); 387 } 388 conn->hostname = crStrdup( filename ); 389 390 /* call the protocol-specific init routines */ /* ktd (add) */ 391 InitConnection(conn, protocol_only, mtu 202 /* call the protocol-specific init routines */ 203 InitConnection(conn 392 204 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) 393 205 , NULL 394 206 #endif 395 ); /* ktd (add) */396 }397 else {398 /* call the protocol-specific init routines */399 InitConnection(conn, protocol, mtu400 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST)401 , NULL402 #endif403 207 ); 404 } 405 406 crNetAccept( conn, hostname, port ); 208 209 crNetAccept(conn); 407 210 return conn; 408 211 } … … 416 219 { 417 220 conn->Disconnect(conn); 418 crFree( conn->hostname );419 221 #ifdef CHROMIUM_THREADSAFE 420 222 crFreeMutex( &conn->messageList.lock ); … … 440 242 else 441 243 { 442 #ifdef WINDOWS443 /** @todo do we actually need that WSA stuff with VBox at all? */444 WORD wVersionRequested = MAKEWORD(2, 0);445 WSADATA wsaData;446 int err;447 448 err = WSAStartup(wVersionRequested, &wsaData);449 if (err != 0)450 crError("Couldn't initialize sockets on WINDOWS");451 #endif452 453 cr_net.use_gm = 0;454 cr_net.use_udp = 0;455 cr_net.use_tcpip = 0;456 cr_net.use_sdp = 0;457 cr_net.use_tcscomm = 0;458 cr_net.use_teac = 0;459 cr_net.use_file = 0;460 244 cr_net.use_hgcm = 0; 461 245 cr_net.num_clients = 0; … … 555 339 CRConnection **c; 556 340 557 c = crTCPIPDump( num );558 if ( c ) return c;559 560 c = crDevnullDump( num );561 if ( c ) return c;562 563 c = crFileDump( num );564 if ( c ) return c;565 566 341 #ifdef VBOX_WITH_HGCM 567 342 c = crVBoxHGCMDump( num ); 568 if ( c ) return c;569 #endif570 #ifdef GM_SUPPORT571 c = crGmDump( num );572 if ( c ) return c;573 #endif574 #ifdef IB_SUPPORT575 c = crIBDump( num );576 if ( c ) return c;577 #endif578 #ifdef SDP_SUPPORT579 c = crSDPDump( num );580 343 if ( c ) return c; 581 344 #endif … … 866 629 ) 867 630 { 868 ns->conn = crNetConnectToServer( ns->name, DEFAULT_SERVER_PORT,631 ns->conn = crNetConnectToServer( ns->name, 869 632 ns->buffer_size, 0 870 633 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) … … 890 653 { 891 654 conn->Disconnect( conn ); 892 crFree( conn->hostname );893 655 #ifdef CHROMIUM_THREADSAFE 894 656 crFreeMutex( &conn->messageList.lock ); … … 902 664 * Apparently, this is only called from the crNetConnectToServer function. 903 665 */ 904 void crNetAccept( CRConnection *conn , const char *hostname, unsigned short port)905 { 906 conn->Accept( conn , hostname, port);666 void crNetAccept( CRConnection *conn) 667 { 668 conn->Accept( conn); 907 669 } 908 670 … … 916 678 void crNetSingleRecv( CRConnection *conn, void *buf, unsigned int len ) 917 679 { 918 if (conn->type != CR_TCPIP) 919 { 920 crError( "Can't do a crNetSingleReceive on anything other than TCPIP." ); 921 } 680 /** @todo Remove after users have been identified and eliminated .*/ 681 crError( "Can't do a crNetSingleReceive on anything other than TCPIP." ); 922 682 conn->Recv( conn, buf, len ); 923 683 } … … 987 747 { 988 748 CRASSERT( len == sizeof(CRMessageFlowControl) ); 989 conn->send_credits += (conn->swap ? SWAP32(msg->credits) : msg->credits);749 conn->send_credits += msg->credits; 990 750 conn->InstantReclaim( conn, (CRMessage *) msg ); 991 751 } … … 1095 855 case CR_MESSAGE_OPCODES: 1096 856 case CR_MESSAGE_OOB: 1097 {1098 /*CRMessageOpcodes *ops = (CRMessageOpcodes *) msg;1099 *unsigned char *data_ptr = (unsigned char *) ops + sizeof( *ops) + ((ops->numOpcodes + 3 ) & ~0x03);1100 *crDebugOpcodes( stdout, data_ptr-1, ops->numOpcodes ); */1101 }1102 857 break; 1103 858 case CR_MESSAGE_READ_PIXELS: … … 1251 1006 void crNetReadline( CRConnection *conn, void *buf ) 1252 1007 { 1253 char *temp, c;1008 RT_NOREF(buf); 1254 1009 1255 1010 if (!conn || conn->type == CR_NO_CONNECTION) 1256 1011 return; 1257 1012 1258 if (conn->type != CR_TCPIP) 1259 { 1260 crError( "Can't do a crNetReadline on anything other than TCPIP (%d).",conn->type ); 1261 } 1262 temp = (char*)buf; 1263 for (;;) 1264 { 1265 conn->Recv( conn, &c, 1 ); 1266 if (c == '\n') 1267 { 1268 *temp = '\0'; 1269 return; 1270 } 1271 *(temp++) = c; 1272 } 1013 /** @todo Remove after users have been found and eliminated. */ 1014 crError( "Can't do a crNetReadline on anything other than TCPIP (%d).",conn->type ); 1273 1015 } 1274 1016 … … 1301 1043 int found_work = 0; 1302 1044 1303 if ( cr_net.use_tcpip )1304 found_work += crTCPIPRecv();1305 1045 #ifdef VBOX_WITH_HGCM 1306 1046 if ( cr_net.use_hgcm ) … … 1311 1051 ); 1312 1052 #endif 1313 #ifdef SDP_SUPPORT1314 if ( cr_net.use_sdp )1315 found_work += crSDPRecv();1316 #endif1317 #ifdef IB_SUPPORT1318 if ( cr_net.use_ib )1319 found_work += crIBRecv();1320 #endif1321 if ( cr_net.use_udp )1322 found_work += crUDPTCPIPRecv();1323 1324 if ( cr_net.use_file )1325 found_work += crFileRecv();1326 1327 #ifdef GM_SUPPORT1328 if ( cr_net.use_gm )1329 found_work += crGmRecv();1330 #endif1331 1332 #ifdef TEAC_SUPPORT1333 if ( cr_net.use_teac )1334 found_work += crTeacRecv();1335 #endif1336 1337 #ifdef TCSCOMM_SUPPORT1338 if ( cr_net.use_tcscomm )1339 found_work += crTcscommRecv();1340 #endif1341 1053 1342 1054 return found_work; 1343 1055 } 1344 1056 1345 1346 /**1347 * Teac/TSComm only1348 */1349 void1350 crNetSetRank( int my_rank )1351 {1352 cr_net.my_rank = my_rank;1353 #ifdef TEAC_SUPPORT1354 crTeacSetRank( cr_net.my_rank );1355 #endif1356 #ifdef TCSCOMM_SUPPORT1357 crTcscommSetRank( cr_net.my_rank );1358 #endif1359 }1360 1361 /**1362 * Teac/TSComm only1363 */1364 void1365 crNetSetContextRange( int low_context, int high_context )1366 {1367 #if !defined(TEAC_SUPPORT) && !defined(TCSCOMM_SUPPORT)1368 (void)low_context; (void)high_context;1369 #endif1370 #ifdef TEAC_SUPPORT1371 crTeacSetContextRange( low_context, high_context );1372 #endif1373 #ifdef TCSCOMM_SUPPORT1374 crTcscommSetContextRange( low_context, high_context );1375 #endif1376 }1377 1378 /**1379 * Teac/TSComm only1380 */1381 void1382 crNetSetNodeRange( const char *low_node, const char *high_node )1383 {1384 #if !defined(TEAC_SUPPORT) && !defined(TCSCOMM_SUPPORT)1385 (void)low_node; (void)high_node;1386 #endif1387 #ifdef TEAC_SUPPORT1388 crTeacSetNodeRange( low_node, high_node );1389 #endif1390 #ifdef TCSCOMM_SUPPORT1391 crTcscommSetNodeRange( low_node, high_node );1392 #endif1393 }1394 1395 /**1396 * Teac/TSComm only1397 */1398 void1399 crNetSetKey( const unsigned char* key, const int keyLength )1400 {1401 #ifdef TEAC_SUPPORT1402 crTeacSetKey( key, keyLength );1403 #else1404 (void)key; (void)keyLength;1405 #endif1406 } -
trunk/src/VBox/GuestHost/OpenGL/util/net_internals.h
r63199 r78190 10 10 11 11 /* 12 * DevNull network interface13 */14 extern void crDevnullInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );15 extern void crDevnullConnection( CRConnection *conn );16 extern int crDevnullRecv( void );17 extern CRConnection** crDevnullDump( int *num );18 19 20 /*21 * File network interface22 */23 extern void crFileInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );24 extern void crFileConnection( CRConnection *conn );25 extern int crFileRecv( void );26 extern CRConnection** crFileDump( int *num );27 28 29 /*30 * TCP/IP network interface31 */32 typedef enum {33 CRTCPIPMemory,34 CRTCPIPMemoryBig35 } CRTCPIPBufferKind;36 37 #define CR_TCPIP_BUFFER_MAGIC 0x8913453238 39 typedef struct CRTCPIPBuffer {40 unsigned int magic;41 CRTCPIPBufferKind kind;42 unsigned int len;43 unsigned int allocated;44 unsigned int pad; /* may be clobbered by crTCPIPSend() */45 } CRTCPIPBuffer;46 47 typedef struct {48 int initialized;49 int num_conns;50 CRConnection **conns;51 CRBufferPool *bufpool;52 #ifdef CHROMIUM_THREADSAFE53 CRmutex mutex;54 CRmutex recvmutex;55 #endif56 CRNetReceiveFuncList *recv_list;57 CRNetCloseFuncList *close_list;58 CRSocket server_sock;59 } cr_tcpip_data;60 61 extern cr_tcpip_data cr_tcpip;62 63 extern void crTCPIPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );64 extern void crTCPIPConnection( CRConnection *conn );65 extern int crTCPIPRecv( void );66 extern CRConnection** crTCPIPDump( int *num );67 extern int crTCPIPDoConnect( CRConnection *conn );68 extern void crTCPIPDoDisconnect( CRConnection *conn );69 extern int crTCPIPErrno( void );70 extern char *crTCPIPErrorString( int err );71 extern void crTCPIPAccept( CRConnection *conn, const char *hostname, unsigned short port );72 extern void crTCPIPWriteExact( CRConnection *conn, const void *buf, unsigned int len );73 extern void crTCPIPFree( CRConnection *conn, void *buf );74 extern void *crTCPIPAlloc( CRConnection *conn );75 extern void crTCPIPReadExact( CRConnection *conn, void *buf, unsigned int len );76 extern int __tcpip_write_exact( CRSocket sock, const void *buf, unsigned int len );77 extern int __tcpip_read_exact( CRSocket sock, void *buf, unsigned int len );78 extern void __tcpip_dead_connection( CRConnection *conn );79 extern int __crSelect( int n, fd_set *readfds, int sec, int usec );80 81 82 /*83 * UDP network interface84 */85 extern void crUDPTCPIPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );86 extern void crUDPTCPIPConnection( CRConnection *conn );87 extern int crUDPTCPIPRecv( void );88 89 /*90 12 * VirtualBox HGCM 91 13 */ 92 14 #ifdef VBOX_WITH_HGCM 93 extern void crVBoxHGCMInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl , unsigned int mtu);15 extern void crVBoxHGCMInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl); 94 16 extern void crVBoxHGCMConnection( CRConnection *conn 95 17 #if defined(VBOX_WITH_CRHGSMI) && defined(IN_GUEST) … … 111 33 #endif 112 34 113 /*114 * TEAC network interface115 */116 #ifdef TEAC_SUPPORT117 extern void crTeacInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl,118 unsigned int mtu );119 extern void crTeacConnection( CRConnection *conn );120 extern int crTeacRecv( void );121 extern void crTeacSetRank( int );122 extern void crTeacSetContextRange( int, int );123 extern void crTeacSetNodeRange( const char *, const char * );124 extern void crTeacSetKey( const unsigned char *key, const int keyLength );125 #endif /* TEAC_SUPPORT */126 127 128 /*129 * Tcscomm network interface130 */131 #ifdef TCSCOMM_SUPPORT132 extern void crTcscommInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl,133 unsigned int mtu );134 extern void crTcscommConnection( CRConnection *conn );135 extern int crTcscommRecv( void );136 #endif /* TCSCOMM_SUPPORT */137 138 139 /*140 * SDP network interface141 */142 #ifdef SDP_SUPPORT143 extern const char *crGetSDPHostnameSuffix(void);144 extern void crSDPInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );145 extern void crSDPConnection( CRConnection *conn );146 extern int crSDPRecv( void );147 extern CRConnection** crSDPDump( int *num );148 #endif /* SDP_SUPPORT */149 150 151 /*152 * Infiniband network interface153 */154 #ifdef IB_SUPPORT155 extern void crIBInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );156 extern void crIBConnection( CRConnection *conn );157 extern int crIBRecv( void );158 extern CRConnection** crIBDump( int *num );159 #endif /* IB_SUPPORT */160 161 162 /*163 * GM network interface164 */165 #ifdef GM_SUPPORT166 extern void crGmInit( CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu );167 extern void crGmConnection( CRConnection *conn );168 extern int crGmRecv( void );169 extern CRConnection** crGmDump( int *num );170 extern int crGmDoConnect( CRConnection *conn );171 extern void crGmDoDisconnect( CRConnection *conn );172 extern int crGmErrno( void );173 extern char *crGmErrorString( int err );174 extern void crGmAccept( CRConnection *conn, const char *hostname, unsigned short port );175 extern void crGmSendExact( CRConnection *conn, const void *buf, unsigned int len );176 extern void crGmFree( CRConnection *conn, void *buf );177 extern void *crGmAlloc( CRConnection *conn );178 extern void crGmReadExact( CRConnection *conn, void *buf, unsigned int len );179 extern void crGmBogusRecv( CRConnection *conn, void *buf, unsigned int len );180 extern void crGmHandleNewMessage( CRConnection *conn, CRMessage *msg, unsigned int len );181 extern void crGmInstantReclaim( CRConnection *conn, CRMessage *msg );182 extern unsigned int crGmNodeId( void );183 extern unsigned int crGmPortNum( void );184 #endif /* GM_SUPPORT */185 186 187 35 extern CRConnection** crNetDump( int *num ); 188 36 -
trunk/src/VBox/GuestHost/OpenGL/util/process.c
r63199 r78190 22 22 #define snprintf _snprintf 23 23 #endif 24 25 /**26 * Sleep/pause for the given number of seconds.27 */28 void crSleep( unsigned int seconds )29 {30 #ifdef WINDOWS31 Sleep(seconds*1000); /* milliseconds */32 #else33 sleep(seconds);34 #endif35 }36 37 /**38 * Sleep/pause for the given number of milliseconds.39 */40 void crMsleep( unsigned int msec )41 {42 #ifdef WINDOWS43 Sleep(msec);44 #else45 usleep(msec*1000); /* usecs */46 #endif47 }48 49 50 /*51 * Spawn (i.e. fork/exec) a new process.52 */53 CRpid crSpawn( const char *command, const char *argv[] )54 {55 #ifdef WINDOWS56 char newargv[1000];57 int i;58 STARTUPINFO si;59 PROCESS_INFORMATION pi;60 61 (void) command;62 63 ZeroMemory( &si, sizeof(si) );64 si.cb = sizeof(si);65 ZeroMemory( &pi, sizeof(pi) );66 67 crStrncpy(newargv, argv[0], 1000 );68 for (i = 1; argv[i]; i++) {69 crStrcat(newargv, " ");70 crStrcat(newargv, argv[i]);71 }72 73 if ( !CreateProcess(NULL, newargv, NULL, NULL, FALSE, 0, NULL,74 NULL, &si, &pi) )75 {76 crWarning("crSpawn failed, %d", GetLastError());77 return 0;78 }79 return pi.hProcess;80 #else81 pid_t pid;82 if ((pid = fork()) == 0)83 {84 /* I'm the child */85 int err = execvp(command, (char * const *) argv);86 crWarning("crSpawn failed (return code: %d)", err);87 return 0;88 }89 return (unsigned long) pid;90 #endif91 }92 93 94 /*95 * Kill the named process.96 */97 void crKill( CRpid pid )98 {99 #ifdef WINDOWS100 TerminateProcess( pid, 0 );101 #else102 kill((pid_t) pid, SIGKILL);103 #endif104 }105 106 24 107 25 /* … … 208 126 209 127 210 /*211 * Return current directory string.212 */213 void crGetCurrentDir( char *dir, int maxLen )214 {215 #ifdef WINDOWS216 if (!GetCurrentDirectory(maxLen, dir))217 dir[0] = 0;218 #else219 if (!getcwd(dir, maxLen))220 dir[0] = 0;221 #endif222 }223 224 225 128 /** 226 129 * Return current process ID number. -
trunk/src/VBox/GuestHost/OpenGL/util/util.def
r69392 r78190 12 12 crDebug 13 13 crInfo 14 crParseURL15 crAlloc16 crCalloc17 crAllocDebug18 crCallocDebug19 crRealloc20 crMemset21 crFree22 14 crStrSplit 23 15 crStrSplitn … … 43 35 crBytesToString 44 36 crWordsToString 45 crGetHostname46 37 crGetPID 47 38 crNetAcceptClient … … 74 65 crImageSize 75 66 crTextureSize 76 crGetenv77 crSetenv78 67 crHashtableAdd 79 68 crHashtableDelete … … 90 79 crFreeHashtableEx 91 80 crHashtableGetDataKey 92 crDetermineEndianness93 SWAPDOUBLE94 81 crBufferPoolInit 95 82 crBufferPoolPush 96 83 crBufferPoolPop 97 84 crBufferPoolFree 98 crTimerNewTimer99 85 crBufferPoolGetNumBuffers 100 86 crBufferPoolGetMaxBuffers 101 crDestroyTimer102 crStartTimer103 crStopTimer104 crResetTimer105 crTimerTime106 crMemcpy107 crMemcmp108 crMemZero109 crCalloc110 87 crSetTSD 111 88 crGetTSD … … 129 106 crGetTSD 130 107 crFreeTSD 131 crRandFloat132 crRandInt133 crRandSeed134 crRandAutoSeed135 crTransformBBox136 crProjectBBox137 crRectiUnion138 crWarpPoint139 crHullInteriorBox140 crNetSetNodeRange141 crNetSetContextRange142 crNetSetRank143 crNetSetKey144 crSleep145 crSpawn146 crKill147 108 crGetProcName 148 crGetCurrentDir149 109 crHashtableAllocKeys 150 110 crHashtableDeleteBlock -
trunk/src/VBox/GuestHost/OpenGL/util/vboxhgcm.c
r76553 r78190 32 32 #include "cr_mem.h" 33 33 #include "cr_string.h" 34 #include "cr_endian.h"35 34 #include "cr_threads.h" 36 35 #include "net_internals.h" … … 1185 1184 * Called on host side only, to "accept" client connection 1186 1185 */ 1187 static void crVBoxHGCMAccept( CRConnection *conn, const char *hostname, unsigned short port ) 1188 { 1189 RT_NOREF(hostname, port); 1186 static void crVBoxHGCMAccept( CRConnection *conn) 1187 { 1190 1188 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); 1191 1189 CRASSERT(conn && conn->pHostBuffer); … … 2067 2065 * Called on host side only, to "accept" client connection 2068 2066 */ 2069 static void crVBoxHGSMIAccept( CRConnection *conn , const char *hostname, unsigned short port)2067 static void crVBoxHGSMIAccept( CRConnection *conn) 2070 2068 { 2071 2069 VBOXCRHGSMIPROFILE_FUNC_PROLOGUE(); … … 2186 2184 #endif 2187 2185 2188 void crVBoxHGCMInit(CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl, unsigned int mtu) 2189 { 2190 (void) mtu; 2191 2186 void crVBoxHGCMInit(CRNetReceiveFuncList *rfl, CRNetCloseFuncList *cfl) 2187 { 2192 2188 g_crvboxhgcm.recv_list = rfl; 2193 2189 g_crvboxhgcm.close_list = cfl;
Note:
See TracChangeset
for help on using the changeset viewer.