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

正文內(nèi)容

20xx年電大網(wǎng)絡(luò)編程技術(shù)試題答案小抄(編輯修改稿)

2024-12-09 16:08 本頁面
 

【文章內(nèi)容簡介】 ce address :::%s\n,i_ntoa())。 27. ip = (struct ip *)buffer。 /*See if this is a TCP packet*/ 28. if(ipip_protocol == 6) { 29. printf(IP header length :::%d\n,ipip_length)。 30. printf(Protocol :::%d\n,ipip_protocol)。 31. tcp = (struct tcp *)(buffer +( 4*ipip_length))。 32. printf(Source port :::%d\n,ntohs(tcptcp_source_port))。 33. printf(Dest port :::%d\n,ntohs(tcptcp_dest_port))。 34. } 35. } 專業(yè)好文檔 36.} 37 int Open_Raw_Socket() { 38. int sock。 39. if((sock = socket(AF_INET,SOCK_RAW,IPPROTO_TCP)) 0){ /*Then the socket was not created properly and must die*/ 40. perror(The raw socket was not created)。 41. exit(0)。 42. }。 43. return(sock); 44. } 45 int Set_Promisc(char *interface,int sock ) { 46. struct ifreq ifr。 47. strncpy(,interface,strnlen(interface)+1) 。 48. if((ioctl(sock,SIOCGIFFLAGS,amp。ifr) == 1) ) { /*Could not retrieve flags for the interface*/ 49. perror(Could not retrive flags for the interface)。 50. exit(0)。 51. } 52. printf(The interface is ::: %s\n,interface); 53. perror(Retrieved flags from interface successfully)。 54. |= IFF_PROMISC。 55. if (ioctl (sock,SIOCSIFFLAGS,amp。ifr) == 1 ) { /*Could not set the flags on the interface */ 56. perror(Could not set the PROMISC flag:)。 57. exit(0); 58. } 59. printf(Setting interface ::: %s ::: to promisc,interface)。 60. return(0)。 61. } /***********************EOF**********************************/ 上面這段程序中有很詳細(xì)的注解,不過我想還是有必要說一說,首先第 10 行 intOpen_Raw_Socket(void); 是我們的自定義函數(shù),具體內(nèi)容如下: 專業(yè)好文檔 37 int Open_Raw_Socket() { 38. int sock。 39. if((sock = socket(AF_INET,SOCK_RAW,IPPROTO_TCP)) 0){ /*Then the socket was not created properly and must die*/ 40. perror(The raw socket was not created)。 41. exit(0)。 42. }。 43. return(sock); 44. } 第 39行 if((sock = socket(AF_INET,SOCK_RAW,IPPROTO_TCP)) 0) { 這里我們調(diào)用了 socket 函數(shù),使創(chuàng)建了了一個原始 套接口 ,使之收到TCP/IP 信息包 。 接下來第 11行 int Set_Promisc(char *interface,intsock),這也是我們的自定義函數(shù),目的是把 網(wǎng)卡 置于混雜模式,具體內(nèi)容如下: 45 int Set_Promisc(char *interface,int sock ) { 46. struct ifreq ifr。 47. strncpy(,interface,strnlen(interface)+1) 。 48. if((ioctl(sock,SIOCGIFFLAGS,amp。ifr) == 1) ) { /*Could not retrieve flags for the interface*/ 49. perror(Could not retrive flags for the interface)。 50. exit(0)。 51. } 52. printf(The interface is ::: %s\n,interface); 53. perror(Retrieved flags from interface
點(diǎn)擊復(fù)制文檔內(nèi)容
試題試卷相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖片鄂ICP備17016276號-1