In general, the first thing to write a WinPcap-based application is to get a list of connected network adapters. Both Libpcap and WinPcap provide the PCAP_FINDALLDEVS_EX () function to implement this function: This function returns a list of pcap_if structures, each of which contains the details of an adapter. It is important to note that the data field name and description represent an adapter name and a description that people can understand.
Steps to debug your code in VS2008:
Operational Environment Preparation: Wpdpack_4_1_2 installation package
1: Put Wpdpack_4_1_2 unzip in the C packing directory, open Microsoft Visual Studio 2010, copy the API code to get the device list to the work panel, the code is as follows 650) this.width=650; "Src=" http ://s5.51cto.com/wyfs02/m01/89/4a/wkiol1gpcomsk5vfaabvt-pekgy600.png "title=" CQ (q87{6judqlu~s4c3ulot.png "alt=" Wkiol1gpcomsk5vfaabvt-pekgy600.png "/>
However, when you can run the write, you can find that it is an error when we want to configure some things Project-->** properties (ALT+F7) configuration Properties---inventory tools--input and output----embedded list--no Project-->** properties (ALT + F7) Configuration Properties-->c/c++--> General-and additional include directory-->include (Wpdpack_4_1_2 under C-drive) Project-->** properties (ALT+F7) configuration Properties--linker-- General--Additional library directory-->lib (Wpdpack_4_1_2 under the C-disk) Project-->** properties (ALT+F7) configuration Properties--linker--Add dependencies--add "; Packet.lib;wpcap.lib "Project-->** Property (ALT+F7) configuration property-->c/c++--> Preprocessor---preprocessor definition--supplemental"; Have_remote "
++++++++++++++++++++++++++++++++++++++++++++++++++++++
This compiles without an error, the compilation results can be seen
650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M00/89/4A/wKioL1gPDB7QBvHYAABY8jJ1IPg098.png "title=" SO4FA} Bi6ezq5[i (DXP ' rsw.png "alt=" Wkiol1gpdb7qbvhyaaby8jj1ipg098.png "/>
This is the success!!!
Get the list of Devices API