Hi,
After few days I spent on this problem and have no idea what to do next. I have tried to run bash from ns3 and run telnet from it but with no difference. I always get the same output like "Ñ xÇóÛ: xÇóÛ: dce-linux/source/ns-3-dce/build/lib/P` ðS ÐS " when trying to connect 127.0.0.1 2604 (ospfd deamon). I am wondering why there is some path to dce build directory?
I compiled this telnet code
http://www.gnu.org/software/inetutils/inetutils.html, there was one missing symbol and I added it by NATIVE (_setjmp). Also, I tried some simpler telnet client
http://l3net.wordpress.com/2012/12/09/a-simple-telnet-client/ with the same effect.
I thought that ospf deamon might be a problem so, I have also tried to connect to this simple echo server with telnet
http://www.binarytides.com/server-client-example-c-sockets-linux/. I modified the server code to send "test" string just after accepting connedtion and it works! it is printed to telnet stdout file! Nextly, I tried to set stdin file to telnet an schedule function to write "test" to it, but connection is closed if only the stdin file is set (even without calling write function). So there is no way to any communication with telnet:(
My first thought was that I will run bash in ns3, and inside it I will call "expect" with script file to spawn telnet and do some steps. I do not know if the basic idea is possible, but without right output from telnet it certainly can not be done.
There is also no difference with more recent kernel, I performed all things second time with 3.5.0, because I thought there might be a problem.
I can work on it and make TelnetHelper but I need some clues and help from you Hajime :) I am not an expert but only the Telecommunication student :)
Maybe the best thing will by to write short programs to connect to server and perform some steps like sending some commands?
I am looking forward to hear from you.
Best regards,
Piotr Gawłowicz