On Nov 15, 6:29 am, Tom Henderson wrote:
> Have you looked at set_var() in sim_interface.h?
set_var seems actually a good way to change those variables.
As of now, though, I'm focusing on get_var(), basically because it's
already implemented (differently from set_var()).
So far I've understood that:
- get_var() and set_var() are virtual methods of the INetStack struct
- the LinuxStack class (<nsc>/<linux>/nsc/sim_support.cpp) inherits
from INetStack and redefines get_var()
- LinuxStack::get_var() calls nsc_get_tcp_var() passing also the
pointer to a TCP socket as an argument (and if I got it right, this
also means there's a 1:1 mapping between LinuxStack objects and TCP
sockets)
- nsc_get_tcp_var() (<nsc>/<linux>/nsc/support.c) can potentially get
hold of all the variables that belong to the tcp_sock struct (<nsc>/
<linux>/include/linux/tcp.h) but probably not (or, at least, not
straightforwardly) of the variables defined in a "particular TCP
version" (e.g., cubic, vegas, etc.), which instead are common for *all
the sockets*.
The question is:
how can I get hold of LinuxStack?
Since it doesn't inherit from the ns3::Object class, I cannot call
GetObject<>(). Besides, since there seems to be a LinuxStack for each
TCP socket, I couldn't probably do that anyway (but here things start
to get hazy for me, so I may be completely wrong).
The fact that get_var() can apparently be used to reach the parameters
of each single socket, but not the parameters common to all the
sockets opens another question:
is there a way to reach such variables (e.g., those in cubic_tcp.c
but also in <nsc>/<linux>/include/net/tcp.h)?
(sysctl has been ruled out, because it cannot be used for dynamic
reconfiguration:
http://groups.google.com/group/ns-3-users/tree/browse_frm/thread/812ff82c4a76a43f/fa77f4d8842624f9?rnum=1&_done=%2Fgroup%2Fns-3-users%2Fbrowse_frm%2Fthread%2F812ff82c4a76a43f%2Fcaa93f040e570b7e%3Ftvc%3D1%26#doc_caa93f040e570b7e
)
Best,
Chris