6 bool do_cabletest (int nb, const char **com, struct ngadmin *nga) {
9 const struct swi_attr *sa;
10 struct cabletest *ct=NULL;
15 printf("Usage: cabletest <port1> [<port2> ...]\n");
19 if ( (sa=ngadmin_getCurrentSwitch(nga))==NULL ) {
20 printf("must be logged\n");
25 ct=malloc(sa->ports*sizeof(struct cabletest));
26 memset(ct, 0, sa->ports*sizeof(struct cabletest));
29 ct[j].port=strtol(com[k++], NULL, 0);
30 if ( ct[j].port>=1 && ct[j].port<=sa->ports ) ++j;
33 i=ngadmin_cabletest(nga, ct, j);
42 printf("port %i: %08X %08X\n", ct[i].port, ct[i].v1, ct[i].v2);