LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 09-02-2015, 02:11 PM   #1
mariam33
LQ Newbie
 
Registered: Mar 2015
Posts: 6

Rep: Reputation: Disabled
help me with ns2 please


hello all
i am working on ns2.35 installed on ubuntu 14.04
i am implementing new manet protocol and just need to send the value of (number of node) from tcl to c++ .. so can any one help me with it please?
i tried this but not sure it true or not
Code:
#include <god.h>
God::instance()->nodes();
tcl scripts
Quote:
set god_ [create-god $opt(nn)]
for {set i 0} {$i < $opt(nn) }{incr i}
{
set node_($i)
[$ns_ node] $node_($i) random-motion 0 ;# disable random motion
$god_ new_node $node_($i) }
 
Old 09-02-2015, 03:00 PM   #2
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Files.cc are used for building ns2. Then never again.

These are the ns2 runtime files, used at simulation time :
ns-allinone-2.35/{ lib/*/*, bin/tcsh8* }
And the executable : /usr/local/bin/ns


-
 
Old 09-05-2015, 11:20 AM   #3
mariam33
LQ Newbie
 
Registered: Mar 2015
Posts: 6

Original Poster
Rep: Reputation: Disabled
Talking

knudfl
your answer is not clear please i asked about how to get access number of nodes from tcl to c++ ?!
 
Old 09-05-2015, 12:22 PM   #4
knudfl
LQ 5k Club
 
Registered: Jan 2008
Location: Copenhagen DK
Distribution: PCLinuxOS2023 Fedora38 + 50+ other Linux OS, for test only.
Posts: 17,511

Rep: Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641Reputation: 3641
Re #3.

Please elaborate / rephrase your question.

.. So far concerns the executable 'ns', there are no c++ files = files.cc .
All c++ functions, and tcl/lib/ns-***.tcl are compiled into 'ns'.
The only files that 'ns' will access / use are :
ns-allinone-2.35/{ lib/*/*, bin/tcsh8* }

.. Which actually means that all the c++ files can be deleted after the ns2 build.
.. Those files are never used again.


-
 
  


Reply

Tags
c++ compiler, ns2, tcl-ns2



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
after installing NS2 termina shows the message ns2 not installed profaditya Linux - Newbie 2 09-25-2014 02:15 PM
NS2: How to set idle(sleeping) time to a node in wireless network in ns2 pon Linux - Newbie 0 08-19-2014 06:45 PM
NS2: Require eap-sim authentication code for simulation in ns2.24 noamankhatib Linux - Software 0 04-29-2013 12:03 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 11:33 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration