linux ifconfig ÃüÁîÏê½â
Óï¡¡¡¡·¨£ºifconfig [ÍøÂçÉ豸][down up -allmulti -arp -promisc][add<µØÖ·>][del<µØÖ·>][<ÍøÂçÉ豸ÀàÐÍ> <Ó²¼þµØÖ·>][io_addr][irq ][media<ÍøÂçý½éÀàÐÍ>][mem_start<ÄÚ´æµØÖ·>][metric<ÊýÄ¿>][mtu<×Ö½Ú>][netmask<×ÓÍøÑÚÂë>][tunnel<µØÖ·>][-broadcast<µØÖ·>][-pointopoint<µØÖ·>][IPµØÖ·]
²¹³ä˵Ã÷£ºifconfig¿ÉÉèÖÃÍøÂçÉ豸µÄ״̬£¬»òÊÇÏÔʾĿǰµÄÉèÖá£
²Î¡¡¡¡Êý£º
add<µØÖ·> ÉèÖÃÍøÂçÉ豸IPv6µÄIPµØÖ·¡£
del<µØÖ·> ɾ³ýÍøÂçÉ豸IPv6µÄIPµØÖ·¡£
down ¹Ø±ÕÖ¸¶¨µÄÍøÂçÉ豸¡£
<ÍøÂçÉ豸ÀàÐÍ><Ó²¼þµØÖ·> ÉèÖÃÍøÂçÉ豸µÄÀàÐÍÓëÓ²¼þµØÖ·¡£
io_addr ÉèÖÃÍøÂçÉ豸µÄI/OµØÖ·¡£
irq ÉèÖÃÍøÂçÉ豸µÄIRQ¡£
media<ÍøÂçý½éÀàÐÍ> ÉèÖÃÍøÂçÉ豸µÄý½éÀàÐÍ¡£
mem_start<ÄÚ´æµØÖ·> ÉèÖÃÍøÂçÉ豸ÔÚÖ÷ÄÚ´æËùÕ¼ÓõÄÆðʼµØÖ·¡£
metric<ÊýÄ¿> Ö¸¶¨ÔÚ¼ÆËãÊý¾Ý°üµÄתËÍ´ÎÊýʱ£¬ËùÒª¼ÓÉϵÄÊýÄ¿¡£
mtu<×Ö½Ú> ÉèÖÃÍøÂçÉ豸µÄMTU¡£
netmask<×ÓÍøÑÚÂë> ÉèÖÃÍøÂçÉ豸µÄ×ÓÍøÑÚÂë¡£
tunnel<µØÖ·> ½¨Á¢IPv4ÓëIPv6Ö®¼äµÄËíµÀͨÐŵØÖ·¡£
up Æô¶¯Ö¸¶¨µÄÍøÂçÉ豸¡£
-broadcast<µØÖ·> ½«ÒªËÍÍùÖ¸¶¨µØÖ·µÄÊý¾Ý°üµ±³É¹ã²¥Êý¾Ý°üÀ´´¦Àí¡£
-pointopoint<µØÖ·> ÓëÖ¸¶¨µØÖ·µÄÍøÂçÉ豸½¨Á¢Ö±½ÓÁ¬Ïߣ¬´Ëģʽ¾ßÓб£Ãܹ¦ÄÜ¡£
-promisc ¹Ø±Õ»òÆô¶¯Ö¸¶¨ÍøÂçÉ豸µÄpromiscuousģʽ¡£
[IPµØÖ·] Ö¸¶¨ÍøÂçÉ豸µÄIPµØÖ·¡£
[ÍøÂçÉ豸] Ö¸¶¨ÍøÂçÉ豸µÄÃû³Æ¡£
Ïà¹ØÎĵµ£º
Linux USBÇý¶¯¿ò¼Ü·ÖÎö£¨Ò»£©
³õ´Î½Ó´¥ÓëOSÏà¹ØµÄÉ豸Çý¶¯±àд£¬¸Ð¾õ»¹Í¦ÓÐÒâ˼µÄ£¬ÎªÁ˲»ÖÁÓÚÍüµô¿´¹ýµÄ¶«Î÷£¬±Ê¼Ç¸ú×ܽᵱȻ²»¿Éȱ£¬¸üºÎ¿öÎÒ¾ö¶¨ÎªÇ¶ÈëʽÂôÃüÁË¡£ºÃ£¬ÑÔ¹éÕý´«£¬ÎÒ˵һ˵Õâ¶Îʱ¼äµÄÊÕ»ñ£¬¸ú´ó¼Ò·ÖÏíÒ»ÏÂLinuxµÄÇý¶¯¿ª·¢¡£µ«Õâ´ÎÖ»ÏÈÕë¶ÔLinuxµÄUSB×Óϵͳ×÷·ÖÎö£¬ÒòΪÖÜÎåÑÐÌÖÀÏ°å´ß» ......
2¡¢Ï̵߳ÄÖÕÖ¹
Èç¹û½ø³ÌÖÐÈκÎÒ»¸öÏß³ÌÖе÷ÓÃexit£¬_Exit,»òÕßÊÇ_exit£¬ÄÇôÕû¸ö½ø³Ì¾Í»áÖÕÖ¹£¬
Óë´ËÀàËÆ£¬Èç¹ûÐźŵÄĬÈϵĶ¯×÷ÊÇÖÕÖ¹½ø³Ì£¬ÄÇô£¬°Ñ¸ÃÐźŷ¢Ë͵½Ï̻߳áÖÕÖ¹½ø³Ì¡£
Ï̵߳ÄÕý³£Í˳öµÄ·½Ê½£º
(1) Ïß³Ì ......
3¡¢Ï̱߳êʶ
º¯ÊýÔÐÍ£º
#include <pthread.h>
pthread_t pthread_self(void);
pid_t getpid(void);
getpid()ÓÃÀ´È¡µÃÄ¿Ç°½ø³ÌµÄ½ø³Ìʶ±ðÂë,º¯Êý˵Ã÷
Àý³Ì8
³ÌÐòÄ¿µÄ£ºÊµÏÖÔÚн¨Á¢µÄÏß³ÌÖдòÓ¡¸ÃÏ̵߳ÄidºÍ½ø ......
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<net/if.h>
static char *bad_interface_names[] = {
"lo:",
"lo",
&n ......