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

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

?? group__wpcap__tut3.html

?? Winpcap是一個強大的網絡開發庫
?? HTML
?? 第 1 頁 / 共 2 頁
字號:
<!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>);

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美男人的天堂一二区| 国产精品一色哟哟哟| 国产午夜精品一区二区三区四区| 欧美日韩视频一区二区| 色呦呦网站一区| 99久久久久久| 色婷婷av久久久久久久| 一本大道久久a久久综合| 99久久久国产精品免费蜜臀| 粉嫩一区二区三区性色av| 岛国一区二区在线观看| 成人一级黄色片| 色综合久久综合网欧美综合网| 色香蕉成人二区免费| 欧美亚洲高清一区| 日韩一级欧美一级| 久久久久久夜精品精品免费| 国产欧美精品一区二区三区四区 | 蜜臀精品久久久久久蜜臀| 久久国产乱子精品免费女| 国产精品一区一区| 色综合久久综合网| 日韩欧美一区中文| 国产精品激情偷乱一区二区∴| 一区二区三区美女| 奇米影视一区二区三区| 成人午夜大片免费观看| 欧美亚洲日本一区| 久久久久久久精| 亚洲一区精品在线| 国产成人午夜99999| 欧美亚洲综合色| 久久伊人蜜桃av一区二区| 一区精品在线播放| 青青国产91久久久久久| 国产高清在线观看免费不卡| 欧洲av在线精品| 久久嫩草精品久久久精品 | 91蜜桃视频在线| 91麻豆精品国产自产在线| 国产日韩高清在线| 日韩精品电影一区亚洲| 成人一区二区三区视频| 欧美一区二区三区影视| 亚洲欧美激情一区二区| 国产在线精品一区二区三区不卡| 99亚偷拍自图区亚洲| 欧美一卡二卡三卡| 亚洲免费观看高清完整| 久久99国产精品麻豆| 欧美三级韩国三级日本三斤| 亚洲国产成人自拍| 精品一区二区免费看| 欧美日韩视频第一区| 亚洲欧美日韩综合aⅴ视频| 国产一区二区在线免费观看| 欧美丰满嫩嫩电影| 亚洲福利一二三区| 色噜噜狠狠成人网p站| 国产亚洲女人久久久久毛片| 欧美a级理论片| 欧美福利视频一区| 亚洲成人综合网站| 一本久久a久久免费精品不卡| 国产片一区二区三区| 久久99国产精品久久99果冻传媒| 欧美日韩一本到| 曰韩精品一区二区| 色婷婷狠狠综合| 亚洲综合精品久久| 色视频一区二区| 一区二区免费看| 色婷婷激情综合| 亚洲午夜一区二区三区| 在线观看日韩一区| 亚洲一区二区高清| 欧美福利一区二区| 天天av天天翘天天综合网| 欧美高清精品3d| 男男gaygay亚洲| 欧美videofree性高清杂交| 美女视频黄免费的久久 | 成人av先锋影音| 国产精品另类一区| 91视频观看视频| 精品亚洲porn| 精品国产一区二区亚洲人成毛片| 蜜桃一区二区三区在线观看| 2021国产精品久久精品| 高清免费成人av| 一区视频在线播放| 欧美日韩在线电影| 久久国产精品99久久久久久老狼| 欧美大白屁股肥臀xxxxxx| 国产剧情一区二区| 日韩久久一区二区| 8x8x8国产精品| 韩国在线一区二区| 亚洲精品自拍动漫在线| 欧美肥妇毛茸茸| 处破女av一区二区| 亚洲国产视频直播| 久久精品网站免费观看| 91在线国产福利| 日本成人在线电影网| 国产人妖乱国产精品人妖| 99re成人精品视频| 免费在线观看成人| 国产精品国产自产拍高清av王其| 欧美日韩一区二区三区不卡| 国产一区二区三区高清播放| 亚洲在线视频一区| 26uuu精品一区二区在线观看| 91片在线免费观看| 精品一区二区三区在线播放| 久久成人羞羞网站| ...av二区三区久久精品| 91精品国产福利| 色综合久久88色综合天天| 久久国产精品99精品国产| 一区二区在线看| 国产日韩精品一区二区三区在线| 欧美色区777第一页| 成人自拍视频在线观看| 日本网站在线观看一区二区三区| 中文字幕亚洲电影| 久久综合九色综合97婷婷| 欧美三级视频在线观看| 不卡影院免费观看| 狠狠网亚洲精品| 婷婷丁香激情综合| 亚洲电影第三页| 国产精品白丝在线| 国产午夜精品在线观看| 91麻豆精品国产91久久久| 色老汉一区二区三区| 99久久国产综合精品色伊| 狠狠狠色丁香婷婷综合激情 | 欧美美女视频在线观看| 色综合久久久久网| a在线播放不卡| 成人免费视频一区| 国产精品亚洲第一| 裸体健美xxxx欧美裸体表演| 午夜视频一区二区| 亚洲伦理在线精品| 亚洲精品国产一区二区精华液 | 国产欧美日韩在线| 久久久久久亚洲综合| 精品国产乱码久久久久久浪潮| 91精品国产综合久久精品性色| 日本道免费精品一区二区三区| av在线不卡免费看| 91免费观看在线| 欧美日韩一区精品| 69堂成人精品免费视频| 制服丝袜中文字幕一区| 欧美一级欧美一级在线播放| 91精品国产色综合久久不卡电影| 3751色影院一区二区三区| 欧美一级日韩免费不卡| 日韩免费高清视频| 久久久五月婷婷| 国产调教视频一区| 亚洲欧洲日韩一区二区三区| 中文字幕欧美激情一区| 国产精品乱人伦| 亚洲国产综合人成综合网站| 天涯成人国产亚洲精品一区av| 日本在线不卡一区| 黑人巨大精品欧美一区| 成人免费毛片app| 在线观看一区日韩| 91麻豆精品国产91久久久资源速度| 日韩一区二区免费高清| 欧美精品一区二区三区一线天视频| 欧美精品一区二区三区蜜桃| 欧美成人video| 国产精品乱码人人做人人爱 | 国产美女在线观看一区| 成人黄色大片在线观看| 在线观看区一区二| 精品国产一区a| 亚洲欧美色图小说| 黄一区二区三区| 在线视频欧美区| www亚洲一区| 亚洲国产日产av| 国产精品12区| 欧美日韩精品免费| 亚洲国产成人在线| 美女视频黄久久| 色婷婷精品久久二区二区蜜臂av| 欧美一区二区三区视频免费 | 蜜臂av日日欢夜夜爽一区| 成人视屏免费看| 欧美一区二区黄色| 亚洲人成精品久久久久久| 麻豆精品蜜桃视频网站| 欧美在线看片a免费观看|