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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
02-20-2004, 04:41 PM
|
#1
|
Member
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144
Rep:
|
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.
|
|
|
02-20-2004, 09:01 PM
|
#2
|
Member
Registered: Mar 2003
Posts: 804
Rep:
|
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?
|
|
|
02-22-2004, 01:42 AM
|
#3
|
Member
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144
Original Poster
Rep:
|
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
|
|
|
02-22-2004, 08:18 AM
|
#4
|
Member
Registered: Jan 2004
Location: Poland
Distribution: FreeBSD 5.1
Posts: 92
Rep:
|
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.
|
|
|
02-22-2004, 11:46 AM
|
#5
|
Member
Registered: Mar 2003
Posts: 804
Rep:
|
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
|
|
|
03-03-2004, 02:46 AM
|
#6
|
Member
Registered: Aug 2003
Location: DMZ
Distribution: Ubuntu
Posts: 144
Original Poster
Rep:
|
What are the Telnet OOB Data ?
|
|
|
03-03-2004, 08:34 AM
|
#7
|
Member
Registered: Aug 2003
Location: Santa Clara, CA
Distribution: Slackware
Posts: 895
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 02:41 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|