Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

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


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨ËÄ£© L2CAP²ã±à³Ì

£¨L2CAPЭÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPЭÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼­Á¬½Ó¿ØÖƺÍÊÊÅäЭÒé (L2CAP) ΪÉϲãЭÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àЭÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãЭÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

[C++] LinuxϵÄitoaº¯Êý

ÉÏÆªÎÄÕÂ˵µ½linuxÐèÒªitoaº¯Êý£¬ÏÂÃæÎÒ¾ÍÌṩһ·Ý¿çƽ̨µÄitoaº¯Êý¡£
//return the length of result string. support only 10 radix for easy use and better performance
int my_itoa(int val, char* buf)
{
    const int radix = 10;
    char* p;
    int a;&nbs ......

Linux netfilterÔ´Âë·ÖÎö(3)

תÌù×Ô£ºhttp://alexanderlaw.blog.hexun.com/8968782_d.html
Èý¡¢ipt_table±íµÄ×¢²á
 
init£¨£©º¯Êý³õʼ»¯Ê±µ÷ÓÃÁËipt_register_tableº¯Êý½øÐбíµÄ×¢²á
 
3.1  ip_tables.c ±íµÄ×¢²á ipt_register_table
int ipt_register_table(struct ipt_table *table)
{
       ......

linuxϳ£ÓõÄÃüÁî

1.´ÅÅÌÃüÁî
       mount        ¹ÒÉÏÎļþϵͳ
       umount       жÏÂÒѹÒÉϵÄÎļþϵͳ
       df          ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