cURL / Mailing Lists / curl-library / Single Mail

curl-library

Re: Automating telnet sessions with libcurl

From: Adam M <curl_at_irotas.net>
Date: Tue, 20 Dec 2005 13:36:51 -0500

On Tue, 20 Dec 2005 17:45:19 -0000, man_at_tfhs.net said:
> dont re-invent the wheel. see if existing tools will work.
>
> http://www.kiwisyslog.com/cattools2.htm
>
> http://www.experts-exchange.com/Hardware/Routers/Q_21108412.html
>
> i am a perl hacker, so i use the Net::Telnet::Cisco way myself...

Hi Allan,

I should be more clear about my constraints here.

First of all, the automation needs to be done from within a C/C++
application running on Linux. For this particular case, the
responsiveness (i.e., latency of rule interpretation and insertion) is
extremely sensitive, and must be "as fast as possible".

My initial approach was to call a C-Kermit script from within the C/C++
application, but the additional overhead of logging in (i.e.,
authenticating) every time has become too expensive.

As the automation needs to be done from Linux, CatTools is not an
option. And unless there's some clever way of staying logged in even
while using external Perl/Kermit scripts, it seems that the C/C++
application needs to log into the switch on startup and log out on exit.

As libcurl seems to provide TELNET capabilities with a C/C++ binding, it
seemed to be an excellent solution. However, I was reading over the TODO
list for libcurl, and it talks about how the library requires the input
to come from stdin, and *not* application-generated. If this TODO
statement is still current, it seems that rules out using libcurl,
unless there's another way.

I've also been reading a bit on the C bindings for EXPECT, which may in
fact be the way to go. I had originally leaned towards libcurl because
the learning curve seemed to be easier than EXPECT, but perhaps it just
doesn't do what I need.

Any thoughts here?

Thanks again,
Adam
Received on 2005-12-20