<div>Alex,</div><div><br></div><div>Thanks for the quick reply. After I modify the wscript file to include hijacker.cc , it works.</div><div><br></div><div>More questions in lines.</div><div><br></div><div>On Tue, Feb 26, 2013 at 12:47 AM, Alex Afanasyev <span dir="ltr"><<a href="mailto:alexander.afanasyev@ucla.edu" target="_blank">alexander.afanasyev@ucla.edu</a>></span> wrote:</div>
<div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div>Hi Chengyu,</div><div><br></div><div>You would need to modify wscript file to include hijacker.cc in your scenario.   You can checkout an example in examples/wscript for "ndn-simple-with-custom-app".</div>
<div> </div></div></blockquote><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word"><div></div><div>At the same time, I would encourage you and everybody else against writing scenarios by modifying ndnSIM or NS-3.  My personal recommendation is to use a modular way, using for example the template <a href="https://github.com/cawka/ndnSIM-scenario-template" target="_blank">https://github.com/cawka/ndnSIM-scenario-template</a>.   If you simply copy hijacker.cc to extensions folder and copy your modified version of ndn-tree-app-delay-trace (alongside with topology files), it should compile and work.</div>
<div><br></div></div></blockquote><div><br></div><div><div>Now I try to use files "ndn-simple-with-custom-app.cc", "custom-app.h", "custom-app.cc", "hijacker.cc", and "hijacker.h" in directory "scratch".</div>
<div>They work in the examples, so I think they should work in the scratch directory.</div><div><br></div><div>In addition, I also add two lines to include custom-app.h and hijacker.h in ndn-simple-with-custom-app.cc:</div>
<div><b>#include "custom-app.h"</b></div><div><b>#include "hijacker.h"</b></div><div><b><br></b></div><div>However, when I run the command "./waf --run=scratch/ndn-simple-with-custom-app", it gives me a lot of "relocation" error message:</div>
</div><div><br></div><div>==================================</div><div><div>./waf --run=scratch/ndn-simple-with-custom-app</div><div>Waf: Entering directory `/home/chengyu/ndnSIM/ns-3/build'</div><div>[ 820/1989] cxx: scratch/ndn-simple-with-custom-app.cc -> build/scratch/ndn-simple-with-custom-app.cc.3.o</div>
<div>[1715/1989] cxx: scratch/hijacker.cc -> build/scratch/hijacker.cc.2.o</div><div>[1962/1989] cxxprogram: build/scratch/ndn-simple-with-custom-app.cc.3.o -> build/scratch/ndn-simple-with-custom-app</div><div>[1963/1989] cxxprogram: build/scratch/hijacker.cc.2.o -> build/scratch/hijacker</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 0 has invalid symbol index 11</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 1 has invalid symbol index 12</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 2 has invalid symbol index 2</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 3 has invalid symbol index 2</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 4 has invalid symbol index 11</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 5 has invalid symbol index 13</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 6 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 7 has invalid symbol index 13</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 8 has invalid symbol index 2</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 9 has invalid symbol index 2</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 10 has invalid symbol index 12</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 11 has invalid symbol index 13</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 12 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 13 has invalid symbol index 13</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 14 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 15 has invalid symbol index 13</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 16 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 17 has invalid symbol index 13</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 18 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 19 has invalid symbol index 13</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 20 has invalid symbol index 13</div><div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 21 has invalid symbol index 13</div>
<div>/usr/bin/ld: /usr/lib/debug/usr/lib/i386-linux-gnu/crt1.o(.debug_info): relocation 22 has invalid symbol index 21</div><div>/usr/lib/gcc/i686-linux-gnu/4.6/../../../i386-linux-gnu/crt1.o: In function `_start':</div>
<div>(.text+0x18): undefined reference to `main'</div><div>collect2: ld returned 1 exit status</div><div>Waf: Leaving directory `/home/chengyu/ndnSIM/ns-3/build'</div><div>Build failed</div><div> -> task in 'hijacker' failed (exit status 1): </div>
<div><span class="Apple-tab-span" style="white-space:pre">      </span>{task 146488780: cxxprogram hijacker.cc.2.o -> hijacker}</div><div>['/usr/bin/g++', '-pthread', '-pthread', '-Wl,-Bsymbolic-functions', '-Wl,-z,relro', 'scratch/hijacker.cc.2.o', '-o', '/home/chengyu/ndnSIM/ns-3/build/scratch/hijacker', '-Wl,-Bstatic', '-Wl,-Bdynamic', '-Wl,--no-as-needed', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L.', '-L/usr/local/lib', '-L/usr/lib', '-lns3-dev-test-debug', '-lns3-dev-csma-layout-debug', '-lns3-dev-point-to-point-layout-debug', '-lns3-dev-netanim-debug', '-lns3-dev-lte-debug', '-lns3-dev-spectrum-debug', '-lns3-dev-antenna-debug', '-lns3-dev-aodv-debug', '-lns3-dev-dsdv-debug', '-lns3-dev-dsr-debug', '-lns3-dev-mesh-debug', '-lns3-dev-olsr-debug', '-lns3-dev-csma-debug', '-lns3-dev-wimax-debug', '-lns3-dev-applications-debug', '-lns3-dev-virtual-net-device-debug', '-lns3-dev-uan-debug', '-lns3-dev-energy-debug', '-lns3-dev-flow-monitor-debug', '-lns3-dev-ndnSIM-debug', '-lns3-dev-visualizer-debug', '-lns3-dev-nix-vector-routing-debug', '-lns3-dev-tap-bridge-debug', '-lns3-dev-internet-debug', '-lns3-dev-bridge-debug', '-lns3-dev-point-to-point-debug', '-lns3-dev-mpi-debug', '-lns3-dev-wifi-debug', '-lns3-dev-buildings-debug', '-lns3-dev-propagation-debug', '-lns3-dev-mobility-debug', '-lns3-dev-config-store-debug', '-lns3-dev-tools-debug', '-lns3-dev-stats-debug', '-lns3-dev-emu-debug', '-lns3-dev-topology-read-debug', '-lns3-dev-network-debug', '-lns3-dev-core-debug', '-lrt', '-lgsl', '-lgslcblas', '-lm', '-lgtk-x11-2.0', '-lgdk-x11-2.0', '-latk-1.0', '-lgio-2.0', '-lpangoft2-1.0', '-lpangocairo-1.0', '-lgdk_pixbuf-2.0', '-lcairo', '-lpango-1.0', '-lfreetype', '-lfontconfig', '-lgobject-2.0', '-lglib-2.0', '-lxml2', '-lsqlite3', '-lboost_iostreams', '-lpython2.7']</div>
</div><div><br></div><div>====================================================</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div style="word-wrap:break-word">
<div></div><div>Let us know if you still in trouble with hijacker (either with or without modular way).</div><div><br></div><div>---</div><div>Alex</div><div><br></div><br><div><div><div class="h5"><div>On Feb 25, 2013, at 11:14 PM, Chengyu Fan <<a href="mailto:chengyu@cs.colostate.edu" target="_blank">chengyu@cs.colostate.edu</a>> wrote:</div>
<br></div></div><blockquote type="cite"><div><div class="h5"><blockquote type="cite" style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif"><div>Hi~</div><div><br></div><div>I want to use the custom app "hijacker" in ndnSIM, so I modify the code of ndn-tree-app-delay-tracer.cc.</div>

<div><br></div><div>Basically I replace codes:</div><div><div>  ndn::AppHelper producerHelper ("ns3::ndn::Producer");</div><div>  producerHelper.SetAttribute ("PayloadSize", StringValue("1024"));  </div>

<div><br></div><div>using: </div><div>  ndn::AppHelper producerHelper ("Hijacker");</div></div><div><br></div><div><br></div><div>However, when I run ndn-tree-app-delay-trace, it prompts the error messages:</div>

<div><br></div><div><b>assert failed. cond="uid != 0", msg="Assert in TypeId::LookupByName: Hijacker not found", file=../src/core/model/type-id.cc, line=419</b></div><div><b>terminate called without an active exception</b></div>

<div><b><br></b></div><div><b>Command ['/home/chengyu/ndnSIM/ns-3/build/src/ndnSIM/examples/ns3-dev-ndn-tree-app-delay-tracer-debug', '100'] terminated with signal SIGIOT. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>").</b></div>

<div><br></div><div>Does anybody know what the problem is?</div><div><br></div><div>Thanks,</div><div>Chengyu</div></blockquote></div></div>
_______________________________________________<br>ndnSIM mailing list<br><a href="mailto:ndnSIM@lists.cs.ucla.edu" target="_blank">ndnSIM@lists.cs.ucla.edu</a><br><a href="http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim" target="_blank">http://www.lists.cs.ucla.edu/mailman/listinfo/ndnsim</a><br>
</blockquote></div><br></div></blockquote></div><br>