Hey I found the way to get the list of interfaces. Here is how (for for those interested in the subject)
Code:
/* Show the list of interfaces to the user. */
void
show_interfaces(void)
{
pcap_if_t *interface_list;
pcap_if_t *if_list_ptr;
int result;
int i;
/* Ask libpcap for the list of interfaces */
result = pcap_findalldevs(&interface_list, errbuf);
if (result == -1) {
fprintf(stderr, "%s\n", errbuf);
exit(1);
}
/* Show them to the user */
if_list_ptr = interface_list;
i = 0;
while (if_list_ptr) {
if (if_list_ptr->description) {
printf("%d. %s (%s)\n", i, if_list_ptr->name,
if_list_ptr->description);
}
else {
printf("%d. %s\n", i, if_list_ptr->name);
}
if_list_ptr = if_list_ptr->next;
i += 1;
}
pcap_freealldevs(interface_list);
}