linuxÏÂÍøÂç±à³Ì SOCKETʹÓ÷½·¨
ʲôÊÇSocket
¡¡¡¡Socket½Ó¿ÚÊÇTCP/IPÍøÂçµÄAPI£¬Socket½Ó¿Ú¶¨ÒåÁËÐí¶àº¯Êý»òÀý³Ì£¬³ÌÐòÔ±¿ÉÒÔÓÃËüÃÇÀ´¿ª·¢TCP/IPÍøÂçÉϵÄÓ¦ÓóÌÐò¡£ÒªÑ§InternetÉϵÄTCP/IPÍøÂç±à³Ì£¬±ØÐëÀí½âSocket½Ó¿Ú¡£
¡¡¡¡Socket½Ó¿ÚÉè¼ÆÕß×îÏÈÊǽ«½Ó¿Ú·ÅÔÚUnix²Ù×÷ϵͳÀïÃæµÄ¡£Èç¹ûÁ˽âUnixϵͳµÄÊäÈëºÍÊä³öµÄ»°£¬¾ÍºÜÈÝÒ×Á˽âSocketÁË¡£ÍøÂçµÄSocketÊý¾Ý´«ÊäÊÇÒ»ÖÖÌØÊâµÄI/O£¬SocketÒ²ÊÇÒ»ÖÖÎļþÃèÊö·û¡£SocketÒ²¾ßÓÐÒ»¸öÀàËÆÓÚ´ò¿ªÎļþµÄº¯Êýµ÷ÓÃSocket()£¬¸Ãº¯Êý·µ»ØÒ»¸öÕûÐ͵ÄSocketÃèÊö·û£¬ËæºóµÄÁ¬½Ó½¨Á¢¡¢Êý¾Ý´«ÊäµÈ²Ù×÷¶¼ÊÇͨ¹ý¸ÃSocketʵÏֵġ£³£ÓõÄSocketÀàÐÍÓÐÁ½ÖÖ£ºÁ÷ʽSocket£¨SOCK_STREAM£©ºÍÊý¾Ý±¨Ê½Socket£¨SOCK_DGRAM£©¡£Á÷ʽÊÇÒ»ÖÖÃæÏòÁ¬½ÓµÄSocket£¬Õë¶ÔÓÚÃæÏòÁ¬½ÓµÄTCP·þÎñÓ¦Óã»Êý¾Ý±¨Ê½SocketÊÇÒ»ÖÖÎÞÁ¬½ÓµÄSocket£¬¶ÔÓ¦ÓÚÎÞÁ¬½ÓµÄUDP·þÎñÓ¦Óá£
Socket½¨Á¢
¡¡¡¡ÎªÁ˽¨Á¢Socket£¬³ÌÐò¿ÉÒÔµ÷ÓÃSocketº¯Êý£¬¸Ãº¯Êý·µ»ØÒ»¸öÀàËÆÓÚÎļþÃèÊö·ûµÄ¾ä±ú¡£socketº¯ÊýÔÐÍΪ£º
¡¡¡¡int socket(int domain, int type, int protocol);
¡¡¡¡domainÖ¸Ã÷ËùʹÓõÄÐÒé×壬ͨ³£ÎªPF_INET£¬±íʾ»¥ÁªÍøÐÒé×壨TCP/IPÐÒé×壩£»type²ÎÊýÖ¸¶¨socketµÄÀàÐÍ£ºSOCK_STREAM »òSOCK_DGRAM£¬Socket½Ó¿Ú»¹¶¨ÒåÁËÔʼSocket£¨SOCK_RAW£©£¬ÔÊÐí³ÌÐòʹÓõͲãÐÒ飻protocolͨ³£¸³Öµ"0"¡£Socket()µ÷Ó÷µ»ØÒ»¸öÕûÐÍsocketÃèÊö·û£¬Äã¿ÉÒÔÔÚºóÃæµÄµ÷ÓÃʹÓÃËü¡£
¡¡¡¡SocketÃèÊö·ûÊÇÒ»¸öÖ¸ÏòÄÚ²¿Êý¾Ý½á¹¹µÄÖ¸Õ룬ËüÖ¸ÏòÃèÊö·û±íÈë¿Ú¡£µ÷ÓÃSocketº¯Êýʱ£¬socketÖ´ÐÐÌ彫½¨Á¢Ò»¸öSocket£¬Êµ¼ÊÉÏ"½¨Á¢Ò»¸öSocket"Òâζ×ÅΪһ¸öSocketÊý¾Ý½á¹¹·ÖÅä´æ´¢¿Õ¼ä¡£SocketÖ´ÐÐÌåΪÄã¹ÜÀíÃèÊö·û±í¡£
¡¡¡¡Á½¸öÍøÂç³ÌÐòÖ®¼äµÄÒ»¸öÍøÂçÁ¬½Ó°üÀ¨ÎåÖÖÐÅÏ¢£ºÍ¨ÐÅÐÒé¡¢±¾µØÐÒéµØÖ·¡¢±¾µØÖ÷»ú¶Ë¿Ú¡¢Ô¶¶ËÖ÷»úµØÖ·ºÍÔ¶¶ËÐÒé¶Ë¿Ú¡£SocketÊý¾Ý½á¹¹Öаüº¬ÕâÎåÖÖÐÅÏ¢¡£
SocketÅäÖÃ
¡¡¡¡Í¨¹ýsocketµ÷Ó÷µ»ØÒ»¸ösocketÃèÊö·ûºó£¬ÔÚʹÓÃsocket½øÐÐÍøÂç´«ÊäÒÔÇ°£¬±ØÐëÅäÖøÃsocket¡£ÃæÏòÁ¬½ÓµÄsocket¿Í»§¶Ëͨ¹ýµ÷ÓÃConnectº¯ÊýÔÚsocketÊý¾Ý½á¹¹Öб£´æ±¾µØºÍÔ¶¶ËÐÅÏ¢¡£ÎÞÁ¬½ÓsocketµÄ¿Í»§¶ËºÍ·þÎñ¶ËÒÔ¼°ÃæÏòÁ¬½ÓsocketµÄ·þÎñ¶Ëͨ¹ýµ÷ÓÃbindº¯ÊýÀ´ÅäÖñ¾µØÐÅÏ¢¡£
Bindº¯Êý½«socketÓë±¾»úÉϵÄÒ»¸ö¶Ë¿ÚÏà¹ØÁª£¬ËæºóÄã¾Í¿ÉÒÔÔڸö˿ڼàÌý·þÎñÇëÇó¡£Bindº¯ÊýÔÐÍΪ£º
¡¡¡¡int bind(int sockfd,struct sockaddr *my_addr, int addrlen);
¡¡¡¡SockfdÊǵ÷ÓÃsocketº¯Êý·µ»ØµÄsocketÃèÊö·û,my_addrÊ
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍSignaling Packet£º
Signaling CommandÊÇ2¸öBluetoothʵÌåÖ®¼äµÄL2CAP²ãÃüÁî´«Êä¡£ËùÒÔµÃSignaling CommandʹÓÃCID 0x0001.
¶à¸öCommand¿ÉÒÔÔÚÒ»¸öC-frame£¨control frame£©Öз¢ËÍ¡£
Èç¹ûÒªÖ±½Ó·¢ËÍSignaling Command.ÐèÒª½¨Á¢SOCK_RAWÀàÐ͵ÄL2CAPÁ¬½ÓSocket¡£ÕâÑù²ÅÓлú»á×Ô¼ºÌî³äCommand Code£¬Identi ......
1 ¸ùÎļþϵͳ
¼òµ¥À´Ëµ£¬£¨¸ùÎļþϵͳ£©¾ÍÊÇϵͳµÚÒ»¸ömountµÄÎļþϵͳ
Filesystem Handling
Like every traditional Unix system, Linux makes use of a system 's root file ......
ÒýÓÃhttp://www.icanwen.cn/article.asp?id=18
±»¼à¿ØÖ÷»úµÄ°²×°ÅäÖÃ
1.´´½¨ÕʺÅ
useradd nagios
passwd nagios
2.°²×°nagios²å¼þ
tar xvzf nagios-plugins-*.tar.gz
./configure
make && make install
chown nagios.nagios ......
Ä¿Ç°£¬Linux×÷ΪǶÈëʽϵͳµÄÖ÷Á¦¾ü£¬¹ã·ºÓ¦ÓÃÓÚÏû·ÑÀàµç×Ó¡¢¹¤Òµ¿ØÖÆ¡¢¾ü¹¤µç×Ó¡¢µçÐÅ/ÍøÂç/ͨѶ¡¢º½¿Õº½Ìì¡¢Æû³µµç×Ó¡¢Ò½ÁÆÉ豸¡¢ÒÇÆ÷ÒDZíµÈÏà¹ØÐÐÒµ¡£Ëæ×ÅǶÈëʽÐÐÒµµÄѸÃÍ·¢Õ¹£¬Ç¶ÈëʽLinuxƾ½èÆäϵͳ·¢Õ¹µÄ³ÉÊì¶È¡¢Êг¡Ó¦Óõĸ߷ݶîÒ²Êܵ½¸ü¶à¹¤³ÌʦÅóÓѵÄÇàíù£¬Ô½À´Ô½¶àµÄÆóÒµºÍÑз¢»ú¹¹¶¼×ªÏòǶÈëʽLinuxµÄ¿ ......