<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>起点博客 &#187; ethereal</title>
	<atom:link href="http://xinzero.com/tag/ethereal/feed" rel="self" type="application/rss+xml" />
	<link>http://xinzero.com</link>
	<description>起于学习，点与应用，一切只为更高效</description>
	<lastBuildDate>Mon, 06 Feb 2012 14:29:24 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>解决ethereal运行无法加载wpcap.dll问题</title>
		<link>http://xinzero.com/resolve-unable-to-load-winpcap.html</link>
		<comments>http://xinzero.com/resolve-unable-to-load-winpcap.html#comments</comments>
		<pubDate>Sat, 24 May 2008 01:21:23 +0000</pubDate>
		<dc:creator>will</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[ethereal]]></category>
		<category><![CDATA[winpcap]]></category>

		<guid isPermaLink="false">http://xinzero.com/resolve-unable-to-load-winpcap/</guid>
		<description><![CDATA[


在windows下编译ethereal成功之后，由于时间比较晚，还没抓过包，今天来抓一下包时才发现ethereal还缺少wpcap.dll加载，不能正常运行。

可以按照错误提示到http://www.winpcap.org/install/default.htm下载最新版4.0.2，也可以在源码文件包ethereal-0.99.0\packaging\nsis目录下找到WinPcap_3_1.exe，就是WinPcap的3.1版。由于Ethereal0.99.0也是在2006年4月发布的，考虑到兼容性，我选择了安装低版本的WinPcap。安装完之后就可以顺利抓包了。
相关文章在windows下建立Ethereal开发环境]]></description>
			<content:encoded><![CDATA[<p><a href="http://xinzero.com/setup-ethereal-build-environment-on-windows.html">在windows下编译ethereal</a>成功之后，由于时间比较晚，还没抓过包，今天来抓一下包时才发现ethereal还缺少wpcap.dll加载，不能正常运行。<br />
<a href="http://xinzero.com/wp-content/uploads/2008/05/ethereal-winpcap-error.png"><img border="0" width="552" src="http://xinzero.com/wp-content/uploads/2008/05/ethereal-winpcap-error-thumb.png" alt="Ethereal_WinPcap_Error" height="336" style="border: #000000 0px" /></a><br />
可以按照错误提示到<a href="http://www.winpcap.org/install/default.htm" title="http://www.winpcap.org/install/default.htm">http://www.winpcap.org/install/default.htm</a>下载最新版4.0.2，也可以在源码文件包ethereal-0.99.0\packaging\nsis目录下找到WinPcap_3_1.exe，就是WinPcap的3.1版。由于Ethereal0.99.0也是在2006年4月发布的，考虑到兼容性，我选择了安装低版本的WinPcap。安装完之后就可以顺利抓包了。</p>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li><a href="http://xinzero.com/setup-ethereal-build-environment-on-windows.html" title="在windows下建立Ethereal开发环境">在windows下建立Ethereal开发环境</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xinzero.com/resolve-unable-to-load-winpcap.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>在windows下建立Ethereal开发环境</title>
		<link>http://xinzero.com/setup-ethereal-build-environment-on-windows.html</link>
		<comments>http://xinzero.com/setup-ethereal-build-environment-on-windows.html#comments</comments>
		<pubDate>Tue, 20 May 2008 16:10:38 +0000</pubDate>
		<dc:creator>will</dc:creator>
				<category><![CDATA[学习笔记]]></category>
		<category><![CDATA[cygwin]]></category>
		<category><![CDATA[ethereal]]></category>
		<category><![CDATA[glib]]></category>
		<category><![CDATA[gtk]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[开发环境]]></category>

		<guid isPermaLink="false">http://xinzero.com/setup-ethereal-build-environment-on-windows/</guid>
		<description><![CDATA[Ethereal是一个开源项目，Ethereal的功能是对网络传输的数据进行抓包，可以运行在UNIX、Linux、Windows操作系统上。由于它的开源和多平台支持，使其成为学习网络知识的最好工具。
如果只是使用Ethereal来抓包，可以下载Ethereal的Binary发行版，需要再次开发可以下载Source code发行版，本文中所使用的源码包为ethereal-0.99.0.tar.gz。下面为在windows下建立Ethereal编译开发环境的过程。此过程根据Ethereal Developer&#8217;s Guide 18189 for Ethereal 0.10.14文档操作得来，采用Ethereal推荐的Cygwin+MSVC6方式。
1、安装Cygwin
到http://www.cygwin.com/下载cygwin安装更新包（一个setup.exe），选择download without installing模式，接下来的设置指定cygwin的安装目录和cygwin更新或安装文件的下载保存目录，指定下载服务器，下载完成后出现下面画面，在默认选择安装的基础上添加下列安装包选择


Archive/unzip
Devel/bison
Devel/flex
Interpreters/perl


Interpreters/python
Utils/patch
Web/wget
 


 
下载完成之后需要安装这些软件包，再次运行setup.exe，选择Install form Local Directory，此时只需要将All 后面设置为Install，即可安装。
安装中遇到的问题，选择Install form internet模式，在上图中点下一步会出现下载失败；在本地没有安装包的时候，选择Install form Local Directory模式，会出错。cygwin安装成功后查看bash版本如下

二、安装MSVC6.0
其实我机器早就安装了MSVC6.0，MSVC6.0提供编译器和链接器。安装过程可以勾选注册环境变量，由于我安装比较早，当时没有选择注册环境变量，按照开发文档中所说的安装VC98\Bin中的vcvars32.bat，但是似乎并没有起作用，还是手动设置。“我的电脑-&#62;属性-&#62;高级-&#62;环境变量”编辑Path变量值，将vcvars32.bat的变量值加入path的变量值中，用分号(;)隔开。我的VC安装在D盘添加的环境变量如下：
D:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;
D:\Program Files\Microsoft Visual Studio\VC98\Bin;
D:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;
D:\Program Files\Microsoft Visual Studio\Common\Tools;
默认情况下环境变量中没有Include变量，需要新建Include变量然后添加如下变量值
D:\Program Files\Microsoft Visual Studio\VC98\ATL\Include;
D:\Program Files\Microsoft Visual Studio\VC98\Include;
D:\Program Files\Microsoft Visual Studio\VC98\MFC\Include;
默认情况下环境变量中没有Lib变量，需要新建Lib变量添加如下变量值
D:\Program Files\Microsoft Visual Studio\VC98\Lib;
D:\Program Files\Microsoft Visual Studio\VC98\MFC\Lib;
添加cygwin的bin目录到环境变量path中，为了nmake时运行bash。
三、检测已安装工具的有效性
在windows的cmd下，先进入Ethereal源码所在文件夹，然后运行
nmake -f Makefile.nmake verify_tools
验证通过如图 如果验证失败，提示有什么软件没有安装，通过cygwin的setup.exe重新安装相应软件。
四、安装库文件
简单的方法是通过nmake -f Makefile.nmake setup，通过wget自动下载所需的库文件，保存目录在config.nmake中的ETHEREAL_LIBS指定，可以自行修改。我将其修改为ETHEREAL_LIBS=D:\ethereal-win32-libs。由于我使用校园网的关系，下载必然是要失败的，所以只能手动安装这些库文件了。
安装目录以D:\ethereal-win32-libs为当前目录,虽然说明文档中表明有些库是可选的，但我不安装可选库，编译不通过。
下表是根据主makefile.nmake中setup来建立。


库名称
版本号
包格式
安装目录
备注


GLib
2.6.6
Binary&#38;Dev
glib
下载


GTK+
1.3.0
Binary&#38;Dev
gtk+
下载


libiconv
1.9.1
Binary&#38;Dev
libiconv-1.9.1.bin.woe32
下载


gettext
0.13
Binary
gettext-runtime-0.13.1
下载


Net snmp
5.2.5pre2
Source
net-snmp-5.2.5
下载 说明


wpdpack
3.1
Developer&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p><a target="_blank" href="http://www.ethereal.com" title="Ethereal">Ethereal</a>是一个开源项目，Ethereal的功能是对网络传输的数据进行抓包，可以运行在UNIX、Linux、Windows操作系统上。由于它的开源和多平台支持，使其成为学习网络知识的最好工具。</p>
<p>如果只是使用Ethereal来抓包，可以<a target="_blank" href="http://ethereal.com/download.html#releases">下载Ethereal的Binary发行版</a>，需要再次开发可以<a target="_blank" href="http://ethereal.com/download.html#releases">下载Source code发行版</a>，本文中所使用的源码包为ethereal-0.99.0.tar.gz。下面为<a href="http://xinzero.com/setup-Ethereal-build-environment-on-windows.html">在windows下建立Ethereal编译开发环境的过程</a>。此过程根据<a target="_blank" href="http://ethereal.com/development.html#docs">Ethereal Developer&#8217;s Guide 18189 for Ethereal 0.10.14文档</a>操作得来，采用Ethereal推荐的Cygwin+MSVC6方式。</p>
<p>1、安装<a target="_blank" href="http://www.cygwin.com/" title="Cygwin Information and Installation">Cygwin</a><br />
到<a href="http://www.cygwin.com/" title="http://www.cygwin.com/">http://www.cygwin.com/</a>下载cygwin安装更新包（一个setup.exe），<a href="#Setup_Note1">选择download without installing模式</a>，接下来的设置指定cygwin的安装目录和cygwin更新或安装文件的下载保存目录，指定下载服务器，下载完成后出现下面画面，在默认选择安装的基础上添加下列安装包选择</p>
<table border="0" width="480" cellPadding="2" cellSpacing="0">
<tr>
<td width="149" vAlign="top">Archive/unzip</td>
<td width="99" vAlign="top">Devel/bison</td>
<td width="100" vAlign="top">Devel/flex</td>
<td width="130" vAlign="top">Interpreters/perl</td>
</tr>
<tr>
<td width="149" vAlign="top">Interpreters/python</td>
<td width="99" vAlign="top">Utils/patch</td>
<td width="100" vAlign="top">Web/wget</td>
<td width="130" vAlign="top"> </td>
</tr>
</table>
<p><a href="http://xinzero.com/wp-content/uploads/2008/05/cygwin-setup-select-packages.png"><img border="0" width="509" src="http://xinzero.com/wp-content/uploads/2008/05/cygwin-setup-select-packages-thumb.png" alt="cygwin_setup_select_packages" height="386" style="border-width: 0px" /></a> <br />
下载完成之后需要安装这些软件包，再次运行setup.exe，选择<strong>Install form Local Directory</strong>，此时只需要将All 后面设置为Install，即可安装。<br />
<a name="Setup_Note1" title="Setup_Note1"></a>安装中遇到的问题，选择<strong>Install form internet</strong>模式，在上图中点下一步会出现下载失败；在本地没有安装包的时候，选择<strong>Install form Local Directory</strong>模式，会出错。cygwin安装成功后查看bash版本如下<br />
<a href="http://xinzero.com/wp-content/uploads/2008/05/cygwin-setup-succeed.png"><img border="0" width="452" src="http://xinzero.com/wp-content/uploads/2008/05/cygwin-setup-succeed-thumb.png" alt="cygwin_setup_succeed" height="167" style="border-width: 0px" /></a></p>
<p>二、安装MSVC6.0<br />
其实我机器早就安装了MSVC6.0，MSVC6.0提供编译器和链接器。安装过程可以勾选注册<strong>环境变量</strong>，由于我安装比较早，当时没有选择注册环境变量，按照开发文档中所说的安装VC98\Bin中的vcvars32.bat，但是似乎并没有起作用，还是手动设置。“我的电脑-&gt;属性-&gt;高级-&gt;环境变量”编辑Path变量值，将vcvars32.bat的变量值加入path的变量值中，用分号(;)隔开。我的VC安装在D盘添加的环境变量如下：<br />
D:\Program Files\Microsoft Visual Studio\Common\MSDev98\Bin;<br />
D:\Program Files\Microsoft Visual Studio\VC98\Bin;<br />
D:\Program Files\Microsoft Visual Studio\Common\Tools\WinNT;<br />
D:\Program Files\Microsoft Visual Studio\Common\Tools;<br />
默认情况下环境变量中没有Include变量，需要<strong>新建Include变量</strong>然后添加如下变量值<br />
D:\Program Files\Microsoft Visual Studio\VC98\ATL\Include;<br />
D:\Program Files\Microsoft Visual Studio\VC98\Include;<br />
D:\Program Files\Microsoft Visual Studio\VC98\MFC\Include;<br />
默认情况下环境变量中没有Lib变量，需要<strong>新建Lib变量</strong>添加如下变量值<br />
D:\Program Files\Microsoft Visual Studio\VC98\Lib;<br />
D:\Program Files\Microsoft Visual Studio\VC98\MFC\Lib;<br />
添加cygwin的bin目录到环境变量path中，为了nmake时运行bash。</p>
<p>三、检测已安装工具的有效性<br />
在windows的cmd下，先进入Ethereal源码所在文件夹，然后运行<br />
nmake -f Makefile.nmake verify_tools<br />
验证通过如图<a href="http://xinzero.com/wp-content/uploads/2008/05/verify-installed-tools-success.png"><img border="0" width="651" src="http://xinzero.com/wp-content/uploads/2008/05/verify-installed-tools-success-thumb.png" alt="verify_installed_tools_success" height="403" style="border-width: 0px" /></a> 如果验证失败，提示有什么软件没有安装，通过cygwin的setup.exe重新安装相应软件。</p>
<p>四、安装库文件<br />
简单的方法是通过nmake -f Makefile.nmake setup，通过wget自动下载所需的库文件，保存目录在config.nmake中的ETHEREAL_LIBS指定，可以自行修改。我将其修改为<strong>ETHEREAL_LIBS=D:\ethereal-win32-libs</strong>。由于我使用校园网的关系，下载必然是要失败的，所以只能手动安装这些库文件了。<br />
安装目录以<strong>D:\ethereal-win32-libs</strong>为当前目录,虽然说明文档中表明有些库是可选的，但我不安装可选库，编译不通过。<br />
下表是根据主makefile.nmake中setup来建立。</p>
<table border="0" width="504" cellPadding="2" cellSpacing="0">
<tr>
<td width="67" vAlign="top">库名称</td>
<td width="69" vAlign="top">版本号</td>
<td width="135" vAlign="top">包格式</td>
<td width="166" vAlign="top">安装目录</td>
<td width="65" vAlign="top">备注</td>
</tr>
<tr>
<td width="68" vAlign="top">GLib</td>
<td width="69" vAlign="top">2.6.6</td>
<td width="135" vAlign="top">Binary&amp;Dev</td>
<td width="166" vAlign="top">glib</td>
<td width="65" vAlign="top"><a target="_blank" href="http://www-ftp.lip6.fr/pub/X11/gtk/v2.6/win32/">下载</a></td>
</tr>
<tr>
<td width="67" vAlign="top">GTK+</td>
<td width="69" vAlign="top">1.3.0</td>
<td width="135" vAlign="top">Binary&amp;Dev</td>
<td width="165" vAlign="top">gtk+</td>
<td width="65" vAlign="top"><a target="_blank" href="http://www.gimp.org/~tml/gimp/win32/downloads.html" title="Tor Lillqvist--GIMP-related downloads">下载</a></td>
</tr>
<tr>
<td width="68" vAlign="top">libiconv</td>
<td width="69" vAlign="top">1.9.1</td>
<td width="135" vAlign="top">Binary&amp;Dev</td>
<td width="165" vAlign="top">libiconv-1.9.1.bin.woe32</td>
<td width="65" vAlign="top"><a target="_blank" href="http://www.gtk.org/download-windows.html">下载</a></td>
</tr>
<tr>
<td width="68" vAlign="top">gettext</td>
<td width="69" vAlign="top">0.13</td>
<td width="135" vAlign="top">Binary</td>
<td width="165" vAlign="top">gettext-runtime-0.13.1</td>
<td width="65" vAlign="top"><a target="_blank" href="http://sourceforge.net/project/showfiles.php?group_id=16768">下载</a></td>
</tr>
<tr>
<td width="68" vAlign="top">Net snmp</td>
<td width="69" vAlign="top">5.2.5pre2</td>
<td width="135" vAlign="top">Source</td>
<td width="165" vAlign="top">net-snmp-5.2.5</td>
<td width="65" vAlign="top"><a target="_blank" href="http://sourceforge.net/project/showfiles.php?group_id=12694&amp;package_id=11571" title="SourceForge.net: Files">下载</a> <a href="#snmp_note">说明</a></td>
</tr>
<tr>
<td width="68" vAlign="top">wpdpack</td>
<td width="69" vAlign="top">3.1</td>
<td width="135" vAlign="top">Developer&#8217;s Packs</td>
<td width="165" vAlign="top">WpdPack</td>
<td width="65" vAlign="top"><a target="_blank" href="http://winpcap.mirror.ethereal.com/install/bin/" title="WinPcap Development">下载</a></td>
</tr>
<tr>
<td width="68" vAlign="top">adns</td>
<td width="69" vAlign="top">1.0-05</td>
<td width="135" vAlign="top">Binary&amp;Source</td>
<td width="165" vAlign="top">adns-1.0-win32-05</td>
<td width="65" vAlign="top"><a target="_blank" href="http://download.jgaa.com/ftp/pub/gnu/adns/">下载</a></td>
</tr>
<tr>
<td width="68" vAlign="top">pcre</td>
<td width="69" vAlign="top">6.4</td>
<td width="135" vAlign="top">Binary&amp;Developer</td>
<td width="165" vAlign="top">pcre-6.4</td>
<td width="65" vAlign="top"><a target="_blank" href="http://sourceforge.net/project/showfiles.php?group_id=23617&amp;package_id=26189" title="SourceForge.net: Files">下载</a></td>
</tr>
<tr>
<td width="68" vAlign="top">zlib</td>
<td width="69" vAlign="top">1.2.3</td>
<td width="135" vAlign="top">Binary&amp;Dev</td>
<td width="165" vAlign="top">zlib123-dll</td>
<td width="65" vAlign="top"><a target="_blank" href="http://www.gtk.org/download-windows.html">下载</a></td>
</tr>
<tr>
<td width="68" vAlign="top">lua</td>
<td width="69" vAlign="top">5.1.3</td>
<td width="135" vAlign="top">win32bin&amp;win32lib</td>
<td width="165" vAlign="top">lua5.1</td>
<td width="65" vAlign="top"><a target="_blank" href="http://luabinaries.luaforge.net/download.html">下载</a> <a href="#lua_note">说明</a></td>
</tr>
</table>
<p><a name="snmp_note" title="snmp_note"></a>Net SNMP库使用说明：找到net-snmp-5.2.5.pre2\win32\libsnmp\文件夹中的libsnmp.dsp工程文件，用VC6.0编译生成release版本。默认情况下生成的netsnmp.lib文件在net-snmp-5.2.5.pre2\win32\lib\release\文件夹下。<br />
将net-snmp-5.2.5.pre2文件夹下的include和win32文件夹拷到D:\ethereal-win32-libs\net-snmp-5.2.5文件夹下。<br />
修改config.nmake中的NET_SNMP_DIR宏，修改如下<br />
NET_SNMP_DIR=$(ETHEREAL_LIBS)\net-snmp-5.2.5</p>
<p><a name="lua_note" title="lua_note"></a>lua库的使用说明：lua5_1_3_Win32_vc6_lib.zip解压后的lua5.1.lib拷到D:\ethereal-win32-libs\lua5.1\lib目录下，将include文件夹拷到D:\ethereal-win32-libs\lua5.1\目录下；将lua5_1_3_Win32_bin.zip解压到D:\ethereal-win32-libs\lua5.1\bin目录下。修改config.nmake中的LUA_LIBS宏，修改如下：<br />
LUA_LIBS=$(LUA_DIR)\lib\lua5.1.lib</p>
<p>五、编译ethereal<br />
以上搞定之后就可以编译了，cmd下输入nmake -f makefile.nmake all<br />
遇到了找不到unistd.h头文件的错误，解决办法自己新建一个unistd.h头文件，内容如下：</p>
<blockquote><p>/** This file is part of the Mingw32 package.<br />
* unistd.h maps     (roughly) to io.h<br />
*/</p>
<p>#ifndef _UNISTD_H<br />
#define _UNISTD_H</p>
<p>#include &lt;io.h&gt;<br />
#include &lt;process.h&gt;</p>
<p>#endif /* _UNISTD_H */</p></blockquote>
<p>将其放到include的环境变量值所指的目录下，如D:\Program Files\Microsoft Visual Studio\VC98\Include;<br />
编译成功之后会在源码文件夹中生成ethereal.exe文件，现在运行ethereal.exe会提示缺少wiretap-0.3.dll、intl.dll等动态链接库。解决办法是在cmd下运行nmake -f makefile.nmake install-deps。将所需的dll拷到源码文件的根目录下。<br />
<a href="http://xinzero.com/wp-content/uploads/2008/05/ethereal-ui.png"><img border="0" width="501" src="http://xinzero.com/wp-content/uploads/2008/05/ethereal-ui-thumb.png" alt="ethereal_ui" height="308" style="border-width: 0px" /></a></p>
<p>界面还是比较粗糙的，下次把gtk2加入，看下能有改善否。<br />
差点忘了，在nmake -f makefile.nmake distclean的时候有个cd asn1的错误，这应该是ethereal的一个bug，路径错误。解决办法，修改makefile.nmake中的cd asn1修改为cd plugins/asn1，下面隔一行添加cd .. 。</p>
<p>此文基本是按照我安装过程记录下来，若有问题请联系我。</p>
<h3  class="related_post_title">相关文章</h3><ul class="related_post"><li><a href="http://xinzero.com/change-rs232-com-port.html" title="Windows下如何更改串口号">Windows下如何更改串口号</a></li><li><a href="http://xinzero.com/toshiba-l525-disable-touchpad.html" title="东芝L525笔记本XP系统下禁用触摸板">东芝L525笔记本XP系统下禁用触摸板</a></li><li><a href="http://xinzero.com/windows-xp-start-time-fix.html" title="解决XP进入桌面后，加载网络与用户名超慢">解决XP进入桌面后，加载网络与用户名超慢</a></li><li><a href="http://xinzero.com/windows-ultraedit-startup.html" title="UltraEdit Windows下常用的编辑器-UEStudio下载">UltraEdit Windows下常用的编辑器-UEStudio下载</a></li><li><a href="http://xinzero.com/modify-windows-environment-variables.html" title="windows下修改环境变量的方法">windows下修改环境变量的方法</a></li></ul>]]></content:encoded>
			<wfw:commentRss>http://xinzero.com/setup-ethereal-build-environment-on-windows.html/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

