[Ns-developers] user-space code integration update

Gustavo Carneiro gjcarneiro at gmail.com
Thu Aug 7 09:17:24 PDT 2008


2008/8/7 Mathieu Lacage <mathieu.lacage at sophia.inria.fr>

>
> On Thu, 2008-08-07 at 13:25 +0100, Gustavo Carneiro wrote:
> >
> >
> > 2008/8/6 Mathieu Lacage <mathieu.lacage at sophia.inria.fr>
> >         hi,
> >
> >         Recently, I resumed work on the ns-3-simu branch with a focus
> >         towards
> >         helping liu merge his code back into ns-3 and starting to port
> >         quagga.
> >         The biggest change in http://code.nsnam.org/mathieu/ns-3-simu
> >         is that I
> >         added support for loading in memory unmodified executables
> >         with an elf
> >         loader and running them over ns-3. This is implemented in the
> >         src/process/elf-loader.h|cc files through a bunch of tricks to
> >         force the
> >         libc elf loader to load the same binary multiple times in
> >         memory.
> >
> >         I also added a lot of code to the libc replacement and have
> >         gotten
> >         sufficiently far to run the example programs in
> >         examples/process.cc and
> >         examples/process-udp-server.cc and
> >         examples/process-udp-client.cc.
> >
> > For replacing many libc functions (e.g. it works for socket
> > functions), you can also use LD_PRELOAD to replace weak symbols.  I
> > was wondering, what led you down this more complicated path instead?
>
> because not all symbols are weak and because we don't want to replace
> the libc used by ns-3: we want to replace the libc used only by the
> simulated programs.


Sure, but does ns-3 use any libc function that you want to override?  Also
it is possible to access the original libc function (via dlsym with
RTLD_NEXT).

But don't worry, what matters is that it's done, I'm certainly not
complaining :-)

-- 
Gustavo J. A. M. Carneiro
INESC Porto, Telecommunications and Multimedia Unit
"The universe is always one step beyond logic." -- Frank Herbert


More information about the Ns-developers mailing list