2 * \addtogroup telnetd
\r
8 * Header file for the telnet server.
\r
9 * \author Adam Dunkels <adam@dunkels.com>
\r
13 * Copyright (c) 2002, Adam Dunkels.
\r
14 * All rights reserved.
\r
16 * Redistribution and use in source and binary forms, with or without
\r
17 * modification, are permitted provided that the following conditions
\r
19 * 1. Redistributions of source code must retain the above copyright
\r
20 * notice, this list of conditions and the following disclaimer.
\r
21 * 2. Redistributions in binary form must reproduce the above copyright
\r
22 * notice, this list of conditions and the following disclaimer in the
\r
23 * documentation and/or other materials provided with the distribution.
\r
24 * 3. The name of the author may not be used to endorse or promote
\r
25 * products derived from this software without specific prior
\r
26 * written permission.
\r
28 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
\r
29 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
\r
30 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
\r
31 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
\r
32 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
\r
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
\r
34 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
\r
35 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
\r
36 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
\r
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
\r
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
\r
40 * This file is part of the uIP TCP/IP stack.
\r
42 * $Id: telnetd.h,v 1.1.2.2 2003/10/07 13:22:27 adam Exp $
\r
45 #ifndef __TELNETD_H__
\r
46 #define __TELNETD_H__
\r
51 * The maximum length of a telnet line.
\r
55 #define TELNETD_LINELEN 36
\r
58 * The number of output lines being buffered for all telnet
\r
63 #define TELNETD_NUMLINES 2
\r
66 * A telnet connection structure.
\r
68 struct telnetd_state {
\r
69 char *lines[TELNETD_NUMLINES];
\r
70 char buf[TELNETD_LINELEN];
\r
77 * Callback function that is called when a telnet connection has been
\r
80 * \param s The telnet connection.
\r
82 void telnetd_connected(struct telnetd_state *s);
\r
85 * Callback function that is called when a line of text has arrived on
\r
86 * a telnet connection.
\r
88 * \param s The telnet connection.
\r
90 * \param cmd The line of text.
\r
92 void telnetd_input(struct telnetd_state *s, char *cmd);
\r
95 void telnetd_close(struct telnetd_state *s);
\r
96 void telnetd_output(struct telnetd_state *s, char *s1, char *s2);
\r
97 void telnetd_prompt(struct telnetd_state *s, char *str);
\r
99 void telnetd_app(void);
\r
101 #ifndef UIP_APPCALL
\r
102 #define UIP_APPCALL telnetd_app
\r
105 #ifndef UIP_APPSTATE_SIZE
\r
106 #define UIP_APPSTATE_SIZE (sizeof(struct telnetd_state))
\r
109 void telnetd_init(void);
\r
112 #endif /* __TELNET_H__ */
\r