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

正文內(nèi)容

網(wǎng)絡(luò)課程設(shè)計(jì)報(bào)告ip地址的合法性及子網(wǎng)判斷-預(yù)覽頁

2025-08-14 12:10 上一頁面

下一頁面
 

【正文】 我收獲了很多東西。清華大學(xué)出版社,2006,11。 //用于存放ip地址 char subnet_mask[18]。 //用于存放mask(1的個(gè)數(shù)) bool maskIsValid。 //判斷ip是否合法 bool subnetIsValid(char *)。 //判斷mask,subnet,ip的合法性問題 void print()。//把二進(jìn)制int型數(shù)據(jù)轉(zhuǎn)換為一個(gè)整體的二進(jìn)制字符型數(shù)據(jù)}。//argv[2]表示第三個(gè)參數(shù),即ip //判斷段數(shù)是否輸入合法 if(argc!=3) //argc表示輸入的參數(shù)個(gè)數(shù),無參數(shù)輸入時(shí),其值為,因?yàn)槟J(rèn)argv[0]總是有的 { cout輸入非法!。 return 0。 } } ipTest test(argv[1],argv[2])。 }//構(gòu)造函數(shù)中國計(jì)量學(xué)院現(xiàn)代科技學(xué)院課程設(shè)計(jì)報(bào)告 ipTest::ipTest(char *subnet_mask,char *ip){ maskIsValid=true。 /*******************從subnet/mask中分離出subnet地址***************/ for(i=0。/39。\039。amp。 //mask不是數(shù)值,則設(shè)置為false } } else if((len3)==i) //表明mask是二位 { temp[0]=subnet_mask[i+1]。 isdigit(temp[1]))) { coutmask中含有非數(shù)字的非法字符,error!endl。 } else //表明mask為空或字節(jié)超出范圍 { coutmask為空或超出范圍,error!endl。 //給ip賦值 strcpy(thisip_Temp,ip)。 coutendl。 } else { coutmask與subnet匹配!endl。中國計(jì)量學(xué)院現(xiàn)代科技學(xué)院課程設(shè)計(jì)報(bào)告 } else { coutip地址合法!endl。amp。 }}//判斷mask與subnet是否匹配bool ipTest::maskIsMatSubnet(int mask,char *subnet_Temp){ int nbsubnet[4]。 nbsubnet[0]127 amp。 } //subnet是B類地址 if(nbsubnet[0]=128 amp。 mask16) { //mask的值小于 coutmask與subnet不匹配,error!endl。 nbsubnet[0]=223 amp。 } //mask與subnet地址匹配 return true。 token=strtok(chaddr,ch)。 token=strtok(NULL,ch)。i++) { if(ch[i]39。0) { return false。 strcpy(ip_one,ip)。 while(token!=NULL) { dot[iplen]=token。 return false。j++) { if(ip[j]==39。.39。 for(i=0。 return false。i++) { if(atoi(dot[i])!=0) { //含有非的字段 flag=0。//首先設(shè)置為非法,即全 for(i=0。 return false。atoi(dot[0])127) //A類ip地址 { j1=1。 } if(atoi(dot[0])=128amp。 }中國計(jì)量學(xué)院現(xiàn)代科技學(xué)院課程設(shè)計(jì)報(bào)告 if(atoi(dot[0])=192amp。 } if(atoi(dot[0])223amp。 } if(atoi(dot[0])==255) { coutip地址ip網(wǎng)絡(luò)號(hào)全為1,error!endl。//首先設(shè)置為非法,即主機(jī)號(hào)全 for(i=j1。//首先設(shè)置為非法,即全 for(i=j2。 return false。}//判斷ip是否為子網(wǎng)成員,并輸出判斷結(jié)果void ipTest::print(){ char subnet_one[15],ip_one[15]。 //把ipt地址復(fù)制給ip_one //split()函數(shù)把字符型的地址轉(zhuǎn)換為四段int型的地址 split(subnet_one,nbsubnet)。i++) { nbip[i]=toBinary(nbip[i])。 cbip=toString(nbip)。i++) { if(cbip[i]!=cbsubnet[i]) { coutendlIP地址:ip不屬于subnet這一子網(wǎng)endl。 //system(pause)。 int i。i4。//a[i]/100000%10為每段的高第三位二進(jìn)制整數(shù) itoa(a[i]/10000%10,five,10)。 itoa(a[i]%10,one,10)。 } strcat(temp,seven)。 strcat(temp,three)。}課程設(shè)計(jì)報(bào)告評(píng)語指導(dǎo)教師意見: 成績?cè)u(píng)定: 指導(dǎo)教師: 年 月 日24
點(diǎn)擊復(fù)制文檔內(nèi)容
環(huán)評(píng)公示相關(guān)推薦
文庫吧 www.dybbs8.com
備案圖鄂ICP備17016276號(hào)-1