5 bool do_cabletest (int nb, const char **com, struct ngadmin *nga)
8 const struct swi_attr *sa;
9 struct cabletest *ct = NULL;
14 printf("Usage: cabletest <port1> [<port2> ...]\n");
19 sa = ngadmin_getCurrentSwitch(nga);
21 printf("must be logged\n");
26 ct = malloc(sa->ports * sizeof(struct cabletest));
27 memset(ct, 0, sa->ports * sizeof(struct cabletest));
30 ct[j].port = strtol(com[k++], NULL, 0);
31 if (ct[j].port >= 1 && ct[j].port <= sa->ports)
35 i = ngadmin_cabletest(nga, ct, j);
42 for (i = 0; i < j; i++)
43 printf("port %i: %08X %08X\n", ct[i].port, ct[i].v1, ct[i].v2);