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

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關(guān)于我們
? 蟲蟲下載站

?? group__wpcap__tut3.html

?? Winpcap是一個(gè)強(qiáng)大的網(wǎng)絡(luò)開發(fā)庫(kù)
?? HTML
?? 第 1 頁(yè) / 共 2 頁(yè)
字號(hào):
<!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: Opening an adapter and capturing the packets</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>Opening an adapter and capturing the packets</h1><table border="0" cellpadding="0" cellspacing="0"><tr><td></td></tr></table>Now that we've seen how to obtain an adapter to play with, let's start the real job, opening an adapter and capturing some traffic. In this lesson we'll write a program that prints some information about each packet flowing through the adapter.<p>The function that opens a capture device is <a class="el" href="group__wpcapfunc.html#g2b64c7b6490090d1d37088794f1f1791" title="Open a generic source in order to capture / send (WinPcap only) traffic.">pcap_open()</a>. The parameters, <em>snaplen</em>, <em>flags</em> and <em>to_ms</em> deserve some explanation.<p><em>snaplen</em> specifies the portion of the packet to capture. On some OSes (like xBSD and Win32), the packet driver can be configured to capture only the initial part of any packet: this decreases the amount of data to copy to the application and therefore improves the efficiency of the capture. In this case we use the value 65536 which is higher than the greatest MTU that we could encounter. In this manner we ensure that the application will always receive the whole packet.<p><em>flags:</em> the most important flag is the one that indicates if the adapter will be put in promiscuous mode. In normal operation, an adapter only captures packets from the network that are destined to it; the packets exchanged by other hosts are therefore ignored. Instead, when the adapter is in promiscuous mode it captures all packets whether they are destined to it or not. This means that on shared media (like non-switched Ethernet), WinPcap will be able to capture the packets of other hosts. Promiscuous mode is the default for most capture applications, so we enable it in the following example.<p><em>to_ms</em> specifies the read timeout, in milliseconds. A read on the adapter (for example, with <a class="el" href="group__wpcapfunc.html#g60ce104cdf28420d3361cd36d15be44c" title="Collect a group of packets.">pcap_dispatch()</a> or <a class="el" href="group__wpcapfunc.html#g439439c2eae61161dc1efb1e03a81133" title="Read a packet from an interface or from an offline capture.">pcap_next_ex()</a>) will always return after <em>to_ms</em> milliseconds, even if no packets are available from the network. <em>to_ms</em> also defines the interval between statistical reports if the adapter is in statistical mode (see the lesson "\ref wpcap_tut9" for information about statistical mode). Setting <em>to_ms</em> to 0 means no timeout, a read on the adapter never returns if no packets arrive. A -1 timeout on the other side causes a read on the adapter to always return immediately.<p><div class="fragment"><pre class="fragment"><span class="preprocessor">#include "pcap.h"</span><span class="comment">/* prototype of the packet handler */</span><span class="keywordtype">void</span> packet_handler(u_char *param, <span class="keyword">const</span> <span class="keyword">struct</span> <a class="code" href="structpcap__pkthdr.html" title="Header of a packet in the dump file.">pcap_pkthdr</a> *header, <span class="keyword">const</span> u_char *pkt_data);<span class="keywordtype">int</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> inum;<span class="keywordtype">int</span> i=0;<a class="code" href="group__wpcap__def.html#g4711d025f83503ce692efa5e45ec60a7" title="Descriptor of an open capture instance. This structure is opaque to the user, that...">pcap_t</a> *adhandle;<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 on 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, &amp;alldevs, errbuf) == -1)    {        fprintf(stderr,<span class="stringliteral">"Error in pcap_findalldevs: %s\n"</span>, errbuf);        exit(1);    }        <span class="comment">/* Print the list */</span>    <span class="keywordflow">for</span>(d=alldevs; d; 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> -1;    }        printf(<span class="stringliteral">"Enter the interface number (1-%d):"</span>,i);    scanf_s(<span class="stringliteral">"%d"</span>, &amp;inum);        <span class="keywordflow">if</span>(inum &lt; 1 || inum &gt; i)    {        printf(<span class="stringliteral">"\nInterface number out of range.\n"</span>);

?? 快捷鍵說明

