** telnet api for linux? **

** telnet api for linux? **

Post by validu » Sat, 29 May 1999 04:00:00



OK I've checked the FAQ for this group and a few others but I have been
unable to find a telnet api for linux.  I am looking for something with
GNU distribution or similar (free).  Anyway I had tried just setting up a
stream pipe to a telnet process but I didn't have any luck.  Basically I
just want to be able to pass some commands to a telnet session and read
the output.  Rather than trying to code a telnet client, I figured it
would be less buggy (and easier) to find an api to do this.  Has anyone
used one or can someone shed some light on an algorithm to communicate
with a telnet process?  Thanks in advance.

validus

 
 
 

** telnet api for linux? **

Post by Mike Brist » Sun, 30 May 1999 04:00:00



Quote:>OK I've checked the FAQ for this group and a few others but I have been
>unable to find a telnet api for linux.  I am looking for something with
>GNU distribution or similar (free).  Anyway I had tried just setting up a
>stream pipe to a telnet process but I didn't have any luck.  Basically I
>just want to be able to pass some commands to a telnet session and read
>the output.  

For something simple, look at Net::Telnet (a perl module).  

--
Mike Bristow, Geek-At-Large.
GK/RM0501.

 
 
 

** telnet api for linux? **

Post by validu » Sun, 30 May 1999 04:00:00


Thanks for the info.  I guess I should have mentioned though that I'm
working in C.  Forgot to mention that little detail.

validus

: For something simple, look at Net::Telnet (a perl module).  

: --
: Mike Bristow, Geek-At-Large.
: GK/RM0501.

 
 
 

** telnet api for linux? **

Post by Philip Bro » Wed, 02 Jun 1999 04:00:00



Quote:>OK I've checked the FAQ for this group and a few others but I have been
>unable to find a telnet api for linux.  I am looking for something with
>GNU distribution or similar (free).  Anyway I had tried just setting up a
>stream pipe to a telnet process but I didn't have any luck.  Basically I
>just want to be able to pass some commands to a telnet session and read
>the output.  Rather than trying to code a telnet client, I figured it
>would be less buggy (and easier) to find an api to do this.

naw. Just open port 23, and see what happens.

--
[Trim the no-bots from my address to reply to me by email!]
[ Do NOT email-CC me on posts. Pick one or the other.]
 --------------------------------------------------
The word of the day is sescaquintillion

 
 
 

** telnet api for linux? **

Post by gu.. » Thu, 03 Jun 1999 04:00:00



Quote:>OK I've checked the FAQ for this group and a few others but I have been
>unable to find a telnet api for linux.  I am looking for something with
>GNU distribution or similar (free).  Anyway I had tried just setting up a
>stream pipe to a telnet process but I didn't have any luck.  Basically I
>just want to be able to pass some commands to a telnet session and read
>the output.  Rather than trying to code a telnet client, I figured it
>would be less buggy (and easier) to find an api to do this.  Has anyone
>used one or can someone shed some light on an algorithm to communicate
>with a telnet process?  Thanks in advance.

>validus

call pipe() twice. one for input to telnet, another for output from telnet.

  int fdto[2], fdfrom[2];
  pipe(fdto); pipe(fdfrom);
  if (fork() == 0) {
    close(0); dup(fdto[0]);
    close(1); dup(fdfrom[1]);
    close(fdto[0]); close(fdto[1]); close(fdfrom[0]); close(fdfrom[1]);
    execl("/bin/telnet", "telnet", "xxx.xxx.xxx.xxx", (char *) 0);
  }
  close(fdto[0]); close(fdfrom[1]);
  /* write to fdto[1] and read from fdfrom[0] */
  .....

hope this help

 
 
 

** telnet api for linux? **

Post by Bastard Feline from He » Sun, 06 Jun 1999 04:00:00




: >OK I've checked the FAQ for this group and a few others but I have been
: >unable to find a telnet api for linux.  I am looking for something with
: >GNU distribution or similar (free).  Anyway I had tried just setting up a
: >stream pipe to a telnet process but I didn't have any luck.  Basically I
: >just want to be able to pass some commands to a telnet session and read
: >the output.  Rather than trying to code a telnet client, I figured it
: >would be less buggy (and easier) to find an api to do this.  Has anyone
: >used one or can someone shed some light on an algorithm to communicate
: >with a telnet process?  Thanks in advance.
: >
: >validus
: >
:
: call pipe() twice. one for input to telnet, another for output from telnet.

I believe it's more complicated than this. A stream pipe, IIRC, is a
2-way pipe, so the two pipes are not necessary. However, what he
really needs to do (I believe) is to open a pseudo terminal, and
attach telnet to one end, and his controlling program to another
end. W. Richard Steven's  _Advanced Programming in the UNIX
Environment_ has the details necessary.

Kengo Hashimoto
--
"Because I don't have enough talent, I depend on reality."
                                      -- Takamura Kotaro

 
 
 

** telnet api for linux? **

Post by Jim Troc » Sun, 06 Jun 1999 04:00:00



Quote:>OK I've checked the FAQ for this group and a few others but I have been
>unable to find a telnet api for linux.  I am looking for something with
>GNU distribution or similar (free).  Anyway I had tried just setting up a
>stream pipe to a telnet process but I didn't have any luck.  Basically I
>just want to be able to pass some commands to a telnet session and read
>the output.  Rather than trying to code a telnet client, I figured it
>would be less buggy (and easier) to find an api to do this.  Has anyone
>used one or can someone shed some light on an algorithm to communicate
>with a telnet process?  Thanks in advance.

Use Don Libes' "expect", which is meant to handle the thing which you've
described. Another good alternative is the Perl "Expect" module, or
even the Net::Telnet module. I've used all of the above with success,
but I'd say Perl is the best tool for this particular job.


Computer System and Network Engineer
Transmeta Corporation
Santa Clara, CA

 
 
 

1. ** telnet api for linux? **

From spln!extra.newsguy.com!newsp.newsguy.com!not-for-mail Mon May 31 19:07:08 1999
Path: spln!extra.newsguy.com!newsp.newsguy.com!not-for-mail

Newsgroups: comp.unix.programmer
Subject: ** telnet api for linux? **
Date: 28 May 1999 23:46:33 GMT
Organization: http://extra.newsguy.com
Lines: 12

NNTP-Posting-Host: p-011.newsdawg.com
X-Newsreader: TIN [UNIX 1.3 unoff BETA 970724; i686 Linux 2.0.36]
Xref:   spln comp.unix.programmer:55448

OK I've checked for a FAQ for this group but I didn't find any and I've
checked with comp.unix.programmer but I have been unable to find a telnet
api for linux.  I am looking for something with GNU distribution or
similar (free).  Anyway I had tried just setting up a stream pipe to a
telnet process but I didn't have much luck.  Basically I just want to be
able to pass some commands to a telnet session and read the output.
Rather than trying to code a telnet client, I figured it would be less
buggy (and easier) to find an api to do this or interface with
/usr/bin/telnet. Has anyone used one or can someone shed some light on an
algorithm to communicate with a telnet process?  BTW the code must
be in C.  Thanks in advance.

validus

2. X resolution

3. Telnet Client API Anyone?

4. Need info on free VHDL

5. Telnet API

6. ExtremeTech:Everything You Wanted to Know about Linux*

7. PPP ping help needed!!!

8. Telnet Negotiation @ Pathway API

9. Spell checking API - API to ISPELL needed

10. HCON API/API programming ...

11. telnet from w98->Linux ok, but can't telnet Linux->w98