How to start telnetd in POSIX_Init

Sebastian Huber sebastian.huber at embedded-brains.de
Thu Jul 25 05:13:06 UTC 2019


On 24/07/2019 17:54, Heinz Junkes wrote:
> I  use the posix implementation in RTEMS5.
> 
> How can I start telnetd in POSIX_Init?
> Is there an example/manual?

In the old and new network stack, you can start a telnet server like this:

static void
telnet_shell(char *name, void *arg)
{
	rtems_shell_env_t env;

	memset(&env, 0, sizeof(env));

	env.devname = name;
	env.taskname = "TLNT";
	env.login_check = NULL;
	env.forever = false;

	rtems_shell_main_loop(&env);
}

rtems_telnetd_config_table rtems_telnetd_config = {
	.command = telnet_shell,
	.arg = NULL,
	.priority = 0,
	.stack_size = 0,
	.login_check = NULL,
	.keep_stdio = false
};

static void
test_main(void)
{
	rtems_status_code sc = rtems_telnetd_initialize();
	assert(sc == RTEMS_SUCCESSFUL);

	rtems_task_delete(RTEMS_SELF);
	assert(0);
}

In libbsd you can also use the rc.conf approach described by Chris.

> 
> Very concretely:
> 
> Which priority do I have to choose in the
> 
> rtems_telnetd_config_table
> 
> the Posix Prio or the rtems Prio?

   /**
    * @brief Task priority.
    *
    * Use 0 for the default value.
    */
   rtems_task_priority priority;

So, this is an RTEMS priority.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the users mailing list