PDA

View Full Version : DNS Tools for S1



DoctorW
08-17-2004, 06:08 PM
I've just compiled a number of tools for the S1 TiVo using the DNS resolv library from uClibc-0.9.26. The binaries and the source can be obtained from http://minnie.tuhs.org/TiVo/files/libresolv/

The following tools have DNS capability: arp hostname ifconfig netcat netstat ping rarp route rsync traceroute wget.

cojonesdetoro
08-20-2004, 03:26 PM
Woohoo! more cool stuff! THANKS!!

I will no longer have to use "nc -n" to tell netcat not to resolve.

cojonesdetoro
08-24-2004, 05:02 AM
BTW, if anyone happens to have the time, could you attempt to compile a telnet client for the Tivo? It's one thing that is currently missing.

Netcat can function as a telnet client but only when talking to _some_ telnet servers. The telnet server in the Tivo requires a true telnet protocol handshake before it will spawn the interactive shell. I have looked at TCL code that "tried" to be a telnet client but it did not work. I finally wrote my own TCL client and server to process remote commands but doing it via telnet could be handy since the Tivo is already running a telnet server. You can use the Tivo Expect interpreter to "pretend" to be an interactive telnet user and process commands on a remote Tivo. It can take actions based upon what it "sees" in the output of those commands.

It's not a pressing need so don't take a lot of time making it work, I just figure it might be an easier thing to do now that you don't need to strip out name resolution stuff. An older telnet source, using these libs, may compile on the first try... or perhaps I'm just showing my ignorance. :-/

I searched google and found some possibilities:

http://www.pengutronix.de/software/index_en.html

There's also mention of a uclibc version of busybox with telnet/telnetd.. a busybox that resolves would be shweeet. :o

AVD
08-30-2004, 11:12 PM
where does the TiVo get the nameserver addresses? Do we have to use dhcp?

DoctorW
08-31-2004, 12:25 AM
where does the TiVo get the nameserver addresses? Do we have to use dhcp?

I take it you did not download and read the README:


6. Move resolv.conf to /etc/resolv.conf on the TiVo, and edit it to have the IP address(es) of your nameserver(s).

cojonesdetoro
08-31-2004, 04:50 PM
nevermind about the telnet client.

netcat works if you press enter a few times. This coupled with Expect can let you write scripts that execute on one Tivo but run bash shell commands on another Tivo. An expect script like the one below works in my environment. It won't work elsewhere unless they have the same IP net and bash prompts.



#!/bin/expect -f
set timeout -1
spawn $env(SHELL)
match_max 100000
expect -exact "Tivo2# "
send -- "\r"
expect -exact "\r
Tivo2# "
send -- "nc -n 192.168.44.219 23"
expect -exact "nc -n 192.168.44.219 23"
send -- "\r"
expect -exact "\r
"
send -- "\r"
expect -exact "\r
"
send -- "\r"
expect -exact "\r
"
send -- "\r"
expect -exact "\r
"
send -- "\r"
expect -exact "\r
"
send -- "\r"
expect -exact "\r
cd /var/hack\r\r
Tivo1# "
send -- "ls -la /var/hack\r"
expect -exact "Tivo1# "
send -- "exit\r"
expect -exact "exit"
send -- ""
expect eof

AlphaWolf
09-04-2004, 04:59 PM
I don't know about S1, but busybox seems to include a good clean working telnet client for the S2. Somebody might want to port that one. I am using my tivo to watch ascii starwars :D