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

Linuxϼ¸Àý×¥°ü³ÌÐò´úÂë

×¥°ü³ÌÐò1 grub_allpacket.c
#include <stdio.h>
#include <string.h>
#include <errno.h> 
#include <unistd.h>
#include <sys/socket.h>
#include <sys/types.h> 
#include <linux/in.h>
#include <linux/if_ether.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <stdlib.h>
int main(int argc, char **argv) {
   int sock, n,i;
   char buffer[2048];
   unsigned char *iphead, *ethhead;
   struct ifreq ethreq;
 
   if ( (sock=socket(PF_PACKET, SOCK_RAW,
                     htons(ETH_P_IP)))<0) {
     perror("socket");
     exit(1);
   }
   /* Set the network card in promiscuos mode */
   strncpy(ethreq.ifr_name,"eth0",IFNAMSIZ);
   if (ioctl(sock,SIOCGIFFLAGS,&ethreq)==-1) {
     perror("ioctl");
     close(sock);
     exit(1);
}
   ethreq.ifr_flags|=IFF_PROMISC;
   if (ioctl(sock,SIOCSIFFLAGS,&ethreq)==-1) {
     perror("ioctl");
     close(sock);
     exit(1);
   }
 
   while (1) {
     printf("----------\n");
     n = recvfrom(sock,buffer,2048,0,NULL,NULL);
     printf("%d bytes read\n",n);
     printf("the frame content is :\n");
     for(i=0;i<n;)
 {
 printf("%02x",(unsigned char)buffer[i]);
 fflush(stdout);
 i=i+1;
 if(i%8==0)
  printf("\n");
 else
  printf(":");
 }
     printf("\n");
     /* Check to see if the packet contains at least
&nbs


Ïà¹ØÎĵµ£º

ʵսLinux Bluetooth±à³Ì (Æß) SDPЭÒé

Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖЭÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀЭÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......

[תÌû]LinuxÇý¶¯¿ª·¢Ñ§Ï°µÄһЩ±ØÒª²½Öè

 1. ѧ»áд¼òµ¥µÄmakefile
2. ±àһЩӦÓÃ
³ÌÐò
£¬¿ÉÒÔÓÃmakefileÅÜÆðÀ´
3. ѧ»áдÇý¶¯
µÄmakefile
4. дһ¼òµ¥charÇý¶¯£¬makefile±àÒëͨ¹ý£¬¿ÉÒÔinsmod£¬ lsmod£¬ rmmod. ÔÚÇý¶¯µÄinitº¯ÊýÀï´òÓ¡hello world£¬insmodºóÓ¦¸ÃÄܹ»Í¨¹ýdmesg¿´µ½Êä³ö
¡£
5. дһÍêÕûÇý¶¯£¬ ¼ÓÉÏread£¬ write£¬ ioctl£¬ pollingµÈ¸ ......

Linux¶¯Ì¬¿â(.so)ËÑË÷·¾¶

ÔÚLinux ÖУ¬¶¯Ì¬¿âµÄËÑË÷·¾¶³ýÁËĬÈϵÄËÑË÷·¾¶Í⣬»¹¿Éͨ¹ýÈýÖÖ·½·¨À´Ö¸¶¨£º·½·¨Ò»£ºÔÚÅäÖÃÎļþ/etc/ld.so.confÖÐÖ¸¶¨¶¯Ì¬¿âËÑË÷·¾¶£»·½·¨¶þ£ºÍ¨¹ý»·¾³±äÁ¿LD_LIBRARY_PATHÖ¸¶¨¶¯Ì¬¿âËÑË÷·¾¶£»·½·¨Èý£ºÔÚ±àÒëÄ¿±ê´úÂëʱָ¶¨¸Ã³ÌÐòµÄ¶¯Ì¬¿âËÑË÷·¾¶¡£
ÖÚËùÖÜÖª£¬Linux¶¯Ì¬¿âµÄĬÈÏËÑË÷·¾¶ÊÇ/libºÍ/usr/lib¡£¶¯Ì¬¿â±» ......

Éú²úÕß Ïû·ÑÕßÎÊÌâʵÏÖ (linuxÏÂCÓïÑÔ)

²Ù×÷ϵͳµÄÒ»¸ö¾­µäÎÊÌâÊÇ"Éú²úÕß-Ïû·ÑÕß"ÎÊÌâ, ÕâÉ漰ͬ²½ÐźÅÁ¿ºÍ»¥³âÐźÅÁ¿µÄÓ¦ÓÃ, ÔÚÕâÀï,ÎÒÓÃÏ̵߳Äͬ²½ºÍ»¥³âÀ´ÊµÏÖ.
#include <stdio.h>
#include <stdlib.h>
#include <unistd.h>
#include <pthread.h>
#include <semaphore.h>
#define N 2   // Ïû·ÑÕß» ......

RHCE——RH033Ö®linuxϵĴòÓ¡»ú

 
system-config-printer        ͼÐνçÃæÉèÖôòÓ¡»ú
 
 
BSD(FreeBSD)/System V
 
lpr/lp  ´òÓ¡ÎļþÃû           ´òÓ¡
lpr  -P´òÓ¡»úÃû  ´òÓ¡ÎļþÃû 
lp &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