31 uint16 network = htons (host);
43 uint16 host = ntohs (network);
59 char errbuf[PCAP_ERRBUF_SIZE];
63 if (pcap_findalldevs(&alldevs, errbuf) == -1)
65 fprintf(stderr,
"Error in pcap_findalldevs_ex: %s\n", errbuf);
71 for(d= alldevs; d != NULL; d= d->next)
80 prev_adapter->
next = adapter;
84 ret_adapter = adapter;
91 string_len = strlen(d->name);
96 strncpy(adapter->
name, d->name,string_len);
97 adapter->
name[string_len] =
'\0';
101 adapter->
name[0] =
'\0';
105 string_len = strlen(d->description);
110 strncpy(adapter->
desc, d->description,string_len);
111 adapter->
desc[string_len] =
'\0';
115 adapter->
desc[0] =
'\0';
117 prev_adapter = adapter;
121 pcap_freealldevs(alldevs);
138 next_adapter = adapter->
next;
142 adapter = next_adapter;
143 next_adapter = adapter->
next;
#define EC_MAXLEN_ADAPTERNAME
char name[EC_MAXLEN_ADAPTERNAME]
static char errbuf[PCAP_ERRBUF_SIZE]
char desc[EC_MAXLEN_ADAPTERNAME]
uint16 oshw_htons(uint16 host)
void oshw_free_adapters(ec_adaptert *adapter)
uint16 oshw_ntohs(uint16 network)
ec_adaptert * oshw_find_adapters(void)