亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? group__wpcap__tut1.html

?? Winpcap是一個強大的網絡開發庫
?? HTML
字號:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8"><title>WinPcap: Obtaining the device list</title><link href="style.css" rel="stylesheet" type="text/css"><link href="tabs.css" rel="stylesheet" type="text/css"></head><body><!-- Generated by Doxygen 1.5.6 --><div class="navigation" id="top">  <div class="tabs">    <ul>      <li><a href="main.html"><span>Main&nbsp;Page</span></a></li>      <li><a href="pages.html"><span>Related&nbsp;Pages</span></a></li>      <li><a href="modules.html"><span>Modules</span></a></li>      <li><a href="annotated.html"><span>Data&nbsp;Structures</span></a></li>      <li><a href="files.html"><span>Files</span></a></li>    </ul>  </div></div><div class="contents"><h1>Obtaining the device list</h1><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>Typically, the first thing that a WinPcap-based application does is get a list of attached network adapters. Both libpcap and WinPcap provide the <a class="el" href="group__wpcapfunc.html#g98f36e62c95c6ad81eaa8b2bbeb8f16e" title="Create a list of network devices that can be opened with pcap_open().">pcap_findalldevs_ex()</a> function for this purpose: this function returns a linked list of <a class="el" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if</a> structures, each of which contains comprehensive information about an attached adapter. In particular, the fields <em>name</em> and <em>description</em> contain the name and a human readable description, respectively, of the corresponding device.<p>The following code retrieves the adapter list and shows it on the screen, printing an error if no adapters are found.<p><div class="fragment"><pre class="fragment"><span class="preprocessor">#include "pcap.h"</span>main(){    <a class="code" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if_t</a> *alldevs;    <a class="code" href="structpcap__if.html" title="Item in a list of interfaces, used by pcap_findalldevs().">pcap_if_t</a> *d;    <span class="keywordtype">int</span> i=0;    <span class="keywordtype">char</span> errbuf[<a class="code" href="group__wpcap__def.html#gcd448353957d92c98fccc29e1fc8d927" title="Size to use when allocating the buffer that contains the libpcap errors.">PCAP_ERRBUF_SIZE</a>];        <span class="comment">/* Retrieve the device list from the local machine */</span>    <span class="keywordflow">if</span> (<a class="code" href="group__wpcapfunc.html#g98f36e62c95c6ad81eaa8b2bbeb8f16e" title="Create a list of network devices that can be opened with pcap_open().">pcap_findalldevs_ex</a>(<a class="code" href="group__remote__source__string.html#g6d7103b8a7e1eca8c325bd8f32c361c3" title="String that will be used to determine the type of source in use (file, remote/local...">PCAP_SRC_IF_STRING</a>, NULL <span class="comment">/* auth is not needed */</span>, &amp;alldevs, errbuf) == -1)    {        fprintf(stderr,<span class="stringliteral">"Error in pcap_findalldevs_ex: %s\n"</span>, errbuf);        exit(1);    }        <span class="comment">/* Print the list */</span>    <span class="keywordflow">for</span>(d= alldevs; d != NULL; d= d-&gt;<a class="code" href="structpcap__if.html#81508e6e4e41ca4235c8d6b51913c536" title="if not NULL, a pointer to the next element in the list; NULL for the last element...">next</a>)    {        printf(<span class="stringliteral">"%d. %s"</span>, ++i, d-&gt;<a class="code" href="structpcap__if.html#5ac083a645d964373f022d03df4849c8" title="a pointer to a string giving a name for the device to pass to pcap_open_live()">name</a>);        <span class="keywordflow">if</span> (d-&gt;<a class="code" href="structpcap__if.html#8444d6e0dfe2bbab0b5e7b24308f1559" title="if not NULL, a pointer to a string giving a human-readable description of the device...">description</a>)            printf(<span class="stringliteral">" (%s)\n"</span>, d-&gt;<a class="code" href="structpcap__if.html#8444d6e0dfe2bbab0b5e7b24308f1559" title="if not NULL, a pointer to a string giving a human-readable description of the device...">description</a>);        <span class="keywordflow">else</span>            printf(<span class="stringliteral">" (No description available)\n"</span>);    }        <span class="keywordflow">if</span> (i == 0)    {        printf(<span class="stringliteral">"\nNo interfaces found! Make sure WinPcap is installed.\n"</span>);        <span class="keywordflow">return</span>;    }    <span class="comment">/* We don't need any more the device list. Free it */</span>    <a class="code" href="group__wpcapfunc.html#g346b4b0b7fd1cda4abb9a39f767dbeb1" title="Free an interface list returned by pcap_findalldevs().">pcap_freealldevs</a>(alldevs);}</pre></div><p>Some comments about this code.<p>First of all, <a class="el" href="group__wpcapfunc.html#g98f36e62c95c6ad81eaa8b2bbeb8f16e" title="Create a list of network devices that can be opened with pcap_open().">pcap_findalldevs_ex()</a>, like other libpcap functions, has an <em>errbuf</em> parameter. This parameter points to a string filled by libpcap with a description of the error if something goes wrong.<p>Second, remember that not all the OSes supported by libpcap provide a description of the network interfaces, therefore if we want to write a portable application, we must consider the case in which <em>description</em> is null: we print the string "No description available" in that situation.<p>Note finally that we free the list with <a class="el" href="group__wpcapfunc.html#g346b4b0b7fd1cda4abb9a39f767dbeb1" title="Free an interface list returned by pcap_findalldevs().">pcap_freealldevs()</a> once when we have finished with it.<p>Let's try to compile and run the code of this first sample. In order to compile it under Unix or Cygwin, simply type:<p><pre>  gcc -o testprog testprog.c -lpcap</pre><p>On Windows, you will need to create a project, following the instructions in the <a class="el" href="group__wpcapsamps.html">Using WinPcap in your programs</a> section of this manual. However, we suggest that you use the WinPcap developer's pack (available at the WinPcap website, <a href="http://www.winpcap.org">http://www.winpcap.org</a> ), since it provides many examples already configured as projects including all the code presented in this tutorial and the <em>includes</em> and <em>libraries</em> needed to compile and run the examples.<p>Assuming we have compiled the program, let's try to run it. On a particular WinXP workstation, the result we optained is<p><pre>   1. \Device\NPF_{4E273621-5161-46C8-895A-48D0E52A0B83} (Realtek RTL8029(AS) Ethernet Adapter)   2. \Device\NPF_{5D24AE04-C486-4A96-83FB-8B5EC6C7F430} (3Com EtherLink PCI) </pre><p>As you can see, the name of the network adapters (that will be passed to libpcap when opening the devices) under Windows are quite unreadable, so the parenthetical descriptions can be very helpful.<p><a class="el" href="group__wpcap__tut.html">&lt;&lt;&lt; Previous</a> <a class="el" href="group__wpcap__tut2.html">Next &gt;&gt;&gt;</a> </div><hr><p align="right"><img border="0" src="winpcap_small.gif" align="absbottom" width="91" height="27">documentation. Copyright (c) 2002-2005 Politecnico di Torino. Copyright (c) 2005-2008CACE Technologies. All rights reserved.</p>

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
91久久线看在观草草青青| 中文字幕av一区二区三区免费看| 精品国产乱码久久久久久免费| 1区2区3区精品视频| 蜜臀av性久久久久蜜臀aⅴ| jizzjizzjizz欧美| 欧美大胆一级视频| 午夜电影网亚洲视频| 99re免费视频精品全部| 精品久久久网站| 亚洲成人自拍网| 色综合久久综合中文综合网| 国产拍揄自揄精品视频麻豆| 日本欧美大码aⅴ在线播放| 91婷婷韩国欧美一区二区| 国产日产精品1区| 久久99国产精品久久| 91精品国产综合久久福利软件| 亚洲欧美日韩小说| 92国产精品观看| 久久久久9999亚洲精品| 久久成人免费网| 日韩视频在线你懂得| 蜜桃av一区二区在线观看| 欧美色图12p| 亚洲免费av高清| av中文字幕亚洲| 国产精品免费视频一区| 国产成人精品亚洲日本在线桃色| 欧美成人精品1314www| 午夜伦理一区二区| 欧美日韩在线观看一区二区 | 国产高清视频一区| 日韩精品一区二区三区视频播放| 青青草国产成人av片免费| 777欧美精品| 午夜电影一区二区三区| 欧美一区二区视频免费观看| 天天综合天天做天天综合| 欧美一区二区三区喷汁尤物| 男女男精品视频| 亚洲精品一区二区三区四区高清| 国内精品第一页| 国产女人18水真多18精品一级做| 不卡的av中国片| 亚洲一区二区三区四区的| 7777精品伊人久久久大香线蕉完整版| 日韩av在线发布| 久久久综合九色合综国产精品| 国产99久久久国产精品潘金| 亚洲欧美日韩国产中文在线| 在线观看一区二区视频| 丝袜诱惑亚洲看片| 久久久精品免费免费| 成人av手机在线观看| 亚洲夂夂婷婷色拍ww47| 日韩一级二级三级精品视频| 国产精品18久久久久久久久久久久| 欧美国产亚洲另类动漫| 在线观看不卡一区| 精品一区二区免费视频| 亚洲天堂av老司机| 欧美精品九九99久久| 韩国女主播成人在线观看| 亚洲欧洲国产日韩| 在线观看91av| 国产成人精品三级麻豆| 一卡二卡欧美日韩| 久久久亚洲高清| 欧美丝袜第三区| 国产伦精一区二区三区| 亚洲一区二区三区影院| 国产日产欧产精品推荐色 | 高清av一区二区| 亚洲精品国产高清久久伦理二区| 51久久夜色精品国产麻豆| 国产999精品久久久久久绿帽| 亚洲免费av高清| 久久免费视频色| 777午夜精品免费视频| 99久久久久久99| 精品一区二区三区免费| 亚洲成人在线免费| 国产精品三级视频| 精品美女一区二区| 欧美丰满一区二区免费视频| 波多野结衣在线aⅴ中文字幕不卡| 日韩福利视频网| 一区二区三区四区国产精品| 国产欧美日韩在线看| 欧美一区二区三区系列电影| 在线观看日韩高清av| 成人av资源站| 国产一区亚洲一区| 麻豆精品在线观看| 日韩精品亚洲专区| 一区二区三区精品久久久| 国产精品久久三区| 久久久不卡网国产精品二区| 欧美一区二区三区爱爱| 欧美在线三级电影| 9色porny自拍视频一区二区| 国产高清久久久久| 国产剧情一区二区| 久久精品国产99国产精品| 午夜伦理一区二区| 午夜精品福利在线| 午夜国产精品一区| 午夜久久电影网| 一卡二卡三卡日韩欧美| 亚洲精品乱码久久久久久| 亚洲丝袜美腿综合| 亚洲人成电影网站色mp4| 国产精品无圣光一区二区| 欧美激情综合五月色丁香| 欧美高清在线视频| 中文字幕av一区二区三区免费看| 国产日韩精品一区二区浪潮av| 久久无码av三级| 久久网站热最新地址| 久久久久九九视频| 亚洲国产精品av| 国产精品久久久久精k8| 亚洲欧洲99久久| 亚洲精品老司机| 五月激情六月综合| 麻豆成人免费电影| 国产成人精品影视| 91亚洲精华国产精华精华液| 日本道免费精品一区二区三区| 欧美亚洲一区二区在线| 欧美一区二区在线不卡| 久久综合色天天久久综合图片| 国产日韩视频一区二区三区| 中文字幕在线观看一区| 亚洲一区二区视频在线| 久久国产综合精品| 成人av午夜电影| 欧美视频在线观看一区| 日韩午夜精品电影| 国产精品久久久久7777按摩| 夜夜亚洲天天久久| 麻豆国产一区二区| 99视频热这里只有精品免费| 欧美三级视频在线播放| 精品日韩一区二区| 国产精品盗摄一区二区三区| 亚洲成人一区二区在线观看| 国产一区不卡在线| 欧美性受极品xxxx喷水| 欧美v国产在线一区二区三区| 国产精品第一页第二页第三页| 午夜精品福利久久久| 春色校园综合激情亚洲| 678五月天丁香亚洲综合网| 久久久久国产精品厨房| 亚洲成人综合视频| 波波电影院一区二区三区| 欧美欧美欧美欧美| 亚洲欧洲另类国产综合| 久久99精品视频| 色天使色偷偷av一区二区 | 91精品国产综合久久福利软件| 久久亚洲综合av| 香蕉成人啪国产精品视频综合网 | 久久综合九色综合欧美98| 亚洲三级视频在线观看| 久久99精品国产麻豆不卡| 在线观看一区不卡| 国产精品国产自产拍高清av | 国产iv一区二区三区| 欧美日韩国产一级片| 国产精品久久一级| 国产在线观看一区二区| 欧美猛男超大videosgay| 最近日韩中文字幕| 国产高清久久久| 精品88久久久久88久久久| 亚洲线精品一区二区三区八戒| 成人精品视频一区| 26uuu国产在线精品一区二区| 亚洲va欧美va人人爽| 色综合久久久久久久久| 国产精品国产馆在线真实露脸| 激情欧美日韩一区二区| 日韩欧美国产综合在线一区二区三区| 亚洲午夜在线观看视频在线| 91亚洲大成网污www| 中文字幕五月欧美| 大桥未久av一区二区三区中文| 精品噜噜噜噜久久久久久久久试看| 首页欧美精品中文字幕| 欧美视频完全免费看| 一区二区三区中文在线| 一本大道久久a久久精品综合| 中文字幕一区二区在线播放| 高清国产一区二区三区| 国产欧美日韩三区| 丰满少妇在线播放bd日韩电影| 国产午夜精品一区二区三区嫩草|