* mapping of virtual nodes into the port range of an IP socket.
*/
+#define DEBUG_SUBSYSTEM S_NAL
+
#include <stdlib.h>
#include <netdb.h>
#include <unistd.h>
x = 0;
return(ntohl(x));
}
- else
+ else
{
if (host_envp[1] != 'x')
{
void set_address(bridge t,ptl_pid_t pidrequest)
{
- int virtnode, in_addr, port;
+ int virtnode, in_addr, port;
ptl_pid_t pid;
/* get and remember my node id*/
if (!getenv("PTL_VIRTNODE"))
virtnode = 0;
- else
+ else
{
- int maxvnode = PNAL_VNODE_MASK - (PNAL_BASE_PORT
+ int maxvnode = PNAL_VNODE_MASK - (PNAL_BASE_PORT
>> PNAL_VNODE_SHIFT);
virtnode = atoi(getenv("PTL_VIRTNODE"));
if (virtnode > maxvnode)
return;
}
}
-
+
in_addr = get_node_id();
t->iptop8 = in_addr >> PNAL_HOSTID_SHIFT;/* for making new connections */
- t->lib_nal->libnal_ni.ni_pid.nid = ((in_addr & PNAL_HOSTID_MASK)
+ t->lib_nal->libnal_ni.ni_pid.nid = ((in_addr & PNAL_HOSTID_MASK)
<< PNAL_VNODE_SHIFT)
+ virtnode;
pid=pidrequest;
#ifdef notyet
if (pid==(unsigned short)PTL_PID_ANY) port = 0;
#endif
- if (pid==(unsigned short)PTL_PID_ANY)
+ if (pid==(unsigned short)PTL_PID_ANY)
{
fprintf(stderr, "portal pid PTL_ID_ANY is not currently supported\n");
return;