KwikNet Telnet User's Guide

User Manual: Pdf

Open the PDF directly: View PDF PDF.
Page Count: 76

DownloadKwikNet Telnet User's Guide
Open PDF In BrowserView PDF
KwikNet

®

TELNET Client / Server
User's Guide
Version 3

First Printing:
Last Printing:

September 1, 1999
September 15, 2005

Manual Order Number: PN303-9T
Copyright © 1999 - 2005

KADAK Products Ltd.
206 - 1847 West Broadway Avenue
Vancouver, BC, Canada, V6J 1Y5
Phone: (604) 734-2796
Fax:
(604) 734-8114

TECHNICAL SUPPORT
KADAK Products Ltd. is committed to technical support for its software products. Our
programs are designed to be easily incorporated in your systems and every effort has
been made to eliminate errors.
Engineering Change Notices (ECNs) are provided periodically to repair faults or to
improve performance. You will automatically receive these updates during the product's
initial support period. For technical support beyond the initial period, you must purchase
a Technical Support Subscription. Contact KADAK for details. Please keep us informed
of the primary user in your company to whom update notices and other pertinent
information should be directed.
Should you require direct technical assistance in your use of this KADAK software
product, engineering support is available by telephone, fax or e-mail. KADAK reserves
the right to charge for technical support services which it deems to be beyond the normal
scope of technical support.
We would be pleased to receive your comments and suggestions concerning this product
and its documentation. Your feedback helps in the continuing product evolution.

KADAK Products Ltd.
206 - 1847 West Broadway Avenue
Vancouver, BC, Canada, V6J 1Y5
Phone:
Fax:
e-mail:

KwikNet Telnet Option

(604) 734-2796
(604) 734-8114
amxtech@kadak.com

KADAK

i

Copyright © 1999-2005 by KADAK Products Ltd.
All rights reserved.
No part of this publication may be reproduced, transmitted, transcribed,
stored in a retrieval system, or translated into any language or computer
language, in any form or by any means, electronic, mechanical,
magnetic, optical, chemical, manual or otherwise, without the prior
written permission of KADAK Products Ltd., Vancouver, BC, CANADA.

DISCLAIMER
KADAK Products Ltd. makes no representations or warranties with
respect to the contents hereof and specifically disclaims any implied
warranties of merchantability and fitness for any particular purpose.
Further, KADAK Products Ltd. reserves the right to revise this
publication and to make changes from time to time in the content
hereof without obligation of KADAK Products Ltd. to notify any
person of such revision or changes.

TRADEMARKS
AMX in the stylized form and KwikNet are registered trademarks of KADAK Products Ltd.
AMX, AMX/FS, InSight, KwikLook and KwikPeg are trademarks of KADAK Products Ltd.
UNIX is a registered trademark of AT&T Bell Laboratories.
Microsoft, MS-DOS and Windows are registered trademarks of Microsoft Corporation.
All other trademarked names are the property of their respective owners.

ii

KADAK

KwikNet Telnet Option

KwikNet

Telnet Client / Server User's Guide
Table of Contents
Page

1. KwikNet Telnet Operation

1

1.1 Introduction..........................................................................................
1.2 General Operation ................................................................................
TELNET Connection ...........................................................................
TELNET Commands ...........................................................................
TELNET Options.................................................................................
The Network Virtual Terminal.............................................................
1.3 KwikNet Telnet Configuration.............................................................
1.4 Telnet Client Task ................................................................................
Multitasking Client Operation..............................................................
Single Threaded Client Operation........................................................
1.5 Telnet Server Task ...............................................................................
Telnet Server Identification..................................................................
Multitasking Server Operation.............................................................
Single Threaded Server Operation .......................................................
1.6 Server Callback Function .....................................................................
Callback Function Execution ...............................................................
Client Connections...............................................................................
Idle Notification ...................................................................................
Data Received from Client...................................................................
Telnet Commands from Client.............................................................
Telnet Option Notifications..................................................................
Telnet Option Subnegotiation Commands from Client........................
Server Message Logging......................................................................
1.7 Client Callback Function......................................................................
Client Message Logging ......................................................................
1.8 Telnet Option Negotiation....................................................................
Option Specifications...........................................................................
Manipulating Telnet Options ...............................................................
1.9 Telnet Sample Program........................................................................
Startup ..................................................................................................
Telnet Client Operation........................................................................
Text and Binary Modes........................................................................
Telnet Server Operation .......................................................................
Shutdown .............................................................................................
KwikNet and Telnet Server Logging ...................................................
Client Logging .....................................................................................
Running the Sample Program ..............................................................
1.10 Making the Telnet Sample Program...................................................
Telnet Sample Program Directories .....................................................
Telnet Sample Program Files ...............................................................
Telnet Sample Program Parameter File ...............................................
Telnet Sample Program KwikNet Library ...........................................
The Telnet Sample Program Make Process .........................................
1.11 Adding Telnet to Your Application....................................................
KwikNet Library..................................................................................
Memory Allocation ..............................................................................
Telnet Client and Server Tasks ............................................................
Reconstructing Your KwikNet Application .........................................
AMX Considerations ...........................................................................
Performance Considerations ................................................................

