【转帖LINUX】netfilter中的conntrack内核阅读笔记(2)
2008-07-07 22:05
初始化
1,ip_conntrack_standalone_init是contrack模块的初始化函数。它主要完成以下内容:
/*1, 初始化conntrack相关的数据结构,如hash表,ip_conntrack_protocol以及内存管理等*/
ret = ip_conntrack_init();
if (ret < 0)
return ret;
#ifdef CONFIG_PROC_FS
/* 在/proc目录下创建"ip_conntrack","ip_conntrack_expect"记录连接跟踪信息*/
……
#endif
/*2,为conntrack注册hook点*/
ret = nf_register_hooks(ip_conntrack_ops, ARRAY_SIZE(ip_conntrack_ops));
if (ret < 0) {
printk("ip_conntrack: can't register hooks.\n");
goto cleanup_proc_stat;
}
#ifdef CONFIG_SYSCTL
/*3,注册sysctrl的操作函数集*/
ip_ct_sysctl_header = register_sysctl_table(ip_ct_net_table, 0);
if (ip_ct_sysctl_header == NULL) {
printk("ip_conntrack: can't register to sysctl.\n");
ret = -ENOMEM;
goto cleanup_hooks;
}
#endif
2,ip_conntrack_init:
/*1,完成hash的初始化,hash桶的大小为内存大小的1/16384 ,在i386中,若内存小于32M,hash桶为256个,若大于1G,桶为8196个。Hash表的大小为桶个数的8倍,用ip_conntrack_hash 指针表示*/
if (!ip_conntrack_htable_size) {
ip_conntrack_htable_size
= (((num_physpages << PAGE_SHIFT) / 16384)
/ sizeof(struct list_head));
if (num_physpages > (1024 * 1024 * 1024 / PAGE_SIZE))
ip_conntrack_htable_size = 8192;
if (ip_conntrack_htable_size < 16)
ip_conntrack_h
相关文档:
网上有很多的资料,参考itput(http://space.itpub.net/471666/viewspace-215923)的。
OS : Redhat
DB : Oracle 10.2.0.4.0
1.修改jdk 下面的字体。
[oracle@a ~]$ cd $ORACLE_HOME/jdk/jre/lib/
[oracle@a ~]]$ mv font.properties font.properties_bak
[oracle@a ~]]$
[oracle@a ~]]$ cp font.properties.zh_CN.R ......
今天在Gentoo下安装了VirtualBox虚拟了一个XP,这样需要迅雷等一些只有For Windows下的软件时候不用必须重新启动切换到Windows下了。
显然两个OS之前的文件交换也很关键,解决方案也非常的简单。
1)在Gentoo下安装openssh
emerge openssh
2)在windows客户机上安装FileZilla
......
http://blog.csdn.net/dinitial/archive/2009/02/22/3923559.aspx
Gdb+gdbserver+insight环境的搭建
1. 下载gdb源代码 http://ftp.gnu.org/gnu/gdb/
2. 配置安装gdb+gdbser
$ tar jxvf gdb-6.6.tar.bz2
$ cd x/gdb
$ ./configure --target=arm-linux --prefix ......
4. Threads
To use the POSIX standard thread API (pthreads), link libpthread.so
to your program.
4.1. Thread Creation
Each thread in a process is identified by a thread ID,
pthread_t.
The pthread_self function returns the thread ID of the current
thread.
This thread IDs can be compared ......
apache的源码安装
将压缩包解压之后进入相应的目录
./configure \ #--------------------预编译命令
"--prefix=/usr/local/apache" \ #--------------------安装路径为“/usr/local/apache”
"--with-included-apr" \
"--enable-so" \ #--------------------开启相应的扩展模块 ......