復(fù)制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號(hào) Ctrl + =
減小字號(hào) Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产麻豆日韩欧美久久| 一区二区三区四区av| 国产一区二区三区最好精华液| 日韩精品影音先锋| 韩国毛片一区二区三区| 国产亚洲一区二区三区| jizzjizzjizz欧美| 亚洲国产日韩精品| 日韩欧美一区电影| 成人在线一区二区三区| 17c精品麻豆一区二区免费| 在线欧美一区二区| 日韩av不卡一区二区| 久久久www免费人成精品| 91在线精品一区二区| 亚洲一区二区三区四区在线免费观看| 欧美精选午夜久久久乱码6080| 久久精品国产亚洲高清剧情介绍| 国产精品沙发午睡系列990531| 欧美揉bbbbb揉bbbbb| 韩国一区二区三区| 一区二区三区在线观看视频| 制服丝袜激情欧洲亚洲| 粉嫩久久99精品久久久久久夜| 亚洲狼人国产精品| 26uuu国产电影一区二区| 色综合夜色一区| 青青草国产精品亚洲专区无| 国产精品人成在线观看免费 | 国内精品写真在线观看| 国产精品福利一区| 欧美www视频| 色av成人天堂桃色av| 激情六月婷婷综合| 一区二区三区91| 国产亚洲福利社区一区| 精品视频一区二区不卡| 成人激情小说网站| 另类小说综合欧美亚洲| 亚洲精品视频观看| 国产亚洲午夜高清国产拍精品 | 国产精品电影一区二区三区| 欧美一区二区三区视频免费 | 欧美性淫爽ww久久久久无| 国产专区综合网| 视频一区国产视频| 亚洲美女视频在线| 国产日韩欧美制服另类| 日韩一区二区三区视频在线观看 | 欧美午夜影院一区| www.在线成人| 国产美女一区二区| 日精品一区二区三区| 亚洲色图欧洲色图| 中文字幕在线播放不卡一区| 久久久亚洲精华液精华液精华液| 91精品国产综合久久婷婷香蕉| 91在线国产福利| 成人性生交大片免费看在线播放| 久久精品国产一区二区| 免费观看成人鲁鲁鲁鲁鲁视频| 亚洲综合色噜噜狠狠| 亚洲视频电影在线| 国产精品超碰97尤物18| 国产精品入口麻豆九色| 中文字幕免费观看一区| 国产欧美精品日韩区二区麻豆天美| 欧美videossexotv100| 欧美xxxxx牲另类人与| 日韩免费视频一区| 欧美一级在线免费| 日韩三级在线观看| 精品国产麻豆免费人成网站| 日韩欧美一级片| 精品久久人人做人人爰| 精品久久久久av影院| 日韩欧美国产1| 日韩精品在线一区二区| 久久综合九色综合97婷婷| 2020日本不卡一区二区视频| 2022国产精品视频| 日本一区二区三区免费乱视频| 国产色产综合色产在线视频| 久久久久青草大香线综合精品| 精品国产91久久久久久久妲己| 欧美精品一区二区三区高清aⅴ| 日韩美女一区二区三区| 久久蜜桃av一区精品变态类天堂 | 欧美丰满嫩嫩电影| 欧美一区永久视频免费观看| 日韩视频国产视频| 26uuu国产日韩综合| 欧美国产1区2区| 亚洲综合成人在线| 美国欧美日韩国产在线播放 | 成人妖精视频yjsp地址| 91丝袜高跟美女视频| 欧美日韩亚州综合| 欧美va亚洲va香蕉在线| 中文字幕的久久| 一区二区三区国产豹纹内裤在线| 樱桃国产成人精品视频| 毛片av中文字幕一区二区| 国产精品一区三区| 欧美在线观看18| 日韩精品影音先锋| 亚洲欧美日韩国产成人精品影院| 亚洲成人动漫在线免费观看| 极品少妇xxxx偷拍精品少妇| jizz一区二区| 日韩欧美一区电影| 亚洲免费毛片网站| 美女任你摸久久| 一本色道a无线码一区v| 欧美一级生活片| 中文字幕一区免费在线观看| 亚洲chinese男男1069| 国产一区二区三区四| 欧美亚洲尤物久久| 久久久久久久电影| 亚洲国产综合色| 国产成人午夜视频| 91精品国产91久久综合桃花| 日本一区二区不卡视频| 日韩精品电影一区亚洲| av中文字幕一区| 亚洲精品一区在线观看| 亚洲一区在线视频观看| 成人精品国产福利| 日韩欧美国产1| 亚洲午夜免费电影| 高清成人免费视频| 日韩精品一区二区三区视频在线观看 | 中文字幕在线不卡一区| 看电影不卡的网站| 在线观看欧美黄色| 国产精品免费网站在线观看| 久久精品国产一区二区三区免费看| 91最新地址在线播放| 久久久天堂av| 久久精品久久综合| 欧美日本一道本在线视频| 国产精品电影一区二区| 丁香亚洲综合激情啪啪综合| 日韩午夜激情免费电影| 亚洲h在线观看| 欧美性欧美巨大黑白大战| 国产精品久久久久久亚洲毛片| 久久成人羞羞网站| 欧美一区二区三区日韩视频| 亚洲福利电影网| 91久久香蕉国产日韩欧美9色| 中文在线资源观看网站视频免费不卡| 美女任你摸久久| 日韩精品中文字幕在线不卡尤物| 亚洲成a人片综合在线| 在线观看免费一区| 亚洲码国产岛国毛片在线| 成人白浆超碰人人人人| 中文字幕欧美国产| 成人性生交大片| 国产精品国产自产拍高清av| 国产激情91久久精品导航| 国产日韩欧美电影| 成人午夜电影小说| 国产精品久久久久桃色tv| 成人激情视频网站| 亚洲天堂网中文字| 91国内精品野花午夜精品| 亚洲精品视频一区| 欧美亚洲国产bt| 亚洲第一搞黄网站| 在线综合+亚洲+欧美中文字幕| 五月婷婷激情综合| 日韩午夜小视频| 欧美午夜电影在线播放| 亚洲国产精品精华液网站| 欧美日韩国产精选| 美日韩一区二区三区| 久久久久国产精品麻豆ai换脸 | 亚洲成精国产精品女| 精品视频1区2区| 日本不卡视频在线观看| 欧美白人最猛性xxxxx69交| 国产成人精品三级麻豆| 综合中文字幕亚洲| 欧美精选在线播放| 国产精品一区二区在线播放| 国产精品毛片a∨一区二区三区| 在线视频国内自拍亚洲视频| 人人精品人人爱| 国产精品入口麻豆九色| 欧美亚洲一区三区| 久久国产精品72免费观看| 中文字幕日韩一区| 制服丝袜中文字幕一区| 丁香婷婷深情五月亚洲| 午夜精品久久久久久久| 久久网站最新地址| 在线观看日韩一区|