00001 /*############################################################################## 00002 00003 nIP - Testapplication 00004 00005 File : telnet.h 00006 00007 Description : Simple Telnet Application to test TCP 00008 00009 Copyright notice: 00010 00011 Copyright (C) 2005 - 00012 Andreas Dittrich, dittrich@informatik.hu-berlin.de 00013 Jon Kowal, kowal@informatik.hu-berlin.de 00014 00015 This program is free software; you can redistribute it and/or 00016 modify it under the terms of the GNU General Public License 00017 as published by the Free Software Foundation; either version 2 00018 of the License, or (at your option) any later version. 00019 00020 This program is distributed in the hope that it will be useful, 00021 but WITHOUT ANY WARRANTY; without even the implied warranty of 00022 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00023 GNU General Public License for more details. 00024 00025 You should have received a copy of the GNU General Public License 00026 along with this program; if not, write to the Free Software 00027 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 00028 00029 ##############################################################################*/ 00030 00031 #ifndef _HTTPD_H 00032 #define _HTTPD_H 00033 00034 #include "globals.h" 00035 #include "stdint.h" 00036 00037 00038 #ifndef HTTPD_ENABLE 00039 #define HTTPD_ENABLE 1 00040 #endif 00041 00042 #define HTTP_PARSER_COUNT 3 00043 00044 #define HTTP_ADDR_PARSER 1 /* until what index address are being parsed */ 00045 #define HTTP_NL_PARSER 2 /* index of newline parser */ 00046 00047 typedef enum 00048 { 00049 HTTP_STAT_ADDR, 00050 HTTP_STAT_GOTONL, 00051 HTTP_STAT_200, 00052 HTTP_STAT_501, 00053 HTTP_STAT_404, 00054 HTTP_STAT_CLOSE 00055 } 00056 http_state_t; 00057 00058 struct http_parser 00059 { 00060 uint8_t pos; 00061 uint8_t sz; 00062 uint8_t *s; 00063 }; 00064 00065 void httpd_start( void ); 00066 void httpd_check( void ); 00067 00068 #endif /* _TELNET_H */