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;
 
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
2¡¢APACHEµÄ°²×°
1£©µ±È»»¹ÊÇÏÂÔØÔ´Âë°ü£¬È磺httpd-2.0.55.tar.gz£¬µØÖ·×Ô¼ºÕÒ……
2£©½âѹËõ£¬>tar -zxvf httpd-2.0.55.tar.gz
3£©½øÈë½âѹºóµÄhttpd-2.0.55£¬>cd httpd-2.0.55
4£©°²×°ÅäÖã¬>./configure --prefix=/opt/apache --enable-cgi
5£©±àÒ룬>make
6£©°²×°£¬>make install
......
1¡¢ÏÂÔØphpMyAdminÖÁweb·þÎñÆ÷Ŀ¼²¢ÖØÃüÃûΪ£ºphpmyadmin¡£¼ÙÉè·þÎñÆ÷Ŀ¼Ϊwww£¬Ôò´æ·ÅλÖÃΪwww/phpmyadmin£¬·ÃÎÊ·¾¶Îªhttp://localhost/phpmyadmin
2¡¢¸´ÖÆ"/phpmyadmin/libraries/"Ŀ¼ÏµÄ"config.default.php"ÎļþÖÁ"/phpmyadmin/"Ŀ¼Ï£¬²¢ÖØÃüÃûΪ"config.inc.php"
3 ......
RPMÓÐ5ÖÖ»ù±¾²Ù×÷ģʽ£¨²»°üÀ¨Èí¼þ°ü½¨¹¹£©£º°²×°¡¢É¾³ý¡¢Éý¼¶¡¢²éѯºÍУÑé¡£
RPM°üµÄÃû³Æ¸ñʽ£¬eg£ºcaleng-1.0-1.i386.rpm¡£¸ÃÎļþÃû°üÀ¨Èí¼þ°üÃû³Æ“caleng”£»Èí¼þ°æ±¾ºÅ“1.0“£¬ÆäÖаüÀ¨Ö÷°æ±¾ºÅºÍ´Î°æ±¾ºÅ£»"i386"ÊÇÈí¼þËùÔËÐеÄÓ²¼þƽ̨¡£
1¡¢°²×°RPM°ü£¬eg: $>rpm -ivh test.rp ......
Ò»¡£linuxϵͳµÄĬÈϱàÂëÉèÖá£
/etc/sysconfig/i18n
Controls the system font
settings. The language variables are used in /etc/profile.d/lang.sh. An
example i18n file:
LANG="zh_CN.GB18030"
LANGUAGE="zh_CN.GB18030:zh_CN.GB2312:zh_CN"
SUPPORTED="zh_CN.GB18030:zh_CN ......