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

LinuxÄÚºËÈçºÎ½ÓÊÕ²»Í¬ÀàÐÍÒÔ̫֡

1. ǰÑÔ
ÒÔ̫ͷÖгýÁË6×Ö½ÚÄ¿µÄMACµØÖ·¡¢6×Ö½ÚÔ´MACµØÖ·Í⣬»¹ÓÐÁ½×Ö½ÚµÄÒÔ̫֡ÀàÐÍÖµ£¬ÈçIPv4Ϊ0x0800£¬ARPΪ0x0806µÈ£¬Íø¿¨Çý¶¯ÊÕµ½ÒÔ̫֡ºóͨ¹ý½Ó¿Úº¯Êýnetif_receive_skb()(netif_rxʵ¼Ê×îºóÒ²Êǵ÷ÓÃnetif_receive_skb)½»µ½Éϲ㣬¶øÕâ¸ö½Ó¿Úº¯Êý¾ÍÍê³É¶ÔÒÔ̫֡ÀàÐ͵ÄÇø·Ö£¬½»µ½²»Í¬µÄЭÒé´¦Àí³ÌÐò¡£Èç¹ûÏë×Ô¼º±àдijһÒÔÌ«ÀàÐÍÖ¡µÄ´¦Àí³ÌÐò£¬ÐèÒª×Ô¼ºÌí¼ÓÏàÓ¦µÄ
ÒÔÏÂLinuxÄں˴úÂëΪ2.6.17.11¡£
 
2. Êý¾Ý½á¹¹
ÿÖÖЭÒé¶¼Òª¶¨ÒåÒ»¸öpacket_type½á¹¹£¬Òýµ¼½øÈëÏà¹ØµÄЭÒéÊý¾Ý´¦Àíº¯Êý£¬ËùÓнڵã×é³ÉÒ»¸öÁ´±í(HASHÁ´±í)¡£
/* include/linux/netdevice.h */
struct packet_type {
 __be16   type; /* This is really htons(ether_type). */
 struct net_device *dev; /* NULL is wildcarded here      */
 int   (*func) (struct sk_buff *,
      struct net_device *,
      struct packet_type *,
      struct net_device *);
 void   *af_packet_priv;
 struct list_head list;
};
²ÎÊý˵Ã÷£º
type£ºÒÔ̫֡ÀàÐÍ£¬16λ
dev£ºËù¸½×ŵÄÍø¿¨É豸£¬Èç¹ûΪNULLÔòÆ¥ÅäÈ«²¿Íø¿¨
func£ºÐ­ÒéÈë¿Ú½ÓÊÕ´¦Àíº¯Êý
af_packet_priv£ºÐ­Òé˽ÓÐÊý¾Ý
list£ºÁ´±í¿Û
Ò»°ã¸÷ЭÒéµÄpacket_type½á¹¹¶¼ÊǾ²Ì¬´æÔÚ£¬³õʼ»¯Ê±Ö»ÌṩtypeºÍfuncÁ½¸ö²ÎÊý¾Í¿ÉÒÔÁË£¬Ã¿¸öЭÒéÔÚ³õʼ»¯Ê±¶¼Òª½«´Ë½á¹¹¼ÓÈ뵽ϵͳÀàÐÍÁ´±íÖС£
3. ´¦Àíº¯Êý
3.1 Ìí¼Ó½Úµã
/* net/core/dev.c */
/**
 * dev_add_pack - add packet handler
 * @pt: packet type declaration
 *
 * Add a protocol handler to the networking stack. The passed &packet_type
 * is linked into kernel lists and may not be freed until it has been
 * removed from the kernel lists.
 *
 * This call does not sleep therefore it can not
 * guarantee all CPU's that are in middle of receiving packets
 * will see the new packet type (until the next received packet).
 */
