ÔÚlinuxÏ »ñÈ¡£¬Ð޸ı¾»úIPµØÖ·µÄÁ½¸öº¯Êý
//»ñÈ¡±¾»úIPµØÖ·º¯Êý
QString GetLocalIp()
{
int sock_get_ip;
char ipaddr[50];
struct sockaddr_in *sin;
struct ifreq ifr_ip;
if ((sock_get_ip=socket(AF_INET, SOCK_STREAM, 0)) == -1)
{
printf("socket create failse...GetLocalIp!\n");
return "";
}
memset(&ifr_ip, 0, sizeof(ifr_ip));
strncpy(ifr_ip.ifr_name, "eth0", sizeof(ifr_ip.ifr_name) - 1);
if( ioctl( sock_get_ip, SIOCGIFADDR, &ifr_ip) < 0 )
{
return "";
}
sin = (struct sockaddr_in *)&ifr_ip.ifr_addr;
strcpy(ipaddr,inet_ntoa(sin->sin_addr));
printf("local ip:%s \n",ipaddr);
close( sock_get_ip );
return QString( ipaddr );
}
//Ð޸ı¾»úIPµØÖ·µÄº¯Êý
int SetLocalIp( const char *ipaddr )
{
int sock_set_ip;
struct sockaddr_in sin_set_ip;
struct ifreq ifr_set_ip;
bzero( &ifr_set_ip,sizeof(ifr_set_ip));
if( ipaddr == NULL )
return -1;
if(sock_set_ip = socket( AF_INET, SOCK_STREAM, 0 ) == -1);
{
perror("socket create failse...SetLocalIp!\n");
return -1;
}
memset( &sin_set_ip, 0, sizeof(sin_set_ip));
strncpy(ifr_set_ip.ifr_name, "eth0", sizeof(ifr_set_ip.ifr_name)-1);
sin_set_ip.sin_family = AF_INET;
sin_set_ip.sin_addr.s_addr = inet_addr(ipaddr);
memcpy( &ifr_set_ip.ifr_addr, &sin_set_ip, sizeof(sin_set_ip));
if( ioctl( sock_set_ip, SIOCSIFADDR, &ifr_set_ip) < 0 )
{
perror( "Not setup interface\n");
return -1;
}
//ÉèÖü¤»î±êÖ¾
ifr_set_ip.ifr_flags |= IFF_UP |IFF_RUNNING;
//get the status of the device
if( ioctl( sock_set_ip, SIOCSIFFLAGS, &ifr_set_ip ) < 0 )
{
perror("SIOCSIFFLAGS");
return -1;
}
close( sock_set_ip );
return 0;
}
Ïà¹ØÎĵµ£º
£¨L2CAPÐÒé¼ò½é£¬L2CAPÔÚBlueZÖеÄʵÏÖÒÔ¼°L2CAP±à³Ì½Ó¿Ú£©
Ò»£ºL2CAPÐÒé¼ò½é£º
Logical Link Control and Adaptation Protocol(L2CAP)
Âß¼Á¬½Ó¿ØÖƺÍÊÊÅäÐÒé (L2CAP) ΪÉϲãÐÒéÌá¹©ÃæÏòÁ¬½ÓºÍÎÞÁ¬½ÓµÄÊý¾Ý·þÎñ£¬²¢Ìṩ¶àÐÒ鹦ÄܺͷָîÖØ×é²Ù×÷¡£L2CAP ³äÐíÉϲãÐÒéºÍÓ¦ÓÃÈí¼þ´«ÊäºÍ½ÓÊÕ×î´ó³¤¶ÈΪ 64K µÄ L2CAP Ê ......
1¡¢Îļþϵͳ£ºext2 ext3 reiserfs xfsµÈ
¡¡¡¡2¡¢·¶Î§£ºÌáʾÎļþϵͳÐèÒªFSCKʱ£¬Î´Ö´ÐлòFSCKÖ´ÐÐÍê³É
¡¡¡¡[Ö¢×´]
¡¡ ¡¡1¡¢ÎÞ·¨MOUNT·ÖÇø£»
¡¡ ¡¡2¡¢´óÁ¿Îļþ¡¢Ä¿Â¼¶ªÊ§£¬¸ùĿ¼ÏÂÉú³É/LOST FOUNDÎļþ¼Ð£¬ÀïÃæÓдóÁ¿#XXXXXXÀàµÄÎļþºÍĿ¼£»
¡¡ ¡¡3¡¢FSCKºÜ¿ì±¨´íÍê³É£»
¡¡ ¡¡4¡¢FSCKÖ´ÐÐʱ£¬ÓдóÁ¿Ìáʾ£¬ÈçÐ޸Ľڵ㡠......
1. ǰÑÔ
kmem_cacheÊÇLinuxÄÚºËÌṩµÄ¿ìËÙÄڴ滺³å½Ó¿Ú£¬ÕâЩÄÚ´æ¿éÒªÇóÊÇ´óСÏàͬµÄ£¬ÒòΪ·ÖÅä³öµÄÄÚ
´æÔÚ½Ó¿ÚÊÍ·Åʱ²¢²»ÕæÕýÊÍ·Å£¬¶øÊÇ×÷Ϊ»º´æ±£Áô£¬ÏÂÒ»´ÎÇëÇó·ÖÅäʱ¾Í¿ÉÒÔÖ±½ÓʹÓã¬Ê¡È¥Á˸÷ÖÖ
ÄÚ´æ¿é³õʼ»¯»òÊͷŵIJÙ×÷£¬Òò´Ë·ÖÅäËٶȺܿ죬ͨ³£ÓÃÓÚ´óÊýÁ¿µÄÄÚ´æ¿é·ÖÅäµÄÇé¿ö£¬Èçinode½Ú
µã£¬skbuffÍ·, netfilt ......
For all those who are beginners in any linux(ubuntu) find hard to find the package files of their distro and end up in finding an source package(which is either in tar.gz or .gz).. so now people think how to install these source files…..
lets now see how would you be installing source files ......
ÓÐʱÓöµ½ÈçÏÂÎÊÌâ£¬Íø¿¨ÉÏÓиö²æ£¬ÈκÎÃüÁî¶¼ÎÞ·¨ÐÞ¸´¡£
·¢ÏÖÍø¿¨ºì²æÖ®Ç°ÊÔ¹ýÏÂÃæÃüÁ¿Ï¶¨¶¼²»Ðеġ£
sudo ifconfig eth0 down
sudo ifconfig eth0 up
sudo /etc/init.d/dhcp3-server restart
sudo /etc/init.d/networking restart
ÎÊÌâ½â¾öºÜ¼òµ¥£¬°ÑÈçϵĸ´Ñ¡¿ò¹´Éϼ´¿É£¬ÐéÄâ»ú¿ª» ......