<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>基于 linux 平台的 libpcap 源代码分析 - 技术文档 - 系统管理 Linux时代 - 开源、自由、共享 - 中国最大的Linux技术社区</title>
<meta name="keywords" content="基于 linux 平台的 libpcap 源代码分析 - 技术文档 - 系统管理 Linux时代 - 开源、自由、共享 - 中国最大的Linux技术社区">
<meta name="description" content="基于 linux 平台的 libpcap 源代码分析 - 技术文档 - 系统管理 系统管理 Linux 技术文档">
<link href="/css/all.css" rel="stylesheet" type="text/css" />
<style type="text/css">
<!--
.STYLE1 {color: #FF0000}
.STYLE2 {font-size: 14px}
-->
</style>
</head>
<body>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="27"> <table border="0" cellspacing="0" cellpadding="0" style="border-collapse: collapse" width="100%">
<tr><FORM name="login" action="http://linux.chinaunix.net/bbs/logging.php?action=login" method=post>
<td><script language="javascript" src="http://linux.chinaunix.net/bbs/loginbox.php"></script></td>
</form>
<td align="right">
·<a href="http://www.chinaunix.net" class="list1">ChinaUnix首页</a>
·<a href="http://bbs.chinaunix.net" class="list1">论坛</a>
·<a href="http://blog.chinaunix.net" class="list1">博客</a>
</td>
</tr>
</table></td>
</tr>
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td><table width="100%" border="0" cellpadding="0" cellspacing="0">
<tr>
<td height="84"><img src="/images/logo.jpg" /></td>
<td align="right" ><IFRAME SRC="http://count.chinaunix.net/iframe.php?id=54" width="750" height="80" frameborder="0" scrolling="no"></IFRAME>
</td>
</tr>
</table></td>
</tr>
<tr>
<td><table width="100%" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="3"><img src="/images/bgtop1.jpg" width="3" height="26" /></td>
<td width="944" background="/images/bgtop2.gif" class="whitetop">
<a href="http://linux.chinaunix.net/" target="_blank">Linux首页</a> |
<a href="http://linux.chinaunix.net/news/">Linux新闻</a> |
<a target="_blank" href="http://linux.chinaunix.net/bbs" style=color:red><b>Linux论坛</b></a> |
<a href="http://linux.chinaunix.net/techdoc/">Linux文档</a> |
<a target="_blank" href="http://download.chinaunix.net/disc/linux/">Linux下载</a> |
<a target="_blank" href="http://blog.chinaunix.net/techart.php?frmid=6">Linux博客</a> |
<a target="_blank" href="http://search.chinaunix.net/">Linux搜索</a> |
<a target="_blank" href="http://linux.chinaunix.net/bbs/index.php?gid=68">开源项目孵化平台</a>
|
<a target="_blank" href="http://linux.chinaunix.net/ebook/" style=color:red>《开源时代》</a></td>
<td width="3" align="right"><img src="/images/bgtop3.jpg" width="3" height="26" /></td>
</tr>
</table></td>
</tr>
</table>
<table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="bottom" class="BlkLightblue">
<a target="_blank" href="http://linux.chinaunix.net/techdoc/beginner/">
新手入门</a> | <span lang="zh-cn">
<a target="_blank" href="http://linux.chinaunix.net/techdoc/install/">
安装启动</a> | </span>
<a target="_blank" href="http://linux.chinaunix.net/techdoc/system/">
管理员指南</a> | <a target="_blank" href="http://man.chinaunix.net/">开发手册</a>
| <a target="_blank" href="http://linux.chinaunix.net/techdoc/desktop/">
桌面应用</a> |
<a target="_blank" href="http://linux.chinaunix.net/techdoc/develop/">
程序开发</a> |
<a target="_blank" href="http://linux.chinaunix.net/techdoc/database/">
数据库</a> | <span lang="zh-cn">
<a target="_blank" href="http://linux.chinaunix.net/techdoc/net/">网络技术</a>|
<a target="_blank" href="http://linux.chinaunix.net/topics/2007-01-25/15/index.shtml">
CentOS</a></span> |
<a target="_blank" href="http://linux.chinaunix.net/search2.php?key=fedora&id=0">
Fedora</a> <span lang="zh-cn">| </span>
<a target="_blank" href="http://linux.chinaunix.net/search2.php?key=mysql&id=0">
MySQL</a>
<span lang="zh-cn">| </span>
<a target="_blank" href="http://linux.chinaunix.net/search2.php?key=apache&id=0">
Apache</a>
<span lang="zh-cn">| </span>
<a target="_blank" href="http://linux.chinaunix.net/search2.php?key=ubuntu&id=0">
<font color="#FF0000">Ubuntu</font></a>
<span lang="zh-cn">| </span>
<a target="_blank" href="http://linux.chinaunix.net/topics/2008-07-10/18/index.shtml">
<font color="#FF0000">Gentoo</font></a>| </span>
<b>
<a target="_blank" href="http://linux.chinaunix.net/topics/2008-07-30/19/index.shtml">
<font color="#FF0000">OSCON08</font></a></b>
</td>
</tr>
<tr><td>
</td></tr>
<tr>
<td height="30" valign="bottom"> <a href="http://linux.chinaunix.net">Linux时代</a> >> <a href="http://linux.chinaunix.net/techdoc/" class='list1'>技术文档</a> >> <a href="http://linux.chinaunix.net/techdoc/system/" class='list1'>系统管理</a></td>
</tr>
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
<tr>
<td height="8"></td>
</tr>
</table><table width="950" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td valign="top" class="BLKtext"><table width="660" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="8"> </td>
</tr>
<tr>
<td height="30" class="Ftext1">基于 linux 平台的 libpcap 源代码分析</td>
</tr>
<tr>
<td><table width="80%" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td height="1" bgcolor="#CCCCCC"></td>
</tr>
</table></td>
</tr>
<tr>
<td height="40" align="center">来源:
ChinaUnix博客 日期:
2005.06.09 12:52 (共有<span class="STYLE1" id ="postcount"></span>条评论) <a href="http://linux.chinaunix.net/bbs/thread-922751-1-1.html" target="_blank">我要评论</a></td>
</tr>
<tr>
<td> </td>
</tr>
<tr>
<td class="F14">
关于作者<br />
施聪,成都人,高级程序员、网络设计师。从事基于 UNIX/LINUX 下的 c/c++ 程序设计和数据库建模工作已 10 年。<br />
libpcap 是 unix/linux 平台下的网络数据包捕获函数包,大多数网络监控软件都以它为基础。Libpcap<br />
可以在绝大多数类 unix 平台下工作,本文分析了 libpcap 在 linux 下的源代码实现,其中重点是 linux<br />
的底层包捕获机制和过滤器设置方式,同时也简要的讨论了 libpcap 使用的包过滤机制 BPF。<br />
网络监控<br />
绝<br />
大多数的现代操作系统都提供了对底层网络数据包捕获的机制,在捕获机制之上可以建立网络监控(Network<br />
Monitoring)应用软件。网络监控也常简称为sniffer,其最初的目的在于对网络通信情况进行监控,以对网络的一些异常情况进行调试处理。但<br />
随着互连网的快速普及和网络攻击行为的频繁出现,保护网络的运行安全也成为监控软件的另一个重要目的。例如,网络监控在路由器,防火墙、入侵检查等方面使<br />
用也很广泛。除此而外,它也是一种比较有效的黑客手段,例如,美国政府安全部门的"肉食动物"计划。<br />
包捕获机制<br />
从广义的角度上看,一个包捕获机制包含三个主要部分:最底层是针对特定操作系统的包捕获机制,最高层是针对用户程序的接口,第三部分是包过滤机制。<br />
不<br />
同的操作系统实现的底层包捕获机制可能是不一样的,但从形式上看大同小异。数据包常规的传输路径依次为网卡、设备驱动层、数据链路层、IP<br />
层、传输层、最后到达应用程序。而包捕获机制是在数据链路层增加一个旁路处理,对发送和接收到的数据包做过滤/缓冲等相关处理,最后直接传递到应用程序。<br />
值得注意的是,包捕获机制并不影响操作系统对数据包的网络栈处理。对用户程序而言,包捕获机制提供了一个统一的接口,使用户程序只需要简单的调用若干函数<br />
就能获得所期望的数据包。这样一来,针对特定操作系统的捕
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
pcap.rar (3个子文件)
基于 linux 平台的 libpcap 源代码分析 - 技术文档 - 系统管理 Linux时代 - 开源、自由、共享 - 中国最大的Linux技术社区.htm 55KB
tcpdump-4.1.1.tar.gz 1.51MB
libpcap1.1.1.rar 587KB
共 3 条
- 1
资源评论
builder110
- 粉丝: 1
- 资源: 12
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功