Linux netfilterÔ´Âë·ÖÎö(5)
Îå¡¢ ipt_do_table()º¯Êý£¬Êý¾Ý°üµÄ¹ýÂË
5.1 ipt_entry Ïà¹Ø½á¹¹ ip_tables.h
ipt_entry½á¹¹Ç°ÃæÓйýÁË£¬ÔÙ¿´Ò»±é
struct ipt_entry
{
struct ipt_ip ip;
/* ËùҪƥÅäµÄ±¨ÎĵÄIPÍ·ÐÅÏ¢ */
unsigned int nfcache;
/* λÏòÁ¿£¬±êʾ±¾¹æÔò¹ØÐı¨ÎĵÄʲô²¿·Ö£¬ÔÝδʹÓà */
u_int16_t target_offset;
/* targetÇøµÄÆ«ÒÆ£¬Í¨³£targetÇøÎ»ÓÚmatchÇøÖ®ºó£¬¶ømatchÇøÔòÔÚipt_entryµÄĩβ£»
³õʼ»¯Îªsizeof(struct ipt_entry)£¬¼´¼Ù¶¨Ã»ÓÐmatch */
u_int16_t next_offset;
/* ÏÂÒ»Ìõ¹æÔòÏà¶ÔÓÚ±¾¹æÔòµÄÆ«ÒÆ£¬Ò²¼´±¾¹æÔòËùÓÿռäµÄ×ܺͣ¬
³õʼ»¯Îªsizeof(struct ipt_entry)+sizeof(struct ipt_target)£¬¼´Ã»ÓÐmatch */
unsigned int comefrom;
/* λÏòÁ¿£¬±ê¼Çµ÷Óñ¾¹æÔòµÄHOOKºÅ£¬¿ÉÓÃÓÚ¼ì²é¹æÔòµÄÓÐЧÐÔ */
struct ipt_counters counters;
/* ¼Ç¼¸Ã¹æÔò´¦Àí¹ýµÄ±¨ÎÄÊýºÍ±¨ÎÄ×Ü×Ö½ÚÊý */
unsigned char elems[0];
/*target»òÕßÊÇmatchµÄÆðʼλÖà */
}
ipt_ip½á¹¹ ip_tables.h
struct ipt_ip {
struct in_addr src, dst; /* À´Ô´/Ä¿µÄµØÖ· */
struct in_addr smsk, dmsk; /* À´Ô´/Ä¿µÄµØÖ·µÄÑÚÂë */
char iniface[IFNAMSIZ], outiface[IFNAMSIZ]; /*ÊäÈëÊä³öÍøÂç½Ó¿Ú*/
unsigned char iniface_mask[IFNAMSIZ], outiface_mask[IFNAMSIZ];
u_int16_t proto; /* ÐÒé, 0 = ANY */
u_int8_t flags; /* ±êÖ¾×Ö¶Î */
u_int8_t invflags; /* È¡·´±êÖ¾ */
};
5.2 ipt_do_tableº¯Êý ip_tables.c
unsigned int
ipt_do_table(struct sk_buff **pskb,
unsigned int hook,
const struct net_device *in,
&
Ïà¹ØÎĵµ£º
תÌù×Ôhttp://alexanderlaw.blog.hexun.com/8968771_d.html
¶þ¡¢ipt_tableÊý¾Ý½á¹¹ºÍ±íµÄ³õʼ»¯
2.1 include/linux/netfilter_ipv4/ip_tables.h struct ipt_table ±í½á¹¹
struct ipt_table
{
struct list_head list;
/* ±íÁ´ */
char name[IPT_TABLE_MAXNAMELEN];
/* ±íÃû£¬Èç"fil ......
¹ØÓÚ´ËÎÄ
±¾ÎĵµÓÃÓÚÉý¼¶
ExtMail
£¬
ExtMan
°æ±¾£¬Éý¼¶×Ô
ExtMail 0.24(
º¬ÒÔϰ汾£©µ½
1.0.5
Îȶ¨°æ
,
±¾ÎĵµÖ»ÄÜÊÊÓÃÓÚÊý¾Ý¿âÊÇ
mysql
µÄ°æ±¾
,
¼ÙÉè°²×°ÓʾֵÄÓòÃû
Ϊ
extmail
.org
£¬¶ÁÕßÇë¸ù¾Ý×ÔÉíʵ¼ÊÇé¿öÓèÒÔÐ޸ġ£
Éý¼¶²½Öè
1.
Í£Ö¹·þÎñ£º
postifx,http,mysql,pop3
service httpd stop
......
1¹Ø»úÃüÁî shutdown 1£©shutdown --help
2£©shutdown -h now ÏÖÔÚÁ¢¼´¹Ø»ú == halt Ö¸Áî
3£©shutdown -r now ÏÖÔÚÁ¢¼´ÖØÆô
4£©shutdown -r +3 Èý·ÖÖÓºóÖØÆô
5£©shutdown -h +3 "The System will shutdown after 3 minutes" ÌáʾʹÓÃÕß½«ÔÚÈý·ÖÖÓºó¹Ø»ú
6£©shutdown -r 20:23 ÔÚ20£º23ʱ½«ÖØÆô¼ÆËã»ú
7£©shutdown ......
¡¡¡¡¡¡¡¡¡¡Ð´¸øLinuxÄÚºËÐÂÊÖ-¹ØÓÚLinuxÄÚºËѧϰµÄÎóÇø
-----¸Ð¾õÕâÆªÎÄÕ²»´í£¬Óзdz£¶à½è¼øµÄµØ·½,so×ªÔØ¹ýÀ´ÁË
¡¡¡¡ÏÈ˵¾äÕý¾µÄ£ºÆäʵÎÒû×ʸñдÕâÆªÎÄÕ£¬ÒòΪ×Ô¼ºÒ²¾ÍÒ»Á½¸öÔÂÒÔÀ´²Å¿ªÊ¼ÓÐËùÁìÎòµÄ¡£Òò´Ë£¬ÕâÀïºÍÆä˵ÊǹØÓÚLinuxÄÚºËѧϰµÄ¾Ñ飬²»Èç˵ÊÇ×Ô¼ºµÄ½Ìѵ°É£¬Ï£Íû²»ÒªÈÓ¼¦µ°ÔÒÎÒ^_^
¡¡¡¡¡¡³£³£ÓÐÈËÎÊ£ºÎ ......
×ªÔØ×Ôhttp://www.examda.com/linux/fudao/20070919/112113103.html
ѧϰӦ¸ÃÊÇÒ»¸öÏȰÑÎÊÌâ¼òµ¥»¯£¬ÔÚ°ÑÎÊÌ⸴ÔÓ»¯µÄ¹ý³Ì¡£Ò»¿ªÊ¼¾Í×ÅÊÖ´¦Àí¸´ÔÓµÄÎÊÌ⣬ÄÑÃâÈà ÈËÓÐÐľªµ¨²ü£¬×½½ó¼ûÖâµÄ¸Ð¾õ¡£¶ÁLinuxÍø¿¨Çý¶¯Ò²ÊÇÒ»Ñù¡£Ädz¤³¤µÄÔ´Âë¼ÐÔÓ×ÅÄÇЩÎÒÃÇİÉúµÄ±äÁ¿ºÍ·ûºÅ£¬Íû¶øÉúη±ãÊ ......