Most firewalls provide a proxy outgoing telnet service. Most often you connect
to a specific port of the proxy server, hand the proxy server a machine name and
port number, and it initials a telnet connection for you. The data is then
handle back to the initiating process. The simplest solution is to write
a connect() routine that you can replace the standard libc with, that
talks to the proxy service and sets everything up. Then all you need to do
is add connect.o to your makefile and you are done.