+ rc = pcfg_ioctl (&pcfg);
+ if (rc != 0) {
+ fprintf (stderr, "failed to delete interface: %s\n",
+ strerror (errno));
+ return -1;
+ }
+
+ return 0;
+}
+
+int
+jt_ptl_print_peers (int argc, char **argv)
+{
+ struct portals_cfg pcfg;
+ char buffer[2][64];
+ int index;
+ int rc;
+
+ if (!g_nal_is_compatible (argv[0], SOCKNAL, RANAL,
+ OPENIBNAL, IIBNAL, VIBNAL, 0))
+ return -1;
+
+ for (index = 0;;index++) {
+ PCFG_INIT (pcfg, NAL_CMD_GET_PEER);
+ pcfg.pcfg_count = index;
+
+ rc = pcfg_ioctl (&pcfg);
+ if (rc != 0)
+ break;
+
+ if (g_nal_is_compatible(NULL, SOCKNAL, 0))
+ printf (LPX64"[%d]%s@%s:%d #%d\n",
+ pcfg.pcfg_nid, pcfg.pcfg_wait,
+ ptl_ipaddr_2_str (pcfg.pcfg_size, buffer[0], 1),
+ ptl_ipaddr_2_str (pcfg.pcfg_id, buffer[1], 1),
+ pcfg.pcfg_misc, pcfg.pcfg_count);
+ else if (g_nal_is_compatible(NULL, RANAL, OPENIBNAL, 0))
+ printf (LPX64"[%d]@%s:%d\n",
+ pcfg.pcfg_nid, pcfg.pcfg_wait,
+ ptl_ipaddr_2_str (pcfg.pcfg_id, buffer[1], 1),
+ pcfg.pcfg_misc);
+ else
+ printf (LPX64"[%d]\n",
+ pcfg.pcfg_nid, pcfg.pcfg_wait);