Linux netfilterÔ´Âë·ÖÎö(4)
ËÄ¡¢nf_hook_ops ¹³×ÓµÄ×¢²á
ÔÚfilter±íµÄ³õʼ»¯º¯Êýstatic int __init init(void)ÖгýÁËÓÐÒ»¸önf_register_hookº¯Êý×¢²áÒ»¸ötablesÍ⣬»¹ÓÉnf_register_hookº¯Êý×¢²áÁË3¸öhook
4.1 nf_hook_opsÊý¾Ý½á¹¹ netfilter.h
struct nf_hook_ops
{
struct list_head list; //Á´±í³ÉÔ±
/* User fills in from here down. */
nf_hookfn *hook; //¹³×Óº¯ÊýÖ¸Õë
struct module *owner;
int pf; //ÐÒé´Ø£¬¶ÔÓÚipv4¶øÑÔ£¬ÊÇPF_INET
int hooknum; //hookÀàÐÍ
/* Hooks are ordered in ascending priority. */
int priority; //ÓÅÏȼ¶
};
list³ÉÔ±ÓÃÓÚά»¤Netfilter hookµÄÁÐ±í¡£
hook³ÉÔ±ÊÇÒ»¸öÖ¸Ïònf_hookfnÀàÐ͵ĺ¯ÊýµÄÖ¸Õ룬¸Ãº¯ÊýÊÇÕâ¸öhook±»µ÷ÓÃʱִÐеĺ¯Êý¡£nf_hookfnͬÑùÔÚlinux/netfilter.hÖж¨Òå¡£
pfÕâ¸ö³ÉÔ±ÓÃÓÚÖ¸¶¨ÐÒé×å¡£ÓÐЧµÄÐÒé×åÔÚlinux/socket.hÖÐÁгö£¬µ«¶ÔÓÚIPv4ÎÒÃÇʹÓÃÐÒé×åPF_INET¡£
hooknumÕâ¸ö³ÉÔ±ÓÃÓÚÖ¸¶¨°²×°µÄÕâ¸öº¯Êý¶ÔÓ¦µÄ¾ßÌåµÄhookÀàÐÍ:
NF_IP_PRE_ROUTING ÔÚÍêÕûÐÔУÑéÖ®ºó£¬Ñ¡Â·È·¶¨Ö®Ç°
NF_IP_LOCAL_IN ÔÚѡ·ȷ¶¨Ö®ºó£¬ÇÒÊý¾Ý°üµÄÄ¿µÄÊDZ¾µØÖ÷»ú
NF_IP_FORWARD Ä¿µÄµØÊÇÆäËüÖ÷»úµØÊý¾Ý°ü
NF_IP_LOCAL_OUT &n
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
תÌù×Ô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 ......
Linux»·¾³½ø³Ì¼äͨÐÅ£¨¶þ£©:
Ðźţ¨ÉÏ£©
ÎĵµÑ¡Ïî
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/>&a ......
Linux»·¾³½ø³Ì¼äͨÐÅ£¨¶þ£©:
Ðźţ¨Ï£©
ÎĵµÑ¡Ïî
<tr
valign="top"><td width="8"><img alt="" height="1" width="8"
src="//www.ibm.com/i/c.gif"/></td><td width="16"><img alt="" width=& ......