Telnet client and server.
More...
|
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) |
|
Telnet client and server.
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
-
devptr | TELNET 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
-
devptr | TELNET device table entry |
func | control function to execute |
arg1 | first argument for the control function |
arg2 | second argument for the control function |
- Returns
- the result of the control function
devcall telnetFlush |
( |
device * |
devptr | ) |
|
Flushes the telnet server's output buffer
- Parameters
-
devptr | TELNET device table entry |
- Returns
- OK if flush is successful, SYSERR on failure
devcall telnetGetc |
( |
device * |
devptr | ) |
|
Read a single character from TELNET.
- Parameters
-
devptr | TELNET device table entry |
- Returns
- character read from TELNET, or EOF
devcall telnetInit |
( |
device * |
devptr | ) |
|
Initialize TELNET structures.
- Parameters
-
devptr | TELNET device table entry |
- Returns
- OK if device is initialized
devcall telnetOpen |
( |
device * |
devptr, |
|
|
va_list |
ap |
|
) |
| |
Associate TELNET with a hardware device.
- Parameters
-
devptr | TELNET device table entry |
ap | 2nd 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
-
devptr | TELNET device table entry |
ch | character 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
-
devptr | pointer to a telnet device |
buf | buffer for reading characters |
len | size 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
-
ethdev | interface on which telnet server will listen |
port | port on which to start the server |
telnetdev | telnet device to use for connection |
shellname | shell 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
-
telnetdev | telnet device to close |
tcpdev | tcp device to close |
- Returns
- thread return status
devcall telnetWrite |
( |
device * |
devptr, |
|
|
void * |
buf, |
|
|
uint |
len |
|
) |
| |
Write a buffer to a telnet client
- Parameters
-
devptr | TELNET device table entry |
buf | buffer of characters to output |
len | size of the buffer |
- Returns
- count of characters output