`
tcpdump
  • 浏览: 19793 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论
文章列表
CU上的一个帖子,忽然想起之前的一些代码也出现过类似的问题,mark一下。#include <stdio.h>/*?* 冒失地址相减的单位是数据类型的字节数?* 强制转换成整形后,单位是1?*/int main(){?? ?int a;?? ?int b;?? ?printf("%d\n", &a-&b);?? ?printf("%d\n", (int)&a-(……
看到水木上有人发这个帖子,就转过来了,顺便再贴一个libe1000中的代码;-)>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>发信人: teamod (Gnuer), 信区: LinuxDev标? 题: linux下分配G级物理内存的方法发信站: 水木社区 ...
GCC hacks in the Linux kernelDiscover GCC extensions for the C languageM. Tim Jones, Consultant Engineer, Emulex Corp.18 Nov 2008??? The Linux? kernel uses several special capabilities of the GNU Compiler Collection (GCC) suite. These capabilities range from giving you shortcuts and simplifications t ...
主要是2.6.26内核的module.c中check_version()发生了改变,在检查不到符号版本的时候返回0或者是-ENOEXEC,而之前的版本是返回1,导致的这个问题。代码如下:2.6.26:#ifdef CONFIG_MODVERSIONSstatic int check_version(Elf_Shdr *sechdrs,??????????????????????&nbs……
项目中有两个module,其中一个module中需要另外一个module的符号,2.6.26之前的内核只要按照顺序进行加载就没有问题,但是在2.6.26里面就会出现"can not found symbol"的错误。通过之前的一些rootkit的思想,在内核中通过读取/proc/kallsyms文件来获得相应符号的地址。#include <linux types.h="">#include <linux stddef.h="">#include <linux unistd.h=""> ...
实际上,本文是ld脚本的一个简单例子,有机会应该好好学习一下ld脚本,尤其是内核的那个ld脚本。 转载时请注明出处和作者联系方式 文章出处:http://www.limodev.cn/blog 作者联系方式:李先静 <xianjimli at="" hotmail="" dot="" com=""> 一位朋友最近遇到一个棘手的问题,希望把共享库(SO)加载到指定的内存地址,目的可能是想通过prelink来加快应用程序的起动速度。他问我有没有什么 方法。我知道Windows下是可以的,比如在 ...
直接上代码吧,就是sidt之后,通过kmem字符设备搜索指纹。#include <stdio.h>#include <stdlib.h>#include <string.h>#include <sys types.h="">#include <sys stat.h="">#include <fcntl.h>#include <unistd.h>#include <errno.h>#include <sys mman.h="">#d ...
最近瑞典两个人吹的比较火的东,但是他们一直没有说出一些细节性质的东西,大家根据他们的访谈,推测是之前的一个DoS攻击。nmap邮件列表里面的一个讨论:http://insecure.org/stf/tcp-dos-attack-explained.html基本思想:The basic idea is to first firewall your source address(es) using a command such as iptables (on Linux) to prevent your own OS from interfering with your attack. Next ...
Writing Network Device Drivers for Linux By Mohan Lal Jangir Introduction This article has been written for kernel newcomers interested in learning about network device drivers. It assumes that reader has a significant exposure to C and the Linux environment. This article is based o ...
HugeTLB - Large Page Support in the Linux Kernel By R. Krishnakumar Abstract This article is meant to be a primer to the HugeTLB feature of the Linux kernel, which enables one to use virtual memory pages of large sizes. First, we will go through an introduction of large page support ...
今天同事问了这个问题,共享内存最多只能设成1G?之前只记得可以通过/proc/sys/kernel/shmmax来进行修改,但是最大是多少,倒是没有进行深究。1G的来由主要来自man proc:/proc/sys/kernel/shmmaxThis? file? can? be? used to query and set the run time limit on the maximum (System V IPC) shared memory segment size that can be created. Shared memory segments up to 1GB are now ...
最近一周为了实验室项目的测试,用libnet写了几个测试发包程序,在大流量发包的时候会遇到一些问题。问题一: No Buffer Space Available测试程序libnet_init的时候,是RAW4模式的,随机生成一些数据包来发送给我的服务器程序,当流量一大之后,libnet_write()就会出现错误,提示:libnet_write_raw_ipv4(): -1 bytes written (No buffer space available)原因一:发包速度太快,导致驱动中Buffer满了当然出现这种问题的原因,还有一个就是发包频率过高,导致出现的问题,这个时候,需要适当的进行us ...
/proc虚拟文件系统 ????/proc虚拟文件系统(也叫procfs)是Unix操作系统所 使用的虚拟文件系统的Linux实现,包括Sun Solaris、LinuxBSD。在/proc开始时,它以一个标准文件系统出现,并包含与正在运行的进程IDs同样名字的文件。然而,在/proc中 的文件不占用磁盘空间,它们存在于工作存储器(内存)中。/proc最初的目……
linux下内存释放问题 01/19/08 by:yifengzhang21c 细心的朋友会注意到,当你在linux下频繁存取文件后,物理内存会很快被用光,当程序结束后,内存不会被正常释放,而是一直作为caching.这个问题,貌似有不少人在问,不过都没有看到有什么很好解决的办法.那么我来谈谈这个问题. 先来说说free命令 [root@server ~]# free -m???&……
测试程序性能的时候,之前的时候需要不停的重启机器来进行测试,比较麻烦,想有什么办法可以清空磁盘缓存呢? If you're on OS X, the 'purge' command (part of the CHUD developer tools) will cause the disk caches to be purged. On Linux, with a 2.6.16 kernel or newer, 'echo 3 > /proc/sys/vm/drop_caches' will achieve the same effect. Another trick on Lin ...
Global site tag (gtag.js) - Google Analytics