Getting a list of ports present on the system.
#include <stdio.h>
int main(int argc, char **argv)
{
printf("Getting port list.\n");
printf("sp_list_ports() failed!\n");
return -1;
}
int i;
for (i = 0; port_list[i] != NULL; i++) {
struct sp_port *port = port_list[i];
printf("Found port: %s\n", port_name);
}
printf("Found %d ports.\n", i);
printf("Freeing port list.\n");
return 0;
}