summaryrefslogtreecommitdiffstats
path: root/cpukit/telnetd
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/telnetd')
-rw-r--r--cpukit/telnetd/pty.h17
-rw-r--r--cpukit/telnetd/telnetd.c9
-rw-r--r--cpukit/telnetd/telnetd.h4
3 files changed, 22 insertions, 8 deletions
diff --git a/cpukit/telnetd/pty.h b/cpukit/telnetd/pty.h
index 5d27ddb9d9..7445f604a3 100644
--- a/cpukit/telnetd/pty.h
+++ b/cpukit/telnetd/pty.h
@@ -11,8 +11,8 @@
* $Id$
*/
-#ifndef __PTY_H
-#define __PTY_H
+#ifndef _RTEMS_PTY_H
+#define _RTEMS_PTY_H
#ifdef __cplusplus
extern "C" {
@@ -20,7 +20,18 @@ extern "C" {
#include <rtems.h>
-char * get_pty(int socket);
+/* Number of ptys to setup */
+extern size_t rtems_pty_maximum_ptys;
+
+/* Return the devname for a free pty slot.
+ * If no slot available (socket>=0)
+ * then the socket argument is closed
+ */
+char * rtems_pty_get(int socket);
+
+
+/* OBSOLETE */
+#define get_pty rtems_pty_get
rtems_device_driver pty_initialize(
rtems_device_major_number major,
diff --git a/cpukit/telnetd/telnetd.c b/cpukit/telnetd/telnetd.c
index 4673cef3a4..ce5e331976 100644
--- a/cpukit/telnetd/telnetd.c
+++ b/cpukit/telnetd/telnetd.c
@@ -34,6 +34,10 @@
#include <stdlib.h>
#include <string.h> /* memset */
#include <stdio.h>
+
+/* FIXME: This should not be here */
+extern void _rtems_telnetd_register_icmds(void);
+
/***********************************************************/
rtems_id telnetd_task_id =0;
uint32_t telnetd_stack_size =16384;
@@ -71,7 +75,7 @@ rtems_task rtems_task_telnetd(rtems_task_argument task_argument) {
perror("telnetd:accept");
break;
};
- if ((devname = get_pty(acp_socket)) ) {
+ if ((devname = rtems_pty_get(acp_socket)) ) {
shell_init(&devname[5],
telnetd_stack_size,
telnetd_task_priority,
@@ -85,10 +89,9 @@ rtems_task rtems_task_telnetd(rtems_task_argument task_argument) {
}
/***********************************************************/
int rtems_telnetd_initialize(void) {
- void register_icmds(void);
rtems_status_code sc;
- register_icmds(); /* stats for tcp/ip */
+ _rtems_telnetd_register_icmds(); /* stats for tcp/ip */
if (telnetd_task_id ) return RTEMS_RESOURCE_IN_USE;
if (telnetd_stack_size<=0 ) telnetd_stack_size =16384;
diff --git a/cpukit/telnetd/telnetd.h b/cpukit/telnetd/telnetd.h
index 102f59feae..c8c068c9fb 100644
--- a/cpukit/telnetd/telnetd.h
+++ b/cpukit/telnetd/telnetd.h
@@ -16,8 +16,8 @@
* $Id$
*/
-#ifndef __TELNETD_H
-#define __TELNETD_H
+#ifndef _RTEMS_TELNETD_H
+#define _RTEMS_TELNETD_H
#ifdef __cplusplus
extern "C" {