Skip to content

Commit ab97e2d

Browse files
committed
sys/net/application_layer: add telnet_server
1 parent b173313 commit ab97e2d

4 files changed

Lines changed: 583 additions & 0 deletions

File tree

sys/Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ endif
127127
ifneq (,$(filter sock_dns,$(USEMODULE)))
128128
DIRS += net/application_layer/dns
129129
endif
130+
ifneq (,$(filter telnet_server,$(USEMODULE)))
131+
DIRS += net/application_layer/telnet_server
132+
endif
130133
ifneq (,$(filter constfs,$(USEMODULE)))
131134
DIRS += fs/constfs
132135
endif

sys/include/net/telnet_server.h

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
/*
2+
* Copyright (C) 2019 Thomas Stilwell <stilwellt@openlabs.co>
3+
*
4+
* This file is subject to the terms and conditions of the GNU Lesser
5+
* General Public License v2.1. See the file LICENSE in the top level
6+
* directory for more details.
7+
*/
8+
9+
/**
10+
* @defgroup net_telnet_server telnet server
11+
* @ingroup net
12+
*
13+
* @brief telnet server
14+
*
15+
* @{
16+
*
17+
* @file
18+
* @brief telnet server definitions
19+
*
20+
* @author Thomas Stilwell <stilwellt@openlabs.co>
21+
*/
22+
23+
#ifndef NET_TELNET_SERVER_H
24+
#define NET_TELNET_SERVER_H
25+
26+
#include <errno.h>
27+
#include <stdint.h>
28+
#include <unistd.h>
29+
30+
#include "net/gnrc/tcp.h"
31+
#include "shell.h"
32+
33+
#ifdef __cplusplus
34+
extern "C" {
35+
#endif
36+
37+
/**
38+
* @brief telnet server struct
39+
*/
40+
typedef struct {
41+
uint16_t port;
42+
gnrc_tcp_tcb_t tcb;
43+
const shell_command_t *shell_commands; /* deprecated */
44+
} telnet_server_t;
45+
46+
int telnet_start_server(telnet_server_t * telnet_server);
47+
48+
#ifdef __cplusplus
49+
}
50+
#endif
51+
52+
#endif /* NET_TELNET_SERVER_H */
53+
/** @} */
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
MODULE=telnet_server
2+
include $(RIOTBASE)/Makefile.base

0 commit comments

Comments
 (0)