mirror of
https://github.com/apache/nuttx.git
synced 2026-05-20 20:44:39 +08:00
drivers/net: Move the Telnet driver from apps/netutils/netnetd to drivers/net
This commit is contained in:
@@ -11216,4 +11216,7 @@
|
||||
* arch/arm/src/samv7: Port the WDT driver from the SAMA5D3/4 to the
|
||||
SAMV7 (s015-12-06).
|
||||
* arch/arm/src/samv7: Add an RSWDT driver (2015-12-06).
|
||||
* drivers/net/telnet.c: Move the Telnet driver from apps/netutils/telnetd
|
||||
to drivers/net. It is a driver a belongs in the OS. There are still
|
||||
some interface related issues, however (2015-12-07).
|
||||
|
||||
|
||||
@@ -16,6 +16,33 @@ config NETDEV_LOOPBACK
|
||||
networking devices that are enabled must be compatible with
|
||||
CONFIG_NET_NOINTS.
|
||||
|
||||
config NETDEV_TELNET
|
||||
bool "Telnet driver"
|
||||
default n
|
||||
depends on NET && NET_TCP
|
||||
---help---
|
||||
The Telnet driver generates a character driver instance to support a
|
||||
Telnet session. This driver is used by the Telnet daemon. The
|
||||
Telnet daeman will instantiate a new Telnet driver to support
|
||||
standard I/O on the new Telnet session.
|
||||
|
||||
if NETDEV_TELNET
|
||||
|
||||
config TELNET_RXBUFFER_SIZE
|
||||
int "Telnet RX buffer size"
|
||||
default 256
|
||||
|
||||
config TELNET_TXBUFFER_SIZE
|
||||
int "Telnet TX buffer size"
|
||||
default 256
|
||||
|
||||
config TELNET_DUMPBUFFER
|
||||
bool "Dump Telnet buffers"
|
||||
default n
|
||||
depends on DEBUG_NET
|
||||
|
||||
endif # NETDEV_TELNET
|
||||
|
||||
config NETDEV_MULTINIC
|
||||
bool "Multiple network interface support"
|
||||
default n if !NETDEV_LOOPBACK
|
||||
|
||||
@@ -43,6 +43,10 @@ ifeq ($(CONFIG_NETDEV_LOOPBACK),y)
|
||||
CSRCS += loopback.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NETDEV_TELNET),y)
|
||||
CSRCS += telnet.c
|
||||
endif
|
||||
|
||||
ifeq ($(CONFIG_NET_DM90x0),y)
|
||||
CSRCS += dm90x0.c
|
||||
endif
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,69 @@
|
||||
/****************************************************************************
|
||||
* include/nuttx/net/telnet.h
|
||||
*
|
||||
* Copyright (C) 2012, 2015 Gregory Nutt. All rights reserved.
|
||||
* Author: Gregory Nutt <gnutt@nuttx.org>
|
||||
*
|
||||
* Redistribution and use in source and binary forms, with or without
|
||||
* modification, are permitted provided that the following conditions
|
||||
* are met:
|
||||
*
|
||||
* 1. Redistributions of source code must retain the above copyright
|
||||
* notice, this list of conditions and the following disclaimer.
|
||||
* 2. Redistributions in binary form must reproduce the above copyright
|
||||
* notice, this list of conditions and the following disclaimer in
|
||||
* the documentation and/or other materials provided with the
|
||||
* distribution.
|
||||
* 3. Neither the name Gregory Nutt nor the names of its contributors may be
|
||||
* used to endorse or promote products derived from this software
|
||||
* without specific prior written permission.
|
||||
*
|
||||
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
|
||||
* "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
|
||||
* LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
|
||||
* FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
|
||||
* COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
|
||||
* INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
|
||||
* BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
|
||||
* OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
|
||||
* AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
|
||||
* LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN
|
||||
* ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
|
||||
* POSSIBILITY OF SUCH DAMAGE.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
#ifndef __INCLUDE_NUTTX_NET_TELNET_H
|
||||
#define __INCLUDE_NUTTX_NET_TELNET_H
|
||||
|
||||
/****************************************************************************
|
||||
* Included Files
|
||||
****************************************************************************/
|
||||
|
||||
#include <nuttx/config.h>
|
||||
|
||||
/****************************************************************************
|
||||
* Public Functions
|
||||
****************************************************************************/
|
||||
|
||||
/****************************************************************************
|
||||
* Name: telnet_driver
|
||||
*
|
||||
* Description:
|
||||
* Create a character driver to "wrap" the telnet session. This function
|
||||
* will select and return a unique path for the new telnet device.
|
||||
*
|
||||
* Parameters:
|
||||
* sd - The socket descriptor that represents the new telnet connection.
|
||||
*
|
||||
* Return:
|
||||
* An allocated string represent the full path to the created driver. The
|
||||
* receiver of the string must de-allocate this memory when it is no longer
|
||||
* needed. NULL is returned on a failure.
|
||||
*
|
||||
****************************************************************************/
|
||||
|
||||
FAR char *telnet_driver(int sd);
|
||||
|
||||
#endif /* __INCLUDE_NUTTX_NET_TELNET_H */
|
||||
|
||||
Reference in New Issue
Block a user