linuxÏÂÀûÓÃPF_PACKETÐÒé×岶°ü·½·¨
ÏÈ
·ÅÒ»¶ÎʾÀý³ÌÐò£¬Õâ¶Î³ÌÐòÎÒÔÚRH9ºÍAS4ϱàÒëͨ¹ý£¬³ÌÐò¹¦ÄܾÍÊÇÓôÓ2.2Äں˼ÓÈëµÄPF_PACKETÐÒé×åÀ´½øÐеײãÊý¾Ý°ü²¶»ñ²¢ÏÔʾ¡£
PF_PACKETÐÒé×åÊÇÓëϵͳTCP/IPÐÒéÕ»²¢ÐеÄͬ¼¶±ðÄ£¿é£¬¼´´ÓPF_PACKETÐÒé×åµÃµ½µÄÊý¾Ý°üÊÇûÓо¹ýϵͳTCP/IPÐÒéÕ»´¦Àí
µÄ¡£¶øÇÒ£¬Í¨¹ýÉèÖûìÔÓģʽ£¬¿ÉÒÔºÜÈÝÒ×µÄʵÏÖsniffer¡£
#include<errno.h>
#include<stdio.h>
#include<stdlib.h>
#include<string.h>
#include<sys/socket.h>
#include<fcntl.h>
#include<netpacket/packet.h>
#include<net/if.h>
#include<net/if_arp.h>
#include<netinet/in.h>
#include<netinet/ip.h>
#include<linux/if_ether.h>
#include<arpa/inet.h>
#include<sys/ioctl.h>
#include<unistd.h>
#define RED "\E[31m\E[1m"
#define GREEN "\E[32m\E[1m"
#define YELLOW "\E[33m\E[1m"
#define BLUE "\E[34m\E[1m"
#define NORMAL "\E[m"
int Get_IfaceIndex(int fd, const char* interfaceName)
{
struct ifreq ifr;
if (interfaceName == NULL)
{
return -1;
}
memset(&ifr, 0, sizeof(ifr));
strcpy(ifr.ifr_name, interfaceName);
if (ioctl(fd, SIOCGIFINDEX, &ifr) == -1)
{
printf("RED ioctl error\n");
return -1;
}
return ifr.ifr_ifindex;
}
int set_Iface_promisc(int fd, int dev_id)
{
struct packet_mreq mr;
memset(&mr,0,sizeof(mr));
mr.mr_ifindex = dev_id;
mr.mr_type = PACKET_MR_PROMISC;
if(setsockopt(fd, SOL_PACKET, PACKET_ADD_MEMBERSHIP,&mr,sizeof(mr))==-1)
{
fprintf(stderr,"GREEN set promisc failed! \n");
return -1;
}
return 0;
}
void usage(char *exename)
{
fprintf(stderr,RED"%s <interface> <packets num to capture>\n"NORMAL, exename);
}
int main(int argc, char **argv)
{
int listen_fd;
int ipak=0,maxk=0;
char buffer
[8192];
int frmlen;
struct sock
Ïà¹ØÎĵµ£º
Service Discovery Protocol(SDP)ÌṩһÖÖÄÜÁ¦£¬ÈÃÓ¦ÓóÌÐòÓз½·¨·¢ÏÖÄÄÖÖ·þÎñ¿ÉÓÃÒÔ¼°ÕâÖÖ·þÎñµÄÌØÐÔ¡£
·þÎñ·¢ÏÖÐÒé(SDP»òBluetooth SDP)ÔÚÀ¶ÑÀÐÒéÕ»ÖжÔÀ¶ÑÀ»·¾³ÖеÄÓ¦ÓóÌÐòÓÐÌØÊâµÄº¬Ò⣬·¢ÏÖÄĸö·þÎñÊÇ¿ÉÓõĺÍÈ·¶¨ÕâЩ¿ÉÓ÷þÎñµÄÌØÕ÷¡£SDP¶¨ÒåÁËbluetooth client·¢ÏÖ¿ÉÓÃbluetooth server·þÎñºÍËüÃǵÄÌØÕ÷µÄ·½·¨¡£ ......
Linux ´®¿Ú±à³ÌµÄһЩÎÊÌâ½â¾ö
LinuxÏ´®¿Ú±à³ÌµÄÎÄÕÂÍøÉÏÊÇÂúÌì·É£¬µ«´ó¶¼Êdzö×ÔһƪÎÄÕ£¬¶øÇÒдµÄ¶¼ÊÇЩ»ù±¾µÄ²Ù×÷£¬Ïñ¿ØÖÆRTS/CTSµÈ´®¿ÚÒý½Å״̬£¬½ÓÊÕ·¢ËͶþ½øÖÆÊý¾ÝµÈ£¬¶¼Ã»ÓкܺõÄ˵Ã÷£¬ÎÒÔÚʹÓÃÖÐÓöµ½ÁËЩÎÊÌ⣬д³öÀ´£¬Ï£ÍûÄܶԴó¼ÒÓÐËù°ïÖú£¬ÉÙ×ßÍä·£¬ºÇºÇ£¡
ÎÒʹÓõIJÙ×÷ϵͳÊÇRedhat9£¬gcc°æ±¾ÊÇ3.2.2
......
Dealing with Stopped Jobs Sometimes when you try to logout, you'll get a message saying there are "stopped jobs". These stopped jobs are programs or processes which have been suspended by a ^Z (Ctrl - Z) command. You have to either make the job active again, or get it running properly in the " ......
ѧϰlinuxÒ»Äê¶àÁË£¬»ù±¾¾ÍÊÇÒ»¸ö“ϹÕû££>³öÎÊÌ⣣>°Ù¶È/Google££>½â¾öÎÊÌ⣣>¼ÌÐøϹÕû"µÄÑ»·¡£ºÜ¸ÐлÍøÉÏÄÇô¶àÈ˶¼ÄÜ°Ñ×Ô¼ºµÄ¾Àú¡¢¾Ñé¸ú´ó¼Ò·ÖÏí£¬ËùÒÔÒ»Ö±¶¼ÓаÑ×Ô¼ºÅöµ½µÄÎÊÌâ¼°½â¾ö°ì·¨¸ú´ó¼Ò·ÖÏí£¬Ï£Íû¶Ô´ó¼ÒÄÜÓÐËù°ïÖú¡£
ºÃ£¬²»¶à·Ï»°ÁË¡ ......
²Ù×÷ϵͳÖУ¬Ç°Ì¨½ø³ÌºÍºǫ́½ø³ÌÓÐʲôÇø±ð£¿ÌØÕ÷ÊÇʲô£¿
ºǫ́³ÌÐò»ù±¾Éϲ»ºÍÓû§½»»¥£¬ÓÅÏȼ¶±ðÉÔ΢µÍÒ»µã
ǰ̨µÄ³ÌÐòºÍÓû§½»»¥£¬ÐèÒª½Ï¸ßµÄÏìÓ¦Ëٶȣ¬ÓÅÏȼ¶±ðÉÔ΢¸ßÒ»µã
Ö±½Ó´Óºǫ́ÊÖ¹¤Æô¶¯Ò»¸ö½ø³ÌÓõñȽÏÉÙһЩ£¬³ý·ÇÊǸýø³ÌÉõΪºÄʱ£¬ÇÒÓû§Ò²²»¼±×ÅÐèÒª½á¹ûµÄʱºò¡£¼ÙÉèÓû§ÒªÆô¶¯Ò»¸öÐèÒª³¤Ê±¼äÔËÐÐ ......