2008-09-29 10:15
start wan 还是从rc.c下面启动。
启动函数是start_wan(int init).这里会根据用户定义不同的wan启动模式启动。
如下:
833 if ( strcmp(mode, "pppoa")==0 )
834 {
835 start_pppoa(init,encap,vpi,vci);
836 }
837 else if ( strcmp(mode,"ipoa")==0 )
838 {
839 |
2008-09-26 10:50
PPPOE的会话阶段
PPPOE的会话过程
一旦PPPOE进入到会话阶段,则PPP的数据报文就会被填充在PPPOE的净载荷中被传送,这时两者所发送的所有以太网包均是单目地址。PPPOE会话 |
2008-09-26 10:50
PPPOE的发现阶段
PPPOE的初始化过程
PPPOE的初始化过程是至关重要的,它不仅要在广播式的网络上确定一对一的逻辑关系,而且还要为PPPOE的会话阶段准备一些必要条件,如访问集中器唯一分配的会话ID(Session ID |
2008-09-26 10:49
目 录(目录名)
概 述
PPPOE协议的基本概念
PPPOE协议出现的背景
随着宽带网络技术的不断发展,以xDSL、Cable |
2008-09-25 17:17
-
Syslogd
-
用rc来启动syslogd
这个程序只是用来发送消息的。从UI上来看,这个程序应该只有在以下三种情况才会调用smtpc来发送 |
2008-09-24 10:36
然match是以可扩展的形式表现出来,那么,当然就需要find_match这样的函数将它们一一找出来了。
前面说过,在输出规则的函数中:
IPT_MATCH_ITERATE(fw, print_match, &fw->ip, format & FMT_NUMERIC);
用来遍历每一个match,找到了后,就调用print_match来输出。print_match是调用find_match来查找的:
struct iptables_match *
find_match(const char *name, enum ipt_tryload tryload)
{
struct iptables_match *ptr;
for (ptr = iptables_matches; ptr; ptr = ptr->n |
2008-09-24 10:35
else
sprintf(buf, "%s", addr_to_anyname(&(fw->ip.src)));
strcat(buf, mask_to_dotted(&(fw->ip.smsk)));
printf(FMT("%-19s ","%s "), buf);
}
/*输出目的地址及掩码*/
fputc(fw->ip.invflags & IPT_INV_DSTIP ? '!' : ' ', stdout);
if (fw->ip.dmsk.s_addr == 0L && !(format & FMT_NUMERIC))
printf(FMT("%-19s","-> %s"), "anywhere");
else {
if (format & FMT_N |
2008-09-24 10:34
前面提到过,在内核中,handler指针指向了从内核中返回的对应的表的信息,handler对应的结构中,涉及到链的结构成员主要有两个:
struct chain_cache *cache_chain_heads;
struct chain_cache *cache_chain_iteration;
前者用于指向第一个链,后者指向当前链。而struct chain_cache的定义如下:
struct chain_cache
{
char name[TABLE_MAXNAMELEN]; /*链名*/
STRUCT_ENTRY *start; /*该链的第一条规则*/
STRUCT_ENTRY *end; /*该链的最后一条规则*/
};
理解了这两个成员,和结构stru |
2008-09-24 10:28
1.1 表的查找
再回到iptc_init 函数上来,它根据表名,从内核获取对应的表的相关信息,handle是一个iptc_handle_t类型的指针,在libiptc.c中,有如下定义:
/* Transparent handle type. */
typedef struct iptc_handle *iptc_handle_t;
在Libip4tc中:
#define STRUCT_TC_HANDLE struct iptc_handle
在Libiptc.c中,可以找到STRUCT_TC_HANDLE的定义:
STRUCT_TC_HANDLE
{
/* Have changes been made? */
int changed;
/* Size in here reflects original state. */
STRUC |
2008-09-24 10:27
一、规则的显示
选择先来说明规则的显示,因为他涉及到的东东简单,而且又全面,了解了规则的显示,对于其它操作的了解就显得容易了。
iptables version 1.2.7
iptables有两条线:ipv4 和ipv6,这里只分析v4的,因为v6偶暂时还用不着,没有去看。
iptables_standardone.c
主函数:
int main(int argc, char *argv[])
{
int ret;
char *table = "filter"; /*默认的表是filter*/
iptc_handle_t handle = NULL;
program_name = "iptables";
program_vers |
2008-09-24 09:15
I have reinstall my ubuntu with not format my /home partition. When I logining, I find my bash in console became "sh-3.2$".
To solve this problem, I reset PS1.
Now my PS1 in $HOME/.bashrc is:
PS1='[\u@\h \w]\$'
|
2008-09-23 16:54
smtpc 中对用户名,密码的加密比较简单的就是base64加密。 |
2008-09-22 13:24
Fedora 下编译 linux fetion 应用程序demo
1: 安装编译环境 sudo yum install qt4-devel curl-devel gcc glibc-devel
2: 去 http://www.libfetion.cn/Linux_demoapp_download.html 下载最新的libfetion GUI源代码
3: 使用解压命令解压下载后的文件 tar -zxvf linux-fetion-***.tar.gz (***为程序版本号)
4: 进入解压后的文件夹 cd linux-fetion-*** (***为程序版本号)
5: 如果你是64位系统,则运行64_libfetion.sh 脚本 ./64_libfetion.sh
6:运行编译命 |
2008-09-19 17:44
Fedora8 中为什么root用户时vim不能语法高亮?
其实这是因为fedora中vim是被装在/usr/bin/vim这里。
/usr/bin这个应该不在root的环境变量里面。
解决办法是:
rm /bin/vi;
ln -s /usr/bin/vim /bin/vi;
|
2008-09-18 15:52
最先可以从 51 static apfun_tab ap_fun_tab[]看起。
这里面说:
82 {"firewall", start_firewall, stop_firewall, create_firewall_cfg },
这里三个函数的作用很明显。
|
|
|
cygnusnow
男, 23岁
江苏 苏州
上次登录: 1天前
加为好友
|