| | 2365 | | mroute(mid, dtid, tag, tmout) |
| | 2366 | | int mid; |
| | 2367 | | int dtid; |
| | 2368 | | int tag; |
| | 2369 | | struct timeval *tmout; |
| | 2370 | | { |
| | 2371 | | static int alreadyhere = 0; |
| | 2372 | | |
| | 2373 | | struct ttpcb *pcbp; |
| | 2374 | | int s; |
| | 2375 | | int sbf; |
| | | | ... |
| | 2378 | | int l; |
| | 2379 | | #ifdef SOCKLENISUINT |
| | 2380 | | #if defined(IMA_AIX4SP2) || defined(IMA_AIX5SP2) |
| | 2381 | | unsigned int oslen; |
| | 2382 | | #else |
| | 2383 | | size_t oslen; |
| | 2384 | | #endif |
| | 2385 | | #else |
| | 2386 | | int oslen; |
| | 2387 | | #endif |
| | 2388 | | int cc = 0; |
| | 2389 | | int gotem = 0; |
| | 2390 | | static struct timeval ztv = { 0, 0 }; |
| | 2391 | | char *addr = 0; |
| | 2392 | | #ifndef NOUNIXDOM |
| | 2393 | | struct sockaddr_un uns; |
| | 2394 | | char spath[PVMTMPNAMLEN];
|
| | 2395 | | #endif |
| | 2396 | | |
| | 2397 | | if (up = midtobuf(mid)) { |
| | 2398 | | up->m_dst = dtid; |
| | 2399 | | up->m_tag = tag; |
| | 2400 | | } |
| | 2401 | | |
| | 2402 | | if (alreadyhere) { |
| | 2403 | | if (up) { |
| | 2404 | | up->m_ref++; |
| | 2405 | | txlist[txwp] = up; |
| | 2406 | | if (++txwp >= sizeof(txlist)/sizeof(txlist[0])) |
| | 2407 | | txwp = 0; |
| | 2408 | | if (txwp == txrp) |
| | 2409 | | abort(); |
| | 2410 | | } |
| | 2411 | | |
| | 2412 | | |
| | 2413 | | |
| | 2414 | | if (!tmout || tmout->tv_sec || tmout->tv_usec) |
| | 2415 | | return PvmNotImpl;
|
| | 2416 | | |
| | 2417 | | return 0; |
| | 2418 | | } |
| | 2419 | | |
| | 2420 | | alreadyhere = 1; |
| | 2421 | | |
| | 2422 | | |
| | 2423 | | |
| | 2424 | | |
| | 2425 | | |
| | 2426 | | |
| | 2427 | | |
| | 2428 | | |
| | 2429 | | |
| | 2430 | | |
| | 2431 | | |
| | 2432 | | |
| | 2433 | | |
| | 2434 | | if (up) { |
| | 2435 | | |
| | 2436 | | #if !defined(IMA_MPP) |
| | 2437 | | |
| | 2438 | | |
| | 2439 | | |
| | 2440 | | |
| | 2441 | | |
| | 2442 | | |
| | 2443 | | |
| | 2444 | | |
| | 2445 | | |
| | 2446 | | if (pvmrouteopt == PvmRouteDirect
|
| | 2447 | | && dtid |
| | 2448 | | && TIDISTASK(dtid)
|
| | 2449 | | && dtid != pvmmytid |
| | 2450 | | && !ttpcb_find(dtid)) |
| | 2451 | | { |
| | 2452 | | |
| | 2453 | | #if !defined(NOUNIXDOM) |
| | 2454 | | |
| | 2455 | | |
| | 2456 | | if ((pvmmytid & TIDHOST) == (dtid & TIDHOST)) {
|
| | 2457 | | if ((s = socket(AF_UNIX, SOCK_STREAM, 0)) == -1) {
|
| | 2458 | | pvmlogperror("mroute() socket"); |
| | 2459 | | |
| | 2460 | | } else { |
| | 2461 | | BZERO((char*)&uns, sizeof(uns));
|
| | 2462 | | uns.sun_family = AF_UNIX;
|
| | 2463 | | spath[0] = 0; |
| | 2464 | | (void)PVMTMPNAMFUN(spath);
|
| | 2465 | | strcpy(uns.sun_path, spath); |
| | 2466 | | |
| | 2467 | | oslen = sizeof(uns); |
| | 2468 | | if (bind(s, (struct sockaddr*)&uns, oslen) == -1) { |
| | 2469 | | pvmlogperror("mroute() bind"); |
| | 2470 | | (void)close(s); |
| | 2471 | | s = -1; |
| | 2472 | | |
| | 2473 | | } else { |