亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? path.cc

?? ns2.1b5版本中cbrp碼
?? CC
字號:
/* path.cc   handles source routes   $Id: path.cc,v 1.7 1998/05/13 16:17:51 dmaltz Exp $*/extern "C" {#include <assert.h>#include <stdio.h>}#include <packet.h>#include <ip.h>#include <cmu/dsr/hdr_sr.h>#include "path.h"/*===========================================================================  global statics---------------------------------------------------------------------------*/ID invalid_addr(0xffffffff,::NONE);ID IP_broadcast(IP_BROADCAST,::IP);/*===========================================================================  ID methods---------------------------------------------------------------------------*/voidID::unparse(FILE *out) const{  fprintf(out,"%d",(int) addr);}char *ID::dump() const{  static char buf[MAX_SR_LEN+1][50];  static int which = 0;  char *ptr = buf[which];  which = (which + 1) % (MAX_SR_LEN+1);  assert(type == ::NONE || type == ::MAC || type == ::IP);  if (type == ::IP)    sprintf(ptr,"%d",(int) addr);  else if (type == ::NONE)    sprintf(ptr,"NONE");  else    sprintf(ptr,"0x%x",(int) addr);  return ptr;}/*===========================================================================  Path methods---------------------------------------------------------------------------*//* rep invariants:   -1 <= cur_index <= len  (neither bound is really hard)   0 <= len < MAX_SR_LEN*/Path::Path(int route_len, const ID *route){  path = new ID[MAX_SR_LEN];  assert(route_len <= MAX_SR_LEN);  //  route_len = (route == NULL : 0 ? route_len);   // a more cute solution, follow the above with the then clause  if (route != NULL)    {      for (int c = 0; c < route_len; c++)        {	  path[c] = route[c];        }      len = route_len;    }  else    {      len = 0;    }  cur_index = 0;}Path::Path(){  path = new ID[MAX_SR_LEN];  len = 0;  cur_index = 0;}Path::Path(const struct sr_addr *addrs, int len){ /* make a path from the bits of an NS source route header */  assert(len <= MAX_SR_LEN);  path = new ID[MAX_SR_LEN];  for (int i = 0 ; i < len ; i++)    path[i] = ID(addrs[i]);  this->len = len;  cur_index = 0;}Path::Path(const struct hdr_sr *srh){ /* make a path from the bits of an NS source route header */  path = new ID[MAX_SR_LEN];  if (!srh->valid_)    {      len = 0;      cur_index = 0;      return;    }  len = srh->num_addrs_;  cur_index = srh->cur_addr_;  assert(len <= MAX_SR_LEN);  for (int i = 0 ; i < len ; i++)    path[i] = ID(srh->addrs[i]);}voidPath::fillSR(struct hdr_sr *srh){  for (int i = 0 ; i < len ; i++)    {      path[i].fillSRAddr(srh->addrs[i]);    }  srh->num_addrs() = len;  srh->cur_addr() = cur_index;}Path::Path(const Path& old){  path = new ID[MAX_SR_LEN];  if (old.path != NULL)    {      for (int c = 0; c < old.len; c++)	path[c] = old.path[c];      len = old.len;    }  else    {      len = 0;    }  cur_index = old.cur_index;  path_owner = old.path_owner;}Path::~Path(){  delete[] path;}voidPath::operator=(const Path &rhs)     // makes the lhs a copy of the rhs: lhs may share data with     // the rhs such that changes to one will be seen by the other     // use the provided copy operation if you don't want this.{/* OLD  NOTE:  we save copying the path by doing a delete[] path; path = rhs.path;   but then the following code will be fatal (it calls delete[]   twice on the same address)     { Path p1();       { Path p2();         p2 = p1;       }     }   you'd have to implement reference counts on the path array to   save copying the path.   NEW NOTE: we just copy like everything else*/  if (this != &rhs)    {// beware of path = path (see Stroustrup p. 238)      cur_index = rhs.cur_index;      path_owner = rhs.path_owner;      len = rhs.len;      for (int c = 0 ; c < len ; c++)	path[c] = rhs.path[c];    }  // note: i don't return *this cause I don't think assignments should  // be expressions (and it has slightly incorrect semantics: (a=b) should  // have the value of b, not the new value of a)}boolPath::operator==(const Path &rhs){  int c;  if (len != rhs.len) return false;  for (c = 0; c < len; c++)    if (path[c] != rhs.path[c]) return false;  return true;} void Path::appendPath(Path& p){  int i;  for (i = 0; i < p.length() ; i++)    {      path[len] = p[i];      len++;      if (len > MAX_SR_LEN)	{	  fprintf(stderr,"DFU: overflow in appendPath len2 %d\n",		  p.length());	  len--;	  return;	}    }}void Path::removeSection(int from, int to)  // the elements at indices from -> to-1 are removed from the path{  int i,j;  if (to <= from) return;  if (cur_index > from) cur_index = cur_index - (to - from);  for (i = to, j = 0; i < len ; i++, j++)    path[from + j] = path[i];  len = from + j;}PathPath::copy() const{  Path p(len,path);  p.cur_index = cur_index;  p.path_owner = path_owner;  return p;}voidPath::copyInto(Path& to) const{  to.cur_index = cur_index;  to.len = len;  for (int c = 0 ; c < len ; c++)    to.path[c] = path[c];    to.path_owner = path_owner;}PathPath::reverse() const     // return an identical path with the index pointing to the same     // host, but the path in reverse order{  if (len == 0) return *this;  Path p;  int from, to;  for (from = 0, to = (len-1) ; from < len ; from++,to--)    p.path[to] = path[from];  p.len = len;  p.cur_index = (len - 1) - cur_index;  return p;}voidPath::reverseInPlace(){  if (len == 0) return;  int fp,bp;	   // forward ptr, back ptr  ID temp;  for (fp = 0, bp = (len-1) ; fp < bp ; fp++, bp--)    {      temp = path[fp];      path[fp] = path[bp];      path[bp] = temp;    }  cur_index = (len - 1) - cur_index;}intPath::size() const{  // this should be more clever and ask the id's what their sizes are.  return len*4;}boolPath::member(const ID& id) const// rtn true iff id is in path{  return member(id, invalid_addr);  }boolPath::member(const ID& id, const ID& MAC_id) const// rtn true iff id or MAC_id is in path{  for (int c = 0; c < len ; c++)    if (path[c] == id || path[c] == MAC_id)      return true;  return false;}voidPath::unparse(FILE *out) const{  // change to put ()'s around the cur_index entry?  if (len==0)    {      fprintf(out,"<empty path>");      return;    }  for (int c = 0 ; c < len-1 ; c ++)    {      if (c == cur_index) fprintf(out,"(");      path[c].unparse(out);      if (c == cur_index) fprintf(out,")");      fprintf(out,",");    }  if (len-1 == cur_index) fprintf(out,"(");  path[len-1].unparse(out);  if (len-1 == cur_index) fprintf(out,")");}char *Path::dump() const{  static which = 0;  static char buf[4][100];  char *ptr = buf[which];  char *rtn_buf = ptr;  which = (which + 1) % 4;    if (len == 0)    {      sprintf(rtn_buf,"[<empty path>]");      return rtn_buf;    }  *ptr++ = '[';  for (int c = 0 ; c < len ; c ++)    {      if (c == cur_index) *ptr++ = '(';      ptr += sprintf(ptr,"%s%s ",path[c].dump(), c == cur_index ? ")" : "");    }  *ptr++ = ']';  *ptr++ = '\0';  return rtn_buf;}voidcompressPath(Path &path)// take a path and remove any double backs from it// eg:  A B C B D --> A B D{  // idea: walk one pointer from begining  //  for each elt1 start at end of path and walk a pointer backwards (elt2)  //   if forward pointer = backward pointer, go on and walk foward one more  //   if elt1 = elt2 then append {(elt2 + 1) to end} after forward pointer  //    update length of path (we just cut out a loopback) and walk forward  //  when forward walking pointer reaches end of path we're done  int fp = 0, bp; // the forward walking ptr and the back walking ptr  while (fp < path.len)    {      for (bp = path.len - 1; bp != fp; bp--)	{	  if (path.path[fp] == path.path[bp])	    { int from, to;	      for (from = bp, to = fp;		   from < path.len ;		   from++, to++)		path.path[to] = path.path[from];	      path.len = to;	      break;	    } // end of removing double back	} // end of scaning to check for double back      fp++; // advance the forward moving pointer    }}void CopyIntoPath(Path& to, const Path& from, int start, int stop)// sets to[0->(stop-start)] = from[start->stop]{  assert(start >= 0 && stop < from.len);  int f, t,c ;			// from and to indices  for(f = start, t = 0; f <= stop; f++, t++)    to.path[t] = from.path[f];  if (to.len < stop - start + 1) to.len = stop - start + 1;  for (c = to.len - 1; c >= 0; c--)    {      if (to.path[c] == to.owner()) break;      if (to.path[c] == ((Path &)from).owner()) 	{	  to.owner() = ((Path &)from).owner();	  break;	}    } }voidPath::checkpath() const{  for(int c = 0; c < MAX_SR_LEN; c++)    {           assert(path[c].type == NONE ||             path[c].type == MAC ||             path[c].type == IP);    }}

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美日韩三级一区| 色综合久久综合中文综合网| 久久99精品国产麻豆婷婷 | 亚洲人成影院在线观看| 午夜在线成人av| 成a人片亚洲日本久久| 91精品国产综合久久久久久漫画 | 欧美极品少妇xxxxⅹ高跟鞋| 亚洲一区二区三区自拍| 成人av在线资源网站| 日韩欧美一级二级三级| 亚洲午夜三级在线| 91香蕉国产在线观看软件| 2023国产精华国产精品| 日韩一区二区视频在线观看| 亚洲三级在线观看| 粉嫩嫩av羞羞动漫久久久| 日韩欧美国产系列| 视频一区二区不卡| 欧美区一区二区三区| 亚瑟在线精品视频| 不卡av免费在线观看| 久久精品一区二区三区四区| 麻豆成人91精品二区三区| 欧美另类高清zo欧美| 亚洲国产成人高清精品| 91高清视频免费看| 夜夜精品视频一区二区 | 亚洲国产激情av| 久久精品免费观看| 日韩欧美国产综合| 久久精品噜噜噜成人av农村| 日韩欧美的一区| 青青草精品视频| 欧美电视剧在线看免费| 日韩手机在线导航| 亚洲午夜电影在线观看| 欧洲另类一二三四区| 一区二区日韩av| 欧美亚洲尤物久久| 亚洲国产一区二区三区| 欧美精品在线一区二区| 日韩av中文字幕一区二区| 欧美一区二区三区免费在线看| 日韩av一区二| 久久久青草青青国产亚洲免观| 国产美女在线观看一区| 久久伊99综合婷婷久久伊| 国产精品69久久久久水密桃| 国产精品美女久久久久久 | 91丝袜国产在线播放| 亚洲免费在线视频一区 二区| 欧美性猛交xxxx乱大交退制版| 日韩国产欧美在线观看| 欧美xxxx老人做受| 久久久www成人免费毛片麻豆| 麻豆精品一区二区| 久久久综合视频| 97久久精品人人做人人爽50路| 亚洲老司机在线| 欧美一区二区三区色| 国产精品一区不卡| 亚洲综合视频在线观看| 欧美大片免费久久精品三p| 国产精品一卡二卡| 亚洲永久精品国产| 久久女同互慰一区二区三区| 91片在线免费观看| 免费av成人在线| 中文字幕在线不卡一区| 制服.丝袜.亚洲.中文.综合| 国产suv精品一区二区883| 一区二区高清免费观看影视大全| 777午夜精品视频在线播放| 国产高清精品久久久久| 亚洲一区二区三区自拍| 久久久精品欧美丰满| 色一区在线观看| 国产精品综合网| 午夜天堂影视香蕉久久| 中文字幕 久热精品 视频在线| 欧美日韩一级片网站| 不卡的av电影在线观看| 久久激五月天综合精品| 亚洲午夜久久久久久久久久久| 久久午夜电影网| 6080午夜不卡| 色菇凉天天综合网| 成人午夜电影久久影院| 青草av.久久免费一区| 亚洲综合色成人| 国产精品亲子乱子伦xxxx裸| 日韩欧美国产一区二区三区| 欧美日韩综合不卡| aa级大片欧美| 成人深夜福利app| 国产一区二区剧情av在线| 亚洲地区一二三色| 一级特黄大欧美久久久| 国产精品久久看| 国产网站一区二区三区| 欧美sm美女调教| 67194成人在线观看| 欧美日韩一区 二区 三区 久久精品| 成人黄色小视频在线观看| 国产精品亚洲视频| 国产综合色在线| 韩国中文字幕2020精品| 奇米一区二区三区| 日韩成人一级片| 日本sm残虐另类| 欧美96一区二区免费视频| 五月天视频一区| 日韩国产欧美在线播放| 日韩国产成人精品| 免费观看30秒视频久久| 免费在线观看一区| 美女视频黄久久| 黄色小说综合网站| 国产成人免费在线| 成人一区二区三区视频在线观看| 高清在线不卡av| av一区二区不卡| 色综合一个色综合亚洲| 成人黄色国产精品网站大全在线免费观看 | 欧美日韩久久久| 337p亚洲精品色噜噜| 欧美一区二区三区白人| 欧美tickling网站挠脚心| 久久综合久久鬼色中文字| 久久精品一二三| 亚洲视频综合在线| 亚洲一区二区三区国产| 日日夜夜一区二区| 国产在线麻豆精品观看| 成人18视频在线播放| 91精品办公室少妇高潮对白| 欧美日韩国产乱码电影| 日韩精品专区在线影院观看| 久久久91精品国产一区二区精品| 国产精品成人一区二区三区夜夜夜| 亚洲天堂2016| 免费欧美高清视频| 国产成人精品网址| 91成人在线免费观看| 欧美一区二区三区在线视频| 国产无人区一区二区三区| 悠悠色在线精品| 激情av综合网| 在线免费视频一区二区| 精品国产电影一区二区| 自拍av一区二区三区| 日本中文字幕一区二区视频| 成人午夜免费视频| 欧美精品第1页| 国产校园另类小说区| 亚洲综合色婷婷| 国产成人啪免费观看软件| 欧美日韩三级视频| 国产精品嫩草99a| 秋霞电影一区二区| 一本久道中文字幕精品亚洲嫩 | 蜜桃视频一区二区三区在线观看| 成人免费黄色大片| 日韩一级成人av| 亚洲狠狠丁香婷婷综合久久久| 久久国产精品色婷婷| 一本久久精品一区二区| 国产农村妇女精品| 男男视频亚洲欧美| 精品视频在线免费| 国产精品久久久久四虎| 激情成人午夜视频| 5月丁香婷婷综合| 一区二区三区在线视频观看| 国产精品18久久久久久vr| 欧美日韩亚洲另类| 国产三级久久久| 精品一区二区三区免费观看| 欧美性做爰猛烈叫床潮| 国产精品久久久久9999吃药| 久久精品国产77777蜜臀| 欧美群妇大交群的观看方式| 亚洲免费观看高清完整版在线观看| 国产麻豆9l精品三级站| 欧美不卡在线视频| 视频一区二区三区中文字幕| 91久久精品日日躁夜夜躁欧美| 欧美激情一区三区| 国产成人福利片| 精品国产一区二区三区不卡 | 欧美一区二区三区成人| 午夜视频在线观看一区二区三区| 日本高清免费不卡视频| 亚洲免费成人av| 色香蕉成人二区免费| 亚洲男人天堂av| 91网页版在线| 亚洲精品第1页| 91久久精品国产91性色tv|