linux ƽ̨µÝ¹é¶ÁÈ¡¶ÁÈ¡ËùÓÐÎļþ¼ÐºÍÎļþÃû³Æ
#include<stdio.h>
#include<string.h>
#include<stdlib.h>
#include<sys/stat.h>
#include<fcntl.h>
#include<sys/types.h>
#include<dirent.h>
#define MAX 1024
char path[100];
char *strmin(char *des,const char *min)
{
int i=strlen(des);
int j=strlen(min);
if(i>=j)
{
strncpy(des+i-j,"\0",1);
}
return des;
}
void print(char *path,char *tmpname)
{
struct stat buf;
if(stat(path,&buf)<0)
{
printf("stat error!\n");
return;
}
struct dirent *filename;
if(S_ISDIR(buf.st_mode))
{
DIR *dp;
dp=opendir(path);
while(1)
{
filename=readdir(dp);
if(filename == NULL)
{
strmin(path,tmpname);
closedir(dp);
return ;
}
else
{
if(strcmp(filename->d_name,".")==0 ||strcmp(filename->d_name,"..")==0)
continue;
printf("%s\n",filename->d_name);
strcat(path,"/");
strcat(path,filename->d_name);
print(path,filename->d_name);
strmin(path,"/");
}
}
}
else
{
int fd;
fd=open(path,O_RDWR);
char buf[MAX];
int size;
while(1)
{
size=read(fd,buf,MAX);
if(size==0)
{
close(fd);
break;
}
}
strmin(path,tmpname);
}
}
int
Ïà¹ØÎĵµ£º
ÀýÒ»£º·¢ËÍ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 ......
#include <sys/socket.h>
#include <sys/ioctl.h>
#include <netinet/in.h>
#include <arpa/inet.h>
#include <net/if.h>
int sock_fd;
struct my_addr;
struct ifreq ifr;
unsigned char * addr;
#define ETH_INTERFACE_NAME "e ......
£±¡¢²é¿´IP¡¡¡¡Ifconfig
¡¡¡¡£²¡¢ÅäÖÃIPµÄ·½·¨£º
¡¡¡¡A¡¢ ÕâÖÖ·½·¨Á¢¼´ÉúЧ¡¡µ«ÊÇÖØÆô½«²»»á±£´æ¡££¨³ýÁËÕâ¸ö·½·¨µÄÆäËü·½·¨¶¼¿ÉÒÔ±£´æÏÂÀ´£©
¡¡¡¡Ifconfig eth£° 1.1.1.1 netmask 255.0.0.0 up
¡¡¡¡Ifconfig eth0:1 1.1.1.3 up¡¡¡¡ÉèÖÃÒ»¸öÍø¿¨¶à¸öIPµÄ·½·¨£¨ÔÚÉèÖÃÐéÄâÖ÷»úʱÓÐ ......
ǰÑÔ:
ÕâÊÇһƪºÜ³õ¼¶µ«ÊÇÒ²±È½Ï¼òµ¥ÈÝÒ×ѧϰLinuxĿ¼ȨÏÞÉèÖõÄÎÄÕÂ,֮ǰÎÒʹÓÃWindows Serverϵͳ,ÓÃͼÐνçÃæ¹ÜÀíÎļþµÄ·ÃÎÊȨÏÞ.ºóÀ´ÔÚѧϰGUN/Linux ServerµÄʱºò·¢ÏÖGUN/LinuxµÄȨÏÞ¹ÜÀíÉèÖ÷dz£Ç¿´ó,Ò²·Ç³£·½±ã.µ«ÊÇÎÒ·¢ÏÖÔÚÍøÂ·ÉÏûÓÐһƪÎÄÕÂÊÇÍêÕûÐðÊö+ÈöÁÕߺÜÈÝÒ×Àí½âµÄ,ÓÚÊÇÎÒдÁËÕâÆª¼òµ¥Ò×¶®µÄL ......
¼ò½é
ÕâÆªÎÄÕÂÖ÷Òª¼Ç¼ÎÒÔÚÊÔͼ½â¾öÈçºÎ¾¡¿ÉÄܾ«È·µØÔÚij¸öÌØ¶¨µÄʱ¼ä¼ä¸ôÖ´ÐÐijÏî¾ßÌåÈÎÎñʱµÄ˼·Àú³Ì£¬²¢ÔÚºóÆÚ¶ÔÏà¹ØµÄAPI½øÐеĹéÄɺÍ×ܽᣬÒÔ±¸²Î¿¼¡£
ÎÊÌâÒý³ö
ºÜ¶àʱºò£¬ÎÒÃÇ»áÓÐÀàËÆ“ÿ¸ô¶à³¤Ê±¼äÖ´ÐÐijÏîÈÎÎñ
”µÄÐèÇó£¬Õ§¿´Õâ¸öÎÊÌâ²¢²»Äѽâ¾ö£¬ÊµÔò²¢²»ÈÝÒ×£¬ÓкܶàÒþº¬Ìõ¼þÐèÒª¿¼ÂÇ£¬Ö ......