⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 node.cc.diffs

📁 it is very important
💻 DIFFS
字号:
*** node.cc.orig	Mon Nov  6 12:38:11 2000--- node.cc	Mon Nov  6 09:59:27 2000****************** 41,46 ****--- 41,48 ----  #include <stdarg.h>    #include "address.h"+ // Addition for Nix-Vector routing+ #define USE_NIXNODES  #include "node.h"    static class LinkHeadClass : public TclClass {****************** 95,107 ****--- 97,126 ----    char Node::nwrk_[NODE_NAMLOG_BUFSZ];  + /* Additions for NixRouting */+ int NixRoutingUsed = -1;+   Node::Node() :   	address_(-1), nodeid_ (-1), namChan_(0),+ 	/* Additions for NixRouting */+ 	nixnode_(NULL),  	energy_model_(NULL), location_(NULL)  {  	LIST_INIT(&ifhead_);  	LIST_INIT(&linklisthead_);  	insert(&(Node::nodehead_)); // insert self into static list of nodes+ 	// Mods for Nix-Vector routing+ 	if (NixRoutingUsed < 0)	{+ 		// Find out if nix routing is in use+ 		Tcl& tcl = Tcl::instance();+ 		tcl.evalf("Simulator set nix-routing");+ 		tcl.resultAs(&NixRoutingUsed);+ 	}+ 	if (NixRoutingUsed) {+ 		// Create the NixNode pointer+ 		if(0)printf("Nix routing in use, creating NixNode\n");+ 		nixnode_ = new NixNode();+ 	}  }    Node::~Node()****************** 114,127 ****--- 133,171 ----  {  	Tcl& tcl = Tcl::instance();  	if (argc == 2) {+ 		// Mods for Nix-Vector Routing+ 		if(strcmp(argv[1], "populate-objects") == 0) {+ 			if (nixnode_) {+ 				nixnode_->PopulateObjects();+ 			}+ 			return TCL_OK;+ 		}+ 		// End mods for Nix-Vector routing  		if(strcmp(argv[1], "address?") == 0) {  			tcl.resultf("%d", address_);   			return TCL_OK;  		}  	} else if (argc == 3) {+ 		// Mods for Nix-Vector Routing+ 		if (strcmp(argv[1], "get-nix-vector") == 0) {+ 			if (nixnode_) {+ 				nixnode_->GetNixVector(atol(argv[2]));+ 			}+ 			return TCL_OK;+ 		}+ 		if (strcmp(argv[1], "set-neighbor") == 0) {+ 			if (nixnode_) {+ 				nixnode_->AddAdj(atol(argv[2]));+ 			}+ 			return(TCL_OK);+ 		}  		if (strcmp(argv[1], "addr") == 0) {  			address_ = Address::instance().str2addr(argv[2]);+ 			if (nixnode_) {+ 				nixnode_->Id(address_);+ 			}  			return TCL_OK;+ 		// End mods for Nix-Vector routing  		} else if (strcmp(argv[1], "nodeid") == 0) {  			nodeid_ = atoi(argv[2]);  			return TCL_OK;

⌨️ 快捷键说明

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