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

正文內容

基于winpcap的嗅探器設計與實現(xiàn)_畢業(yè)設計(編輯修改稿)

2024-08-15 08:05 本頁面
 

【文章內容簡介】 le, amp。header, amp。pkt_data)) = 0) { if(res == 0) //超時 continue。 struct datapkt *data = (struct datapkt*)malloc(sizeof(struct datapkt))。 memset(data,0,sizeof(struct datapkt))。 if(NULL == data) { MessageBox(NULL,_T(空間已滿,無法接收新的數(shù)據(jù)包),_T(Error),MB_OK)。 return 1。 } //分析出錯或所接收數(shù)據(jù)包不在處理范圍內 if(analyze_frame(pkt_data,data,amp。(pthisnpacket))0) continue。 //將數(shù)據(jù)包保存到打開的文件中 if(pthisdumpfile!=NULL) { pcap_dump((unsigned char*)pthisdumpfile,header,pkt_data)。 } //更新各類數(shù)據(jù)包計數(shù) pthissniffer_updateNPacket()。 //將本地化后的數(shù)據(jù)裝入一個鏈表中,以便后來使用 ppkt_data = (u_char*)malloc(headerlen)。 memcpy(ppkt_data,pkt_data,headerlen)。 pthis(data)。 pthis(ppkt_data)。 /*預處理,獲得時間、長度 */ datalen = headerlen。 //鏈路中收到的數(shù)據(jù)長度 local_tv_sec = header。 ltime = localtime(amp。local_tv_sec)。 datatime[0] = ltimetm_year+1900。 datatime[1] = ltimetm_mon+1。 datatime[2] = ltimetm_mday。 datatime[3] = ltimetm_hour。 datatime[4] = ltimetm_min。 datatime[5] = ltimetm_sec。 /*為新接收到的數(shù)據(jù)包在 listControl中新建一個 item*/ (_T(%d),pthisnpkt)。 nItem = pthis(pthisnpkt,buf)。 /*顯示時間戳 */ (_T(%d/%d/%d %d:%d:%d),datatime[0], datatime[1],datatime[2],datatime[3],datatime[4],datatime[5])。 pthis(nItem,1,timestr)。 /*顯示長度 */ ()。 (_T(%d),datalen)。 pthis(nItem,2,buf)。 /*顯示源 MAC*/ ()。 (_T(%02X%02X%02X%02X%02X%02X),dataethhsrc[0],dataethhsrc[1], dataethhsrc[2],dataethhsrc[3],dataethhsrc[4],dataethhsrc[5])。 pthis(nItem,3,buf)。 /*顯示目的 MAC*/ ()。 (_T(%02X%02X%02X%02X%02X%02X),dataethhdest[0],dataethhdest[1], dataethhdest[2],dataethhdest[3],dataethhdest[4],dataethhdest[5])。 pthis(nItem,4,buf)。 /*獲得協(xié)議 */ pthis(nItem,5,CString(datapktType))。 /*獲得源 IP*/ ()。 if(0x0806== dataethhtype) { (_T(%d.%d.%d.%d),dataarphar_srcip[0], dataarphar_srcip[1],dataarphar_srcip[2],dataarphar_srcip[3])。 }else if(0x0800 == dataethhtype) { struct in_addr in。 = dataiphsaddr。 buf = CString(i_ntoa(in))。 }else if(0x86dd ==dataethhtype ){ int n。 for(n=0。n8。n++) { if(n=6) (_T(%02x:),dataiph6saddr[n])。 else (_T(%02x),dataiph6saddr[n])。 } } pthis(nItem,6,buf)。 /*獲得目的 IP*/ ()。 if(0x0806 == dataethhtype) { (_T(%d.%d.%d.%d),dataarphar_destip[0], dataarphar_destip[1],dataarphar_destip[2],dataarphar_destip[3])。 }else if(0x0800 == dataethhtype){ struct in_addr in。 = dataiphdaddr。 buf = CString(i_ntoa(in))。 }else if(0x86dd ==dataethhtype ){ int n。 for(n=0。n8。n++) { if(n=6) (_T(%02x:),dataiph6daddr[n])。 else (_T(%02x),dataiph6daddr[n])。 } } pthis(nItem,7,buf)。 /*對包計數(shù) */ pthisnpkt++。 } return 1。 } 數(shù)據(jù)解析函數(shù) /*分析鏈路層 */ int analyze_frame(const u_char * pkt,struct datapkt * data,struct pktcount *npacket) { int i。 struct ethhdr *ethh = (struct ethhdr*)pkt。 dataethh = (struct ethhdr*)malloc(sizeof(struct ethhdr))。 if(NULL == dataethh) return 1。 for(i=0。i6。i++) { dataethhdest[i] = ethhdest[i]。 dataethhsrc[i] = ethhsrc[i]。 } npacketn_sum++。 dataethhtype = ntohs(ethhtype)。 //處理 ARP還是 IP包? switch(datae
點擊復制文檔內容
研究報告相關推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1