KwikNet Telnet Option

KADAK

1
2
2
2
4
5
6
9
10
10
11
12
13
13
14
15
15
15
16
16
17
17
18
19
20
21
21
22
23
24
25
26
27
28
29
29
30
31
31
32
33
33
34
35
35
35
36
37
37
38

iii

KwikNet

Telnet Client / Server User's Guide
Table of Contents (continued)
Page

2. KwikNet Telnet Services

39

2.1 Introduction to Telnet Services ............................................................
KwikNet Procedure Descriptions.........................................................
2.2 Telnet Service Procedures....................................................................
Telnet Client Service Procedures .........................................................
Telnet Common Client and/or Server Service Procedures...................
Telnet Server Service Procedures ........................................................

KwikNet

39
39
41
42
48
65

Telnet Client / Server User's Guide
Table of Figures
Page

Figure 1.2-1 TELNET Commands ...........................................................
Figure 1.2-2 TELNET Options ................................................................
Figure 1.2-3 NVT Line Control Characters .............................................

iv

KADAK

3
4
5

KwikNet Telnet Option

1. KwikNet Telnet Operation
1.1 Introduction
The TELNET protocol is a simple remote terminal protocol used for connecting a
terminal on one machine to a process on another using TCP/IP based networks. The
™
KwikNet Telnet Option implements this protocol on top of the KwikNet TCP/IP Stack, a
compact, reliable, high performance TCP/IP stack, well suited for use in embedded
networking applications.
The KwikNet Telnet Option is best used with a real-time operating system (RTOS) such as
KADAK's AMX™ Real-Time Multitasking Kernel. However, the KwikNet Telnet Option
can also be used in a single threaded environment without an RTOS. The KwikNet Porting
Kit User's Guide describes the use of KwikNet with your choice of RT/OS. Note that
throughout this manual, the term RT/OS is used to refer to any operating system, be it a
multitasking RTOS or a single threaded OS.
You can readily tailor the KwikNet stack to accommodate your Telnet needs by using the
®
KwikNet Configuration Builder, a Windows utility which makes configuring KwikNet a
snap. Your KwikNet stack will only include the Telnet features required by your
application.
This manual makes no attempt to describe the TELNET protocol, what it is or how it
operates. It is assumed that you have a working knowledge of the TELNET protocol as it
applies to your needs. Reference materials are provided in Appendix A of the KwikNet
TCP/IP Stack User's Guide.
The purpose of this manual is to provide the system designer and applications
programmer with the information required to properly configure and implement a
networking system using the KwikNet TCP/IP Stack and Telnet. It is assumed that you are
familiar with the architecture of the target processor.
and its options are available in C source format to ensure that regardless of your
development environment, your ability to use and support KwikNet is uninhibited. The
source program may also include code fragments programmed in the assembly language
of the target processor to improve execution speed.

KwikNet

The C programming language, commonly used in real-time systems, is used throughout
this manual to illustrate the features of KwikNet and its Telnet Option.

Note
The KwikNet Telnet Option is a KADAK software product,
separate from that offered by Treck Inc. Hence the Telnet
application programming interface (API) described in
Chapter 6 of the Treck TCP/IP User Manual does not apply
to the KwikNet Telnet component.

KwikNet Telnet Operation

KADAK

1

