cbrp_packet.h

来自「ns2.1b5版本中cbrp碼」· C头文件 代码 · 共 37 行

H
37
字号
/* 
   cbrp_packet.h
   Jinyang 6/9/99 modified from dmaltz' srpacket.h from DSR

*/

#ifndef _cbrp_packet_h_
#define _cbrp_packet_h_

#include <packet.h>
#include "hdr_cbrp.h"
#include "path.h"

struct CBRP_Packet {

  ID dest;
  ID src;
  Packet *pkt;   /* the inner NS packet */
  Path route;
  CBRP_Packet(Packet *p, struct hdr_cbrp *cbrph) : pkt(p) {
    if (cbrph->valid() && (cbrph->num_addrs() > 0)) {
       route.setLength(cbrph->num_addrs());
       for (int i=0;i<cbrph->num_addrs();i++) {
          route[i] = ID(cbrph->addrs[i]);
       }
       if (cbrph->cur_addr()>=0) {
         route.setIterator(cbrph->cur_addr());
       }
    }else {
       route.reset();
    }
  }
  CBRP_Packet() : pkt(NULL) {}
};

#endif  _cbrp_packet_h_

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?