void dev_add_pack(struct packet_type *pt)
{
 int hash;
 


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì£¨Èý£© HCI²ã±à³Ì

1. HCI²ãЭÒé¸ÅÊö£º
HCIÌṩһÌ×ͳһµÄ·½·¨À´·ÃÎÊBluetoothµ×²ã¡£ÈçͼËùʾ£º
´ÓͼÉÏ¿ÉÒÔ¿´³ö£¬Host Controller Interface(HCI)  ¾ÍÊÇÓÃÀ´¹µÍ¨HostºÍModule¡£Hostͨ³£¾ÍÊÇPC£¬ ModuleÔòÊÇÒÔ¸÷ÖÖÎïÀíÁ¬½ÓÐÎʽ£¨USB,serial,pc-cardµÈ£©Á¬½Óµ½PCÉϵÄbluetooth Dongle¡£
ÔÚHostÕâÒ»¶Ë£ºapplication,SDP,L2capµÈЭÒé ......

linuxÐÔÄÜ·ÖÎö top

http://shake863.javaeye.com/blog/181246
top
top
ÃüÁîÊÇ×îÁ÷ÐеÄÐÔÄܹ¤¾ßÖ®Ò»¡£´ó¶àÊýϵͳ¹ÜÀíÔ±ÔËÐÐtop
²é¿´Linux
ºÍUNIXϵͳµÄÔËÐÐÇé¿ö¡£top
ʵÓù¤¾ßÌṩһÖÖ¼àÊÓ½ø³ÌºÍLinux
ÕûÌåÐÔÄܵÄÀíÏë·½·¨¡£½«Linux
½ø³Ì³Æ×÷ÈÎÎñ¸ü׼ȷ£¬µ«ÊÇÔÚ±¾ÕÂÖÐÎÒÃÇ»¹Êǽ«ËüÃdzÆ×÷½ø³Ì£¬ÒòΪÕâ¸ö¹¤¾ßÒ²ÕâÑù³ÆºôËüÃÇ¡£1
ÆÕͨÓû§º ......

linux 0.11 ÄÚºËѧϰ console.c£¬¿ØÖÆÌ¨


²Î¿¼¡¶linuxÄÚºËÍêȫעÊÍ¡·ºÍÍøÉÏÏà¹ØÎÄÕÂ
/*
 * ¿ØÖÆÌ¨ÏÔʾ²Ù×÷
 */
/*
 *  linux/kernel/console.c
 *
 *  (C) 1991  Linus Torvalds
 */
/*
 * console.c
 *
 * This module implements the console io functions
 * 'void con_init(v ......

Red Hat Linux °²È«ÉèÖÃÎĵµ

±¾ÎÄ´Ó¸÷·½Ãæ²ûÊöÁËRed Hat LinuxµÄ°²È«ÅäÖ÷½·¨£¬Èç¹ûÄúʹÓõÄÊÇWindows Server 2003·þÎñÆ÷µÄ»°£¬Çë¿´Windows Server 2003 ϵͳÅäÖ÷½°¸¡£
ÍøÂ簲ȫÊÇÖ¸ÍøÂçϵͳµÄÓ²¼þ¡¢Èí¼þ¼°ÆäϵͳÖеÄÊý¾ÝÊܵ½±£»¤£¬²»ÊÜżȻµÄ»òÕß¶ñÒâµÄÔ­Òò¶øÔâµ½ÆÆ»µ¡¢¸ü¸Ä¡¢Ð¹Â¶£¬ÏµÍ³Á¬Ðø¿É¿¿Õý³£µØÔËÐУ¬ÍøÂç·þÎñ²»Öжϡ£
ÍøÂ簲ȫ´ÓÆä±¾ÖÊÉÏÀ´ ......

JAVAµÃµ½Íø¿¨ÎïÀíµØÖ·(windowsºÍLinux)

ÔÚÎÒÃÇÔÚд³ÌÐòµÄ¹ý³ÌÖÐ,ÓÐЩʱºòÐèÒªÖªµÀһЩµçÄÔµÄÓ²¼þÐÅÏ¢,±ÈÈçÎÒÃÇдһЩÐèҪע²áµÄ³ÌÐòµÄʱºò,¾ÍÐèÒªµÃµ½Ä³¸öµçÄÔÌØ¶¨µÄÐÅÏ¢,Ò»°ãÀ´Ëµ,Íø¿¨µÄÎïÀíµØÖ·ÊDz»»áÖØ¸´µÄ,ÎÒÃÇÕýºÃ¿ÉÒÔÓÃËüÀ´×öΪÎÒÃÇʶ±ðһ̨µçÄԵıêÖ¾.ÄÇÈçºÎµÃµ½Íø¿¨µÄÎïÀíµØÖ·ÄØ?ÎÒÃÇ¿ÉÒÔ½èÖúÓÚProcessBuilderÕâ¸öÀà,Õâ¸öÀàÊÇJDK1.5мӵÄ,ÒÔǰҲ¿ÉÒÔÓÃRu ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