From: Eric B. <ee...@us...> - 2003-05-12 15:11:09
|
Update of /cvsroot/sandiaportals/portals/linux/utils In directory sc8-pr-cvs1:/tmp/cvs-serv11944/linux/utils Modified Files: Tag: b_devel portals.c Log Message: * Added Nikke's scimacnal Index: portals.c =================================================================== RCS file: /cvsroot/sandiaportals/portals/linux/utils/portals.c,v retrieving revision 1.12.2.3 retrieving revision 1.12.2.4 diff -u -w -b -B -p -r1.12.2.3 -r1.12.2.4 --- portals.c 6 May 2003 14:28:01 -0000 1.12.2.3 +++ portals.c 12 May 2003 15:11:06 -0000 1.12.2.4 @@ -64,6 +64,7 @@ static name2num_t nalnames[] = { {"toe", TOENAL}, {"elan", QSWNAL}, {"gm", GMNAL}, + {"scimac", SCIMACNAL}, {NULL, -1} }; @@ -147,6 +148,12 @@ ptl_parse_nid (ptl_nid_t *nidp, char *st return (0); } + if (sscanf (str, "%x", &a) == 1) + { + *nidp = (ptl_nid_t) a; + return (0); + } + return (-1); } @@ -159,6 +166,10 @@ ptl_nid2str (char *buffer, ptl_nid_t nid sprintf (buffer, LPD64, nid); return (buffer); + case SCIMACNAL: + sprintf (buffer, LPX64, nid); + return (buffer); + case SOCKNAL: { __u32 addr = htonl((__u32)nid); /* back to NETWORK byte order */ struct hostent *he = gethostbyaddr ((const char *)&addr, sizeof (addr), AF_INET); @@ -505,6 +516,16 @@ int jt_ptl_connect(int argc, char **argv g_nid = atoi(argv[1]); } else if (g_nal == GMNAL) { g_nid = atoi(argv[1]); + } else if (g_nal == SCIMACNAL) { + unsigned int tmpnid; + if(sscanf(argv[1], "%x", &tmpnid) == 1) { + g_nid=tmpnid; + } + else { + fprintf(stderr, "nid %s invalid for SCI nal\n", argv[1]); + } + + } else { fprintf(stderr, "This should never happen. Also it is very " "bad.\n"); @@ -558,6 +579,9 @@ int jt_ptl_disconnect(int argc, char **a } else if (g_nal == GMNAL) { printf("'disconnect' doesn't make any sense for " "GM.\n"); + } else if (g_nal == SCIMACNAL) { + printf("'disconnect' doesn't make any sense for " + "SCI.\n"); } else { fprintf(stderr, "This should never happen. Also it is very " "bad.\n"); @@ -610,6 +634,8 @@ int jt_ptl_push_connection (int argc, ch printf("'push' doesn't make any sense for elan.\n"); } else if (g_nal == GMNAL) { printf("'push' doesn't make any sense for GM.\n"); + } else if (g_nal == SCIMACNAL) { + printf("'push' doesn't make any sense for SCI.\n"); } else { fprintf(stderr, "This should never happen. Also it is very " "bad.\n"); @@ -704,6 +730,9 @@ int jt_ptl_mynid(int argc, char **argv) return -1; } else if (g_nal == GMNAL) { fprintf(stderr, "'mynid' doesn't make any sense for GM.\n"); + return -1; + } else if (g_nal == SCIMACNAL) { + fprintf(stderr, "'mynid' doesn't make any sense for SCI.\n"); return -1; } |