[ns] OTCL-Linkage

2006-08-08 Thread Jana Henniger

I’m new to ns-2 and C++ and need help concerning OTCL-Linkage.
I’ve created a new class ContextAgent which has AODV as friendclass. 
ContextAgent has two public variables that are bound to OTCL using the 
bind()-function (as it is used in the Example ex-linkage.cc from the tutorial 
“ns by example”). That works, as far as I could see.

My problem is, how can I call on the variables from the AODV-function 
sendRequest()?
Since the ContextAgent is created in the simulation script, I don’t know the 
name of it to assign it to an object of the type ContextAgent.

I send parts of my source code for better understanding. Please help!!

*

class ContextAgent : public Agent{

friend class AODV;

public:
ContextAgent();
int rq_context;
int rt_context;
}

//LinkObject
static class ContextAgentClass : public TclClass {
public:
ContextAgentClass() : TclClass(Agent/Context){}
TclObject* create(int, const char*const*) {
return (new ContextAgent());
}
} class_context_agent;

//Constructor
ContextAgent::ContextAgent() : Agent(PT_AODV) {
bind(rq_cxt_otcl, rq_context);
bind(rt_cxt_otcl, rt_context);
};

*

class AODV: public Agent {
 ...
private:
ContextAgent  *ContextAgentObject;
 ...
};

**

// call in AODV-function
void
AODV::sendRequest(nsaddr_t dst) {
 ...
ContextAgentObject = ;
rq-rq_cxt = ContextAgentObject-rq_context;
 ...
}

**

# tcl-code
 ...
set context1 [new Agent/Context]
$ns_ attach-agent $node_(1) $context1
$context1 set rq_cxt_otcl 0 
$context1 set rt_cxt_otcl 5 
 ...


-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

-- 


Feel free – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail



[ns] How to change routing protocol packet header field?

2006-08-18 Thread Jana Henniger

Hello all,

how can I change a field in the routing protocol packet header but only for one 
node.

I tried it with the help of an agent but don't know how to assign the value to 
the packet header, since they are two different objects.
I use AODV.

Has anyone an idea?!

jana
-- 


Feel free – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail



[ns] Access Agent List From C++

2006-08-21 Thread Jana Henniger

Is there a way to access the agent list from C++ ?
(AND GET ACCESS TO A PARTICULAR ONE?)
more explicit from AODV::sendRequest
-- 


Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen!
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer



[ns] Access to Agents

2006-08-24 Thread Jana Henniger

Hello,

is it possible in C++ to access the agents of a node 
when I have the node ID or rather the name of the nodeobejct(e.g. o_14)???
- Or to find out which Agents belong to my node?

jana
-- 


Echte DSL-Flatrate dauerhaft für 0,- Euro*. Nur noch kurze Zeit!
Feel free mit GMX DSL: http://www.gmx.net/de/go/dsl