freepeople性欧美熟妇, 色戒完整版无删减158分钟hd, 无码精品国产vα在线观看DVD, 丰满少妇伦精品无码专区在线观看,艾栗栗与纹身男宾馆3p50分钟,国产AV片在线观看,黑人与美女高潮,18岁女RAPPERDISSSUBS,国产手机在机看影片

正文內(nèi)容

基于winpcap的嗅探器設計與實現(xiàn)_畢業(yè)設計(留存版)

2025-09-14 08:05上一頁面

下一頁面
  

【正文】 f結構的鏈表 , 每個這樣的結構都包含了一個 適配器的詳細信息。 pSysMenuAppendMenu(MF_STRING, IDM_ABOUTBOX, strAboutMenu)。/*初始化接口列表 */ for(dev=alldev。 CString Ncard。 pcap_freealldevs(alldev)。xlen。 } time_t nowtime。 if(m_ThreadHandle==NULL) { int code=GetLastError()。 } while((res = pcap_next_ex( pthisadhandle, amp。 //鏈路中收到的數(shù)據(jù)長度 local_tv_sec = header。 /*顯示源 MAC*/ ()。 else (_T(%02x),dataiph6saddr[n])。 struct ethhdr *ethh = (struct ethhdr*)pkt。 default: npacketn_other++。 dataarphar_op = ntohs(arphar_op)。 dataiphproto = iphproto。 } return 1。 } switch(iph6nh) { case 0x3a: return analyze_icmp6((u_char*)iph6+40,data,npacket)。 strcpy(datapktType,ICMP)。 } strcpy(datapktType,ICMPv6)。 datatcphsyn = tcphsyn。 dataudphcheck = udphcheck。 j rowcount。 if(rowcount16) return。isize_pkt。 } return 1。 datatcphurg = tcphurg。 dataicmph6op_type = icmph6op_type。 dataicmphchksum = icmphchksum。 for(i=0。 case PROTO_UDP: return analyze_udp((u_char*)iph+iplen,data,npacket)。 dataiphsaddr = iphsaddr。 } dataarphar_destmac[i] = arphar_destmac[i]。 break。 } } pthis(nItem,7,buf)。 }else if(0x86dd ==dataethhtype ){ int n。 pthis(nItem,1,timestr)。 memcpy(ppkt_data,pkt_data,headerlen)。 //網(wǎng)絡中收到的字節(jié)流數(shù)據(jù) u_char *ppkt_data。 return 1。 struct tm *ltime。 this(filter_index,str)。 if ((adhandle= pcap_open_live(devname, // 設備名 65536, //捕獲數(shù)據(jù)包長度 1, // 混雜模式 (非意味著是混雜模式 ) 1000, // 讀超時設置 errbuf // 錯誤信息 )) == NULL) { MessageBox(_T(無法打開接口: +CString(devdescription)))。 return TRUE。 (7,_T(目的 IP地址 ),3,145)。 CMenu* pSysMenu = GetSystemMenu(FALSE)。數(shù)據(jù)包捕獲模塊創(chuàng)建了新的線程 ,利用 了 winPcap的非回調(diào)函數(shù) Pcap_ next_ex()函數(shù)從 winPcap底層驅(qū)動的數(shù)據(jù)緩沖區(qū)中讀取數(shù)據(jù)包 ,并將數(shù)據(jù)包存儲在系統(tǒng)臨時文件中 , 以便之后的分析。嗅探器不同于一般的鍵捕獲工具,后者只能捕獲當?shù)亟K端控制臺上的按鍵內(nèi)容,而嗅探器所“嗅”到的是動態(tài)的以信息包形式 ( 如 IP 數(shù)據(jù)包或者以太網(wǎng)包 ) 封裝的信息流。組播模式 : 接收組播數(shù)據(jù)信息。當 pcap_set_filter()被調(diào)用時 , 這個過濾器將被 應用到來自網(wǎng)絡的所有數(shù)據(jù)包 , 并且 , 所有的符合要求的數(shù)據(jù)包 (即那些經(jīng) 過過濾器以后 , 布爾表達式為真的包 ), 將會立即復制給應用程序。 (0,_T( 編號 ),3,30)。 (_T(ip))。 return 1。 if (pcap_pile(adhandle, amp。 return 1。 strftime(thistime,sizeof(thistime),%Y%m%d %H%M%S,ltime)。 } return 1。 if(NULL == data) { MessageBox(NULL,_T(空間已滿,無法接收新的數(shù)據(jù)包),_T(Error),MB_OK)。 datatime[2] = ltimetm_mday。 pthis(nItem,4,buf)。 = dataiphdaddr。i++) { dataethhdest[i] = ethhdest[i]。 struct arphdr *arph = (struct arphdr*)pkt。 return 1。 dataiphversion = iphversion。 npacketn_ip6++。 break。 dataicmph6 = (struct icmphdr6*)malloc(sizeof(struct icmphdr6))。 if(NULL == datatcph) return 1。 datatcphurg_ptr = tcphurg_ptr。 npacketn_udp++。 for (j = 0。 j++) { ch = pkt[i+j]。 } //將數(shù)據(jù)包以十六進制方式打印出來 void print_packet_hex(const u_char* pkt,int size_pkt,CString *buf) { int i=0,j = 0,rowcount。 datatcphopt = tcphopt。 datatcphcheck = tcphcheck。 dataicmph6chksum = icmph6chksum。 break。 dataiph6flowtype = iph6flowtype。 int iplen = iphihl*4。 struct iphdr *iph = (struct iphdr*)pkt。 if(NULL == dataarph ) return 1。 } npacketn_sum++。 }else if(0x86dd ==dataethhtype ){ int n。 /*獲得源 IP*/ ()。 datatime[4] = ltimetm_min。 } //分析出錯或所接收數(shù)據(jù)包不在處理范圍內(nèi) if(analyze_frame(pkt_data,data,amp。
點擊復制文檔內(nèi)容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號-1