netutils/telnetd and users of telnetd: Add support for IPv6.

This commit is contained in:
Gregory Nutt 2017-06-27 09:14:13 -06:00
parent 98204bad94
commit 28415d662b
9 changed files with 132 additions and 37 deletions

View file

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/netutils/telnetd.h
*
* Copyright (C) 2007, 2011-2012, 2015 Gregory Nutt. All rights reserved.
* Copyright (C) 2007, 2011-2012, 2015, 2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -61,18 +61,22 @@ struct telnetd_config_s
{
/* These fields describe the telnet daemon */
int d_port; /* The port to listen on (in network byte order) */
int d_priority; /* The execution priority of the Telnet daemon task */
int d_stacksize; /* The stack size needed by the Telnet daemon task */
uint8_t d_priority; /* The execution priority of the Telnet daemon task */
size_t d_stacksize; /* The stack size needed by the Telnet daemon task */
/* These fields describe the network connection */
uint16_t d_port; /* The port to listen on (in network byte order) */
sa_family_t d_family; /* Address family */
/* These fields describe the priority of each thread created by the Telnet
* daemon.
*/
int t_priority; /* The execution priority of the spawned task, */
int t_stacksize; /* The stack size needed by the spawned task */
main_t t_entry; /* The entrypoint of the task to spawn when a new
* connection is accepted. */
uint8_t t_priority; /* The execution priority of the spawned task, */
size_t t_stacksize; /* The stack size needed by the spawned task */
main_t t_entry; /* The entrypoint of the task to spawn when a new
* connection is accepted. */
};
/****************************************************************************

View file

@ -1,7 +1,7 @@
/****************************************************************************
* apps/include/nshlib/nshlib.h
*
* Copyright (C) 2011, 2013, 2016 Gregory Nutt. All rights reserved.
* Copyright (C) 2011, 2013, 2016-2017 Gregory Nutt. All rights reserved.
* Author: Gregory Nutt <gnutt@nuttx.org>
*
* Redistribution and use in source and binary forms, with or without
@ -147,8 +147,12 @@ int nsh_consolemain(int argc, char *argv[]);
* the daemon has been started.
*
* Input Parameters:
* None. All of the properties of the Telnet daemon are controlled by
* NuttX configuration setting.
* family - Provides the IP family to use by the server. May be either
* AF_INET or AF_INET6. This is needed because both both may be
* enabled in the configuration.
*
* All of the other properties of the Telnet daemon are controlled by
* NuttX configuration settings.
*
* Returned Values:
* The task ID of the Telnet daemon was successfully started. A negated
@ -156,7 +160,7 @@ int nsh_consolemain(int argc, char *argv[]);
*
****************************************************************************/
int nsh_telnetstart(void);
int nsh_telnetstart(sa_family_t family);
/****************************************************************************
* Name: platform_motd