2011-05-10 00:21:10 +02:00
|
|
|
/****************************************************************************
|
2021-06-11 11:07:52 +02:00
|
|
|
* apps/include/netutils/telnetd.h
|
2011-05-10 00:21:10 +02:00
|
|
|
*
|
2021-06-11 08:28:21 +02:00
|
|
|
* Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
* contributor license agreements. See the NOTICE file distributed with
|
|
|
|
* this work for additional information regarding copyright ownership. The
|
|
|
|
* ASF licenses this file to you under the Apache License, Version 2.0 (the
|
|
|
|
* "License"); you may not use this file except in compliance with the
|
|
|
|
* License. You may obtain a copy of the License at
|
2011-05-10 00:21:10 +02:00
|
|
|
*
|
2021-06-11 08:28:21 +02:00
|
|
|
* http://www.apache.org/licenses/LICENSE-2.0
|
2011-05-10 00:21:10 +02:00
|
|
|
*
|
2021-06-11 08:28:21 +02:00
|
|
|
* Unless required by applicable law or agreed to in writing, software
|
|
|
|
* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
|
|
|
|
* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
|
|
|
|
* License for the specific language governing permissions and limitations
|
|
|
|
* under the License.
|
2012-01-30 22:29:59 +01:00
|
|
|
*
|
2011-05-10 00:21:10 +02:00
|
|
|
****************************************************************************/
|
|
|
|
|
2012-01-30 22:29:59 +01:00
|
|
|
#ifndef __APPS_INCLUDE_NETUTILS_TELNETD_H
|
|
|
|
#define __APPS_INCLUDE_NETUTILS_TELNETD_H
|
2011-05-10 00:21:10 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Included Files
|
|
|
|
****************************************************************************/
|
|
|
|
|
2022-10-16 13:44:38 +02:00
|
|
|
#include <sys/types.h>
|
2012-01-30 22:29:59 +01:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Types
|
|
|
|
****************************************************************************/
|
|
|
|
|
2021-06-11 11:07:52 +02:00
|
|
|
/* An instance of the struct telnetd_config_s structure must be passed to
|
2022-10-16 13:44:38 +02:00
|
|
|
* telnetd_daemon in order to configure the new Telnet daemon.
|
2012-01-30 22:29:59 +01:00
|
|
|
*/
|
|
|
|
|
|
|
|
struct telnetd_config_s
|
|
|
|
{
|
2017-06-27 17:14:13 +02:00
|
|
|
/* These fields describe the network connection */
|
|
|
|
|
2022-10-16 13:44:38 +02:00
|
|
|
uint16_t d_port; /* The port to listen on (in network byte order) */
|
|
|
|
sa_family_t d_family; /* Address family */
|
2012-01-30 22:29:59 +01:00
|
|
|
|
2022-10-16 13:44:38 +02:00
|
|
|
/* These fields describe the priority of each task created by the Telnet
|
2012-01-30 22:29:59 +01:00
|
|
|
* daemon.
|
|
|
|
*/
|
|
|
|
|
2022-10-16 13:44:38 +02:00
|
|
|
uint8_t t_priority; /* The execution priority of the spawned task, */
|
|
|
|
size_t t_stacksize; /* The stack size needed by the spawned task */
|
|
|
|
#ifndef CONFIG_BUILD_KERNEL
|
|
|
|
main_t t_entry; /* The entrypoint of the task to spawn when a new
|
|
|
|
* connection is accepted. */
|
|
|
|
#endif
|
|
|
|
#ifdef CONFIG_LIBC_EXECFUNCS
|
|
|
|
FAR const char *t_path; /* The binary path of the task to spawn when a new
|
|
|
|
* connection is accepted. */
|
|
|
|
#endif
|
|
|
|
FAR char * const *t_argv; /* The argument pass to the spawned task */
|
2012-01-30 22:29:59 +01:00
|
|
|
};
|
2011-05-10 00:21:10 +02:00
|
|
|
|
|
|
|
/****************************************************************************
|
|
|
|
* Public Function Prototypes
|
|
|
|
****************************************************************************/
|
|
|
|
|
|
|
|
#ifdef __cplusplus
|
|
|
|
#define EXTERN extern "C"
|
2015-06-13 02:07:47 +02:00
|
|
|
extern "C"
|
|
|
|
{
|
2011-05-10 00:21:10 +02:00
|
|
|
#else
|
|
|
|
#define EXTERN extern
|
|
|
|
#endif
|
|
|
|
|
2012-01-30 22:29:59 +01:00
|
|
|
/****************************************************************************
|
2022-10-16 13:44:38 +02:00
|
|
|
* Name: telnetd_daemon
|
2012-01-30 22:29:59 +01:00
|
|
|
*
|
|
|
|
* Description:
|
2022-10-16 13:44:38 +02:00
|
|
|
* Run the Telnet daemon loop.
|
2012-01-30 22:29:59 +01:00
|
|
|
*
|
|
|
|
* Parameters:
|
|
|
|
* config A pointer to a configuration structure that characterizes the
|
2015-06-13 02:07:47 +02:00
|
|
|
* Telnet daemon. This configuration structure may be defined
|
2012-01-30 22:29:59 +01:00
|
|
|
* on the caller's stack because it is not retained by the
|
|
|
|
* daemon.
|
|
|
|
*
|
|
|
|
* Return:
|
2022-10-16 13:44:38 +02:00
|
|
|
* A negated errno is returned if the daemon was not successfully started.
|
2012-01-30 22:29:59 +01:00
|
|
|
*
|
|
|
|
****************************************************************************/
|
2011-05-10 00:21:10 +02:00
|
|
|
|
2022-10-16 13:44:38 +02:00
|
|
|
int telnetd_daemon(FAR const struct telnetd_config_s *config);
|
2011-05-10 00:21:10 +02:00
|
|
|
|
|
|
|
#undef EXTERN
|
|
|
|
#ifdef __cplusplus
|
|
|
|
}
|
|
|
|
#endif
|
2012-01-30 22:29:59 +01:00
|
|
|
#endif /* __APPS_INCLUDE_NETUTILS_TELNETD_H */
|