基于Linux的网络数据帧捕获方法与思考 荐
基于Linux的网络数据帧捕获方法与思考
关键字信息载入中...
广告载入中...
基于Linux的网络数据帧捕获方法与思考
· 魏星 浦仕超·CPCW
Linux的本地化应该以提高大量应用程序的使用和分析为突破口。
目前,国内推出了许多的Linux的发行版本,其重点集中在中文平台上,方便了国内用户对Linux的使用,但是有一个不是太好的迹象就是把汉化作为Linux操作系统的主要功能,实际上汉字处理尽管非常重要,但是把Linux作为桌面系统进行推广,其价值不是非常大,并且在推出的发行版本中,应用程序的源代码包多被删除,而选择了一些不是太有价值的X-Windows程序包,而许多应用程序(如PHP3)必须要源代码的支持才可进行功能的扩展,GNU/Linux的优秀主要是给了我们非常丰富的软件资源,和享受资源的充分自由,应用程序的分析难度远小于内核,并且能够带来比较明显的效果,实际上许多的应用程序都提供了多平台的支持。Linux目前可能作为对抗Windows NT的工具是非常合适的。
附源程序:
/*
* This program demonstrate SOCK_PACK call.
* Thanks Linux. Thanks Alan Cox
* derived from/usr/src/redhat/SOURCES/dosemu-0.66.7/src/dosext/net/net/libpacket.c
* compile method: cc capturer.c -o capturer
*/
/*
* Alan Cox raw code
*/
/*
* SOCK_PACKET support.
* Placed under the GNU LGPL.
*
* First cut at a library of handy support routines. Comments, additions
* and bug fixes greatfully received.
*
* (c) 1994 Alan Cox iiitac@pyr.swan.ac.uk GW4PTS@GB7SWN
*/
#include <stdio.h>
#include <features.h>
#include <unistd.h>
#include <stdlib.h>
#include <ctype.h>
#include <getopt.h>
#include <string.h>
#include <fcntl.h>
#include <asm/types.h>
#include <sys/socket.h>
#include <sys/ioctl.h>
/*#if __GLIBC__ > 1*/
#include <asm/sockios.h>
文章录入:lwyx 责任编辑:lwyx

