Embedded Xinu Operating System
An ongoing research project and educational operating system.
 All Data Structures Files Functions Variables Typedefs Enumerations Macros Groups Pages
Functions

Telnet client and server. More...

Functions

int telnetAlloc (void)
 
devcall telnetClose (device *devptr)
 
devcall telnetControl (device *devptr, int func, long arg1, long arg2)
 
devcall telnetFlush (device *devptr)
 
devcall telnetGetc (device *devptr)
 
devcall telnetInit (device *devptr)
 
devcall telnetOpen (device *devptr, va_list ap)
 
devcall telnetPutc (device *devptr, char ch)
 
devcall telnetRead (device *devptr, void *buf, uint len)
 
thread telnetServer (int ethdev, int port, ushort telnetdev, char *shellname)
 
thread telnetServerKiller (ushort, ushort)
 
devcall telnetWrite (device *devptr, void *buf, uint len)
 

Detailed Description

Telnet client and server.

Function Documentation

int telnetAlloc ( void  )

Allocate an available telnet device.

Returns
device number for a telnet device, SYSERR if none are free
devcall telnetClose ( device *  devptr)

Close a TELNET device.

Parameters
devptrTELNET device table entry
Returns
OK if TELNET is closed properly, otherwise SYSERR
devcall telnetControl ( device *  devptr,
int  func,
long  arg1,
long  arg2 
)

Control function for TELNET pseudo devices.

Parameters
devptrTELNET device table entry
funccontrol function to execute
arg1first argument for the control function
arg2second argument for the control function
Returns
the result of the control function
devcall telnetFlush ( device *  devptr)

Flushes the telnet server's output buffer

Parameters
devptrTELNET device table entry
Returns
OK if flush is successful, SYSERR on failure
devcall telnetGetc ( device *  devptr)

Read a single character from TELNET.

Parameters
devptrTELNET device table entry
Returns
character read from TELNET, or EOF
devcall telnetInit ( device *  devptr)

Initialize TELNET structures.

Parameters
devptrTELNET device table entry
Returns
OK if device is initialized
devcall telnetOpen ( device *  devptr,
va_list  ap 
)

Associate TELNET with a hardware device.

Parameters
devptrTELNET device table entry
ap2nd argument is the device number for the hardware device
Returns
OK if TELNET is opened properly, otherwise SYSERR
devcall telnetPutc ( device *  devptr,
char  ch 
)

Write a single character to TELNET.

Parameters
devptrTELNET device table entry
chcharacter to output
Returns
ch as an unsigned char cast to an int on success; SYSERR on failure.
devcall telnetRead ( device *  devptr,
void *  buf,
uint  len 
)

Read characters from a telnet connection

Parameters
devptrpointer to a telnet device
bufbuffer for reading characters
lensize of the buffer
Returns
number of characters read, EOF if end of file was reached
thread telnetServer ( int  ethdev,
int  port,
ushort  telnetdev,
char *  shellname 
)

Start telnet server

Parameters
ethdevinterface on which telnet server will listen
portport on which to start the server
telnetdevtelnet device to use for connection
shellnameshell device to use for connection
Returns
OK on success SYSERR on failure
thread telnetServerKiller ( ushort  telnetdev,
ushort  tcpdev 
)

Kills telnet server that was spawned

Parameters
telnetdevtelnet device to close
tcpdevtcp device to close
Returns
thread return status
devcall telnetWrite ( device *  devptr,
void *  buf,
uint  len 
)

Write a buffer to a telnet client

Parameters
devptrTELNET device table entry
bufbuffer of characters to output
lensize of the buffer
Returns
count of characters output