Hi,

I tried a simple program to list all the devices of the remote machine for eg.


IP Addr : 137.72.248.19
Port  : 9898

FYI : Attaching a text file(simple.txt) which contains the code

and when I try to execute the program the output is (you see one error in bold 
text)

output:-----

------------------------------------------------------------------------------------------------

Enter the device you want to list:

rpcap://              ==> lists interfaces in the local machine

rpcap://hostname:port ==> lists interfaces in a remote machine

                          (rpcapd daemon must be up and running

                           and it must accept 'null' authentication)

file://foldername     ==> lists all pcap files in the give folder



Enter your choice: rpcap://137.72.248.19:9898

Error in pcap_findalldevs: getaddrinfo(): The specified class was not 
found.  (code 10109)

------------------------------------------------------------------------------------------------

here the 137.72.248.19 is the address of remote machine 

however it cannot find "getaddrinfo()" during run time


And also  I tried executing the daemon : 
c:\Winpcap>rpcapd.exe -b137.72.248.19 -p9898 -n

Still the issue remains the same....

Can anyone help on how to overcome this ??

Thanks in advance,
Vishwesh




#include "pcap.h"

#ifndef WIN32
#include <sys/socket.h>
#include <netinet/in.h>
#else
#include <winsock.h>
#endif


// Function prototypes
int main()
{
pcap_if_t *alldevs;
pcap_if_t *d;
char errbuf[PCAP_ERRBUF_SIZE+1];
char source[PCAP_ERRBUF_SIZE+1];

printf("Enter the device you want to list:\n"
"rpcap:// ==> lists interfaces in the local machine\n"
"rpcap://hostname:port ==> lists interfaces in a remote machine\n"
" (rpcapd daemon must be up and running\n"
" and it must accept 'null' authentication)\n"
"file://foldername ==> lists all pcap files in the give folder\n\n"
"Enter your choice: ");

fgets(source, PCAP_ERRBUF_SIZE, stdin);
source[PCAP_ERRBUF_SIZE] = '\0';

/* Retrieve the interfaces list */
if (pcap_findalldevs_ex(source, NULL, &alldevs, errbuf) == -1)
{
fprintf(stderr,"Error in pcap_findalldevs: %s\n",errbuf);
exit(1);
}

/* Scan the list printing every entry */
for(d=alldevs;d;d=d->next)
{
printf("\n\n%s",d->name);
}

pcap_freealldevs(alldevs);

return 1;
}
_______________________________________________
Winpcap-users mailing list
[email protected]
https://www.winpcap.org/mailman/listinfo/winpcap-users

Reply via email to