LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 02-20-2004, 04:41 PM   #1
gr33ndata
Member
 
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144

Rep: Reputation: 15
Interactive Networking Code


Hello

I want to write a program to execute some commands on a remote host (ex. telnet to a linux router and excute IOS commands there). The problem is I want to know when I am connected and when to send he command etc.

In other words, Suppose I create a socket connect etc. Now when to know that the 3 way handshake has finished, when that it prompts me to enter a user name and wheter it accepted it after that or not ... etc.
 
Old 02-20-2004, 09:01 PM   #2
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
when calling connect, it doesn't return until the 3 way handshake is complete. atually, to be precise it returns after recieving the server's SYN/ACK packet and then sends it's SYN packet. but that stuff is all managed by the underlying protocols, you dont worry about that at the application level. however, you are talking about telnet, and that is the protocol that you have to worry about. have you read the rfc?
 
Old 02-22-2004, 01:42 AM   #3
gr33ndata
Member
 
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144

Original Poster
Rep: Reputation: 15
Actually no !!
I didn't read the RFC ... I used to think of Telnet as a pure TCP (i.e It just send blocks of data in the TCP payload ). That's why I can use the telnet application to communicate with any other protocols by writing that protocol commands over Telnet ... Am I right ??!!
Any ways I think it may help
Thanks
 
Old 02-22-2004, 08:18 AM   #4
krajzega
Member
 
Registered: Jan 2004
Location: Poland
Distribution: FreeBSD 5.1
Posts: 92

Rep: Reputation: 15
In TCP sockets there are 2 kinds of data, right data which you want to send or receive and also Out-Of-Base (OOB) data, for example ACK (acknowledge) which 'tells' the client, that packet has been received by the server and also otherwise. (that's quite short way to describe it). All kinds of TCP sockets uses this kind of data (TCP protocol is exactly based on it). But you're right that Telnet is pure TCP, because first kind of packets I said about is exactly what you receive and what you send, so there's no RTF for telnet.

Last edited by krajzega; 02-22-2004 at 08:19 AM.
 
Old 02-22-2004, 11:46 AM   #5
infamous41md
Member
 
Registered: Mar 2003
Posts: 804

Rep: Reputation: 30
first off, ACKS are not OOB(out-of-band also) data. 2nd off, oob data is HARDLY ever used. but since you brought it up, telnet in fact does use OOB data to send important control characters. RTF? there is of course an RFC, b/c it is an APPLICATION LEVEL PROTOCOL:

http://www.faqs.org/rfcs/rfc854.html
 
Old 03-03-2004, 02:46 AM   #6
gr33ndata
Member
 
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144

Original Poster
Rep: Reputation: 15
What are the Telnet OOB Data ?
 
Old 03-03-2004, 08:34 AM   #7
deiussum
Member
 
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895

Rep: Reputation: 32
Here's the RFC for the Telnet protocol. If you do a search for "telnet" at this site, you will find that there are many more which allow for additional extensions, but you probably won't need those, depending on what you want to do.

http://www.faqs.org/rfcs/rfc854.html
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
User Preferences: Use HTML code instead of vB code? (vB code is overrated) stefanlasiewski LQ Suggestions & Feedback 5 07-26-2005 01:37 AM
non-interactive ssh podollb Linux - Software 3 04-20-2004 03:28 PM
Interactive setup EECGeek Linux - Newbie 4 01-20-2004 09:15 PM
Non interactive FTP lapthorn Linux - Networking 1 11-28-2003 12:05 PM
I need some networking source code!!! lamvd Linux - Newbie 2 02-23-2003 11:02 PM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 03:55 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration