1. go to the home page,
http://archive.openflow.org/wk/index.php/OpenFlow_Wireshark_Dissector
点击-----——>Downloads进入页面后,找到命令:在ubuntu 主机上输入此命令
git clone git://gitosis.stanford.edu/openflow.git (用于生成packet_openflow.so文件)
#ls /*找到openflow文件
#cd openflow /* 在‘ls’一下,找到 ‘utilities’文件
#cd utilities /* 在‘ls’一下,看到‘wireshark_dissectors/’
#cd wireshark_dissectors /* make clean一下
#apt-get install wireshark /* 这一步通常会下载 wireshark1.6.7版本
#ls /*会发现wireshark_dissectors文件下有 ‘openflow’文件, cd 进入
#ls
#vi /utilities/wireshark_dissectors/openflow/packet-openflow.c /*打开编译
@@ -766,7 +766,7 @@ static gint ett_ofp_error_msg_data = -1;
void proto_reg_handoff_openflow()
{
openflow_handle = create_dissector_handle(dissect_openflow, proto_openflow);
- dissector_add(TCP_PORT_FILTER, global_openflow_proto, openflow_handle); /* '-'屏蔽此行
+ dissector_add_uint(TCP_PORT_FILTER, global_openflow_proto, /* ‘+’换成这样,
+ openflow_handle); /* ‘+’换成这样
}
#define NO_STRINGS NULL
就可以了
#make
#make install /*这一步完成后,会生成packet-openflow.so文件, 有时候make会出现error fatal error glib.h no such file or directory
(解决方案:
glib.h is part of "libglib2.0-dev" package. So make sure to install this package.
If that does not solve the problem, it may be because the application you are building expects glib development files in a different directory. In that case, you will need to manually specify information about glib-2.0 library in your Makefile. To find out what information to add to Makefile, you can use pkg-config command, which automatically finds metadata about installed libraries.
Run the following command, and put the output of the command in your Makefile.
-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include -lglib-2.0
In this example, the command returns the above string. So in this case, I will specify "-I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include" and "-lglib-2.0" somewhere in my Makefile.
)再进行#make
#make install /*之后,系统提示packet-openflow.so 文件生成。
此时,文件位置应为:/home/mininet/openflow/utilities/wireshark_dissectors/openflow.
在上述当前目录下,
#cp packet-openflow.so /usr/lib/wireshark/libwireshark1/plugins
2.启动wireshark,
- Run wireshark
- Open the "Help" --> "About" menu
- Select the "Plugins" tab
- Click the "Name" header to the plugins by name
- Verify that "packet-openflow.so" appears in the list.
- Verify that its version is listed as the latest version which you downloaded here
- Verify that Wireshark can now dissect the example OpenFlow packet capture provided on the downloads page