1.2 General Operation
The TELNET protocol is a simple remote terminal protocol used for connecting a
terminal on one machine to a process on another over TCP/IP based networks such as the
Internet. TELNET is formally defined by the IETF documents RFC-854 and RFC-855.
Document RFC-1700 lists currently defined TELNET options and provides a reference to
the RFC which describes each option. The KwikNet Telnet Option is compliant with those
specifications. The RFCs should be consulted for any detailed questions concerning the
TELNET protocol. The KwikNet Telnet Option implements the subset of Telnet features
typically required for use in embedded applications.
TELNET is a client-server protocol. One machine, the client, initiates a conversation by
contacting another machine, the server. The server must be operating before the client
initiates its requests. The client and server can then use the TELNET protocol to
negotiate how each should operate. Generally, a client communicates with one server at
a time while most servers are designed to work concurrently with multiple clients.
The KwikNet Telnet Option provides all of the services necessary to implement one or
more Telnet clients and servers. Although multiple clients and multiple servers can
coexist and operate concurrently, most applications will require only a single Telnet
client or a single Telnet server.
TELNET Connection
When a Telnet client contacts a Telnet server, a TCP connection is established between
the two machines. The server does a passive open by listening on a TCP socket which is
bound to the well known Telnet port number 23 for requests from potential clients. The
client can then connect its own TCP socket to the server. This connection is referred to
as the Telnet connection. The connection persists until broken by either the client or the
server. The Telnet connection is used by the client and server to send commands,
negotiate terminal options and transfer data (characters) to or from the terminal.
TELNET Commands
A Telnet command is a character string which begins with the Telnet interpret as
command (IAC) character followed by one or more command characters. The command
character names and values are listed in Figure 1.2-1. Those flagged with * are handled
automatically by KwikNet. Note that the EL and EC commands provide network
equivalents of your line editing characters, not line editing services. All commands
flagged with n or o must be handled by your client or server application using services
provided by the KwikNet Telnet interface.
It is recommended that the commands flagged with ! be followed immediately with a DM
data mark command. Upon receipt of these commands, you should usually respond with
a DM synch command. It is recommended that the DM data mark and synch commands be
sent urgently using the TCP out-of-band signaling services provided by the KwikNet
Telnet interface.
Telnet commands are defined in Telnet header file KN_TELN.H as symbols of the form
KN_TELCMD_xxxx where xxxx is one of the command names shown in Figure 1.2-1.

2

KADAK

KwikNet Telnet Operation

Name

Value

IAC
DONT

255
254

*
*

DO

253

*

WONT

252

*

WILL

251

*

SB
GA
EL
EC
AYT
AO
IP
BRK
DM

250
249
248
247
246
245
244
243
242

o

241
240
239
238
237
236
0 to 235

NOP
SE
EOR
ABORT
SUSP
EOF

Command as Intended by Sender

n

*
*
!n
!n
!n
n

>n
>n
n
o
n
n
n
n
n

Interpret next character as a command
Demand that peer not handle an option
Reject peer WILL request so peer will not handle an option
Accept peer WONT indication that it has stopped handling an option
Demand that peer handle an option
Accept peer WILL request so peer can start handling an option
Inform peer that an option can no longer be supported
Reject peer DO request to handle an option
Accept peer DONT request and stop handling an option
Inform peer that an option can be supported
Accept peer DO request and start handling an option
What follows is an option subnegotiation command
Give peer a go-ahead signal allowing peer to resume sending
Ask peer to erase the current line of data which it has received
Ask peer to erase the previous data character which it received
Send peer an "are you there" signal
Send peer a signal to "abort output"
Send peer a signal to "interrupt process"
Send peer a "break" signal
Insert data mark at point at which an urgent signal was sent to peer
Send peer a "synch" signal
Ask peer to do "no operation"
Identify the end of an option subnegotiation command
Mark the end of a record in the data stream
Abort
Line mode: RFC-1184
Suspend
Line mode: RFC-1184
End of file
Line mode: RFC-1184
Undefined commands

Telnet command is handled by KwikNet without assistance.
Telnet command is handled by application using KwikNet services.
o
Telnet option subnegotiation is handled by application.
! Telnet command should be followed by an urgent data mark (DM).
> Telnet command should be sent with TCP urgent notification.

Note *

n

Figure 1.2-1 TELNET Commands

KwikNet Telnet Operation

KADAK

3

TELNET Options
Telnet options control the manner in which the client and server agree to operate. The
Telnet DO, DONT, WILL and WONT commands are used to express the willingness of the
client and server to negotiate a particular option. The negotiation command consists of
three characters: IAC, one of the four negotiation command characters and an 

Source Exif Data:
File Type                       : PDF
File Type Extension             : pdf
MIME Type                       : application/pdf
PDF Version                     : 1.3
Linearized                      : Yes
Encryption                      : Standard V1.2 (40-bit)
User Access                     : Print, Copy, Fill forms, Extract, Assemble, Print high-res
Producer                        : Acrobat Distiller 4.05 for Windows
Creator                         : Microsoft Word 8.0
Modify Date                     : 2005:10:08 17:03:05-08:00
Author                          : KADAK Products Ltd.
Title                           : KwikNet Telnet User's Guide
Create Date                     : 2004:11:08 19:18:12
Subject                         : Version 3
Page Count                      : 76
Page Mode                       : UseOutlines
EXIF Metadata provided by EXIF.tools

Navigation menu