]> git.sur5r.net Git - freertos/blob - FreeRTOS/Demo/uIP_Demo_IAR_ARM7/uip/telnetd.h
Add FreeRTOS-Plus directory.
[freertos] / FreeRTOS / Demo / uIP_Demo_IAR_ARM7 / uip / telnetd.h
1 /**\r
2  * \addtogroup telnetd\r
3  * @{\r
4  */\r
5 \r
6 /**\r
7  * \file\r
8  * Header file for the telnet server.\r
9  * \author Adam Dunkels <adam@dunkels.com>\r
10  */\r
11 \r
12 /*\r
13  * Copyright (c) 2002, Adam Dunkels.\r
14  * All rights reserved. \r
15  *\r
16  * Redistribution and use in source and binary forms, with or without \r
17  * modification, are permitted provided that the following conditions \r
18  * are met: \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
27  *\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
39  *\r
40  * This file is part of the uIP TCP/IP stack.\r
41  *\r
42  * $Id: telnetd.h,v 1.1.2.2 2003/10/07 13:22:27 adam Exp $\r
43  *\r
44  */\r
45 #ifndef __TELNETD_H__\r
46 #define __TELNETD_H__\r
47 \r
48 #include "uip.h"\r
49 \r
50 /**\r
51  * The maximum length of a telnet line.\r
52  *\r
53  * \hideinitializer\r
54  */\r
55 #define TELNETD_LINELEN 36\r
56 \r
57 /**\r
58  * The number of output lines being buffered for all telnet\r
59  * connections.\r
60  *\r
61  * \hideinitializer\r
62  */\r
63 #define TELNETD_NUMLINES 2\r
64 \r
65 /**\r
66  * A telnet connection structure.\r
67  */\r
68 struct telnetd_state {\r
69   char *lines[TELNETD_NUMLINES];\r
70   char buf[TELNETD_LINELEN];\r
71   char bufptr;\r
72   u8_t state;\r
73 };\r
74 \r
75 \r
76 /**\r
77  * Callback function that is called when a telnet connection has been\r
78  * established.\r
79  *\r
80  * \param s The telnet connection. \r
81  */\r
82 void telnetd_connected(struct telnetd_state *s);\r
83 \r
84 /**\r
85  * Callback function that is called when a line of text has arrived on\r
86  * a telnet connection.\r
87  *\r
88  * \param s The telnet connection.\r
89  *\r
90  * \param cmd The line of text.\r
91  */\r
92 void telnetd_input(struct telnetd_state *s, char *cmd);\r
93 \r
94 \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
98 \r
99 void telnetd_app(void);\r
100 \r
101 #ifndef UIP_APPCALL\r
102 #define UIP_APPCALL     telnetd_app\r
103 #endif\r
104 \r
105 #ifndef UIP_APPSTATE_SIZE\r
106 #define UIP_APPSTATE_SIZE (sizeof(struct telnetd_state))\r
107 #endif\r
108 \r
109 void telnetd_init(void);\r
110 \r
111 \r
112 #endif /* __TELNET_H__ */\r
113 \r
114 /** @} */\r