⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 httpserv.lis

📁 单片机C语言程序设计实训100例--基于AVR+PROTEUS仿真
💻 LIS
📖 第 1 页 / 共 5 页
字号:
                        .module httpserv.c
                        .area text(rom, con, rel)
 0000                   .dbfile C:\ethernut-4.9.7\nutapp_13h\httpd\httpserv.c
                        .area data(ram, con, rel)
 0000                   .dbfile C:\ethernut-4.9.7\nutapp_13h\httpd\httpserv.c
 0000           _html_mt:
 0000                   .blkw 1
                        .area idata
 0000 4C03              .word L2
                        .area data(ram, con, rel)
 0002                   .dbfile C:\ethernut-4.9.7\nutapp_13h\httpd\httpserv.c
 0002                   .dbsym s html_mt _html_mt pc
                        .area text(rom, con, rel)
 0000                   .dbfile C:\ethernut-4.9.7\nutapp_13h\httpd\httpserv.c
 0000                   .dbfunc s ASPCallback _ASPCallback fI
 0000                   .dbstruct 0 0 __iobuf
 0000                   .dbend
 0000           ;         stream -> R10,R11
 0000           ;   pASPFunction -> R12,R13
                        .even
 0000           _ASPCallback:
 0000 0E940000          xcall push_xgset003C
 0004 5901              movw R10,R18
 0006 6801              movw R12,R16
 0008                   .dbline -1
 0008                   .dbline 263
 0008           ; /*
 0008           ;  * Copyright (C) 2001-2004 by egnite Software GmbH. All rights reserved.
 0008           ;  *
 0008           ;  * Redistribution and use in source and binary forms, with or without
 0008           ;  * modification, are permitted provided that the following conditions
 0008           ;  * are met:
 0008           ;  *
 0008           ;  * 1. Redistributions of source code must retain the above copyright
 0008           ;  *    notice, this list of conditions and the following disclaimer.
 0008           ;  * 2. Redistributions in binary form must reproduce the above copyright
 0008           ;  *    notice, this list of conditions and the following disclaimer in the
 0008           ;  *    documentation and/or other materials provided with the distribution.
 0008           ;  * 3. Neither the name of the copyright holders nor the names of
 0008           ;  *    contributors may be used to endorse or promote products derived
 0008           ;  *    from this software without specific prior written permission.
 0008           ;  *
 0008           ;  * THIS SOFTWARE IS PROVIDED BY EGNITE SOFTWARE GMBH AND CONTRIBUTORS
 0008           ;  * ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
 0008           ;  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
 0008           ;  * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL EGNITE
 0008           ;  * SOFTWARE GMBH OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
 0008           ;  * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
 0008           ;  * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
 0008           ;  * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
 0008           ;  * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
 0008           ;  * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF
 0008           ;  * THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 0008           ;  * SUCH DAMAGE.
 0008           ;  *
 0008           ;  * For additional information see http://www.ethernut.de/
 0008           ;  *
 0008           ;  */
 0008           ; 
 0008           ; /*!
 0008           ;  * $Log$
 0008           ;  * Revision 1.21  2009/02/18 12:18:58  olereinhardt
 0008           ;  * 2009-02-18  Ole Reinhardt <ole.reinhardt@thermotemp.de>
 0008           ;  *
 0008           ;  *           Fixed compilier warnings. Especialy signedness of char buffers
 0008           ;  *           as well as unused code on arm platform and main functions without
 0008           ;  *           return value
 0008           ;  *
 0008           ;  * Revision 1.20  2009/02/06 15:37:40  haraldkipp
 0008           ;  * Added stack space multiplier and addend. Adjusted stack space.
 0008           ;  *
 0008           ;  * Revision 1.19  2008/07/25 10:20:12  olereinhardt
 0008           ;  * Fixed compiler bug for AVR-ICC and added missing PSTR macro around
 0008           ;  * prog_char strings
 0008           ;  *
 0008           ;  * Revision 1.18  2008/07/17 11:56:20  olereinhardt
 0008           ;  * Updated the webserver demo to show new webserver functions (different cgi
 0008           ;  * pathes with seperate authentication, $QUERY_STRING parameter for ssi
 0008           ;  * included CGIs)
 0008           ;  *
 0008           ;  * Revision 1.17  2008/05/13 19:31:34  thiagocorrea
 0008           ;  * NutHttpSendHeaderBot is marked as deprecated, use NutHttpSendHeaderBottom instead.
 0008           ;  *
 0008           ;  * Revision 1.16  2007/07/17 18:29:30  haraldkipp
 0008           ;  * Server thread names not unique on SAM7X. Fixed by Marti Raudsepp.
 0008           ;  *
 0008           ;  * Revision 1.15  2006/09/07 09:01:36  haraldkipp
 0008           ;  * Discovery registration added.
 0008           ;  * Re-arranged network interface setup to exclude DHCP code from ICCAVR
 0008           ;  * builds and make it work with the demo compiler. Unfinished.
 0008           ;  * Added PHAT file system support. Untested.
 0008           ;  *
 0008           ;  * Revision 1.14  2006/03/02 19:44:03  haraldkipp
 0008           ;  * MMC and PHAT enabled.
 0008           ;  *
 0008           ;  * Revision 1.13  2006/01/11 08:32:57  hwmaier
 0008           ;  * Added explicit type casts to silence a few avr-gcc 3.4.3 warning messages
 0008           ;  *
 0008           ;  * Revision 1.12  2005/11/22 09:14:13  haraldkipp
 0008           ;  * Replaced specific device names by generalized macros.
 0008           ;  *
 0008           ;  * Revision 1.11  2005/10/16 23:22:20  hwmaier
 0008           ;  * Removed unreferenced nutconfig.h include statement
 0008           ;  *
 0008           ;  * Revision 1.10  2005/08/05 11:32:50  olereinhardt
 0008           ;  * Added SSI and ASP sample
 0008           ;  *
 0008           ;  * Revision 1.9  2005/04/05 18:04:17  haraldkipp
 0008           ;  * Support for ARM7 Wolf Board added.
 0008           ;  *
 0008           ;  * Revision 1.8  2005/02/23 04:39:26  hwmaier
 0008           ;  * no message
 0008           ;  *
 0008           ;  * Revision 1.7  2005/02/22 02:44:34  hwmaier
 0008           ;  * Changes to compile as well for AT90CAN128 device.
 0008           ;  *
 0008           ;  * Revision 1.6  2004/12/16 10:17:18  haraldkipp
 0008           ;  * Added Mikael Adolfsson's excellent parameter parsing routines.
 0008           ;  *
 0008           ;  * Revision 1.5  2004/03/16 16:48:26  haraldkipp
 0008           ;  * Added Jan Dubiec's H8/300 port.
 0008           ;  *
 0008           ;  * Revision 1.4  2003/11/04 17:46:52  haraldkipp
 0008           ;  * Adapted to Ethernut 2
 0008           ;  *
 0008           ;  * Revision 1.3  2003/09/29 16:33:12  haraldkipp
 0008           ;  * Using portable strtok and strtok_r
 0008           ;  *
 0008           ;  * Revision 1.2  2003/08/07 08:27:58  haraldkipp
 0008           ;  * Bugfix, remote not displayed in socket list
 0008           ;  *
 0008           ;  * Revision 1.1  2003/07/20 15:56:14  haraldkipp
 0008           ;  * *** empty log message ***
 0008           ;  *
 0008           ;  */
 0008           ; 
 0008           ; /*!
 0008           ;  * \example httpd/httpserv.c
 0008           ;  *
 0008           ;  * Simple multithreaded HTTP daemon.
 0008           ;  */
 0008           ; 
 0008           ; /* 
 0008           ;  * Unique MAC address of the Ethernut Board. 
 0008           ;  *
 0008           ;  * Ignored if EEPROM contains a valid configuration.
 0008           ;  */
 0008           ; #define MY_MAC  "\x00\x06\x98\x30\x00\x35"
 0008           ; 
 0008           ; /* 
 0008           ;  * Unique IP address of the Ethernut Board. 
 0008           ;  *
 0008           ;  * Ignored if DHCP is used. 
 0008           ;  */
 0008           ; #define MY_IPADDR "192.168.192.35"
 0008           ; 
 0008           ; /* 
 0008           ;  * IP network mask of the Ethernut Board.
 0008           ;  *
 0008           ;  * Ignored if DHCP is used. 
 0008           ;  */
 0008           ; #define MY_IPMASK "255.255.255.0"
 0008           ; 
 0008           ; /* 
 0008           ;  * Gateway IP address for the Ethernut Board.
 0008           ;  *
 0008           ;  * Ignored if DHCP is used. 
 0008           ;  */
 0008           ; #define MY_IPGATE "192.168.192.1"
 0008           ; 
 0008           ; /* ICCAVR Demo is limited. Try to use the bare minimum. */
 0008           ; #if !defined(__IMAGECRAFT__)
 0008           ; 
 0008           ; /* Wether we should use DHCP. */
 0008           ; #define USE_DHCP
 0008           ; /* Wether we should run a discovery responder. */
 0008           ; #define USE_DISCOVERY
 0008           ; /* Wether to use PHAT file system. */
 0008           ; //#define USE_PHAT
 0008           ; 
 0008           ; #endif /* __IMAGECRAFT__ */
 0008           ; 
 0008           ; 
 0008           ; #ifdef USE_PHAT
 0008           ; 
 0008           ; #if defined(ETHERNUT3)
 0008           ; 
 0008           ; /* Ethernut 3 file system. */
 0008           ; #define MY_FSDEV       devPhat0
 0008           ; #define MY_FSDEV_NAME  "PHAT0" 
 0008           ; 
 0008           ; /* Ethernut 3 block device interface. */
 0008           ; #define MY_BLKDEV      devNplMmc0
 0008           ; #define MY_BLKDEV_NAME "MMC0"
 0008           ; 
 0008           ; #elif defined(AT91SAM7X_EK)
 0008           ; 
 0008           ; /* SAM7X-EK file system. */
 0008           ; #define MY_FSDEV       devPhat0
 0008           ; #define MY_FSDEV_NAME  "PHAT0" 
 0008           ; 
 0008           ; /* SAM7X-EK block device interface. */
 0008           ; #define MY_BLKDEV      devAt91SpiMmc0
 0008           ; #define MY_BLKDEV_NAME "MMC0"
 0008           ; 
 0008           ; #elif defined(AT91SAM9260_EK)
 0008           ; 
 0008           ; /* SAM9260-EK file system. */
 0008           ; #define MY_FSDEV       devPhat0
 0008           ; #define MY_FSDEV_NAME  "PHAT0" 
 0008           ; 
 0008           ; /* SAM9260-EK block device interface. */
 0008           ; #define MY_BLKDEV      devAt91Mci0
 0008           ; #define MY_BLKDEV_NAME "MCI0"
 0008           ; 
 0008           ; #endif
 0008           ; #endif /* USE_PHAT */
 0008           ; 
 0008           ; #ifndef MY_FSDEV
 0008           ; #define MY_FSDEV        devUrom
 0008           ; #endif
 0008           ; 
 0008           ; #ifdef MY_FSDEV_NAME
 0008           ; #define MY_HTTPROOT     MY_FSDEV_NAME ":/" 
 0008           ; #endif
 0008           ; 
 0008           ; 
 0008           ; #include <cfg/os.h>
 0008           ; 
 0008           ; #include <string.h>
 0008           ; #include <io.h>
 0008           ; #include <fcntl.h>
 0008           ; #include <time.h>
 0008           ; 
 0008           ; #include <dev/board.h>
 0008           ; #include <dev/urom.h>
 0008           ; #include <dev/nplmmc.h>
 0008           ; #include <dev/sbimmc.h>
 0008           ; #include <fs/phatfs.h>
 0008           ; 
 0008           ; #include <sys/version.h>
 0008           ; #include <sys/thread.h>
 0008           ; #include <sys/timer.h>
 0008           ; #include <sys/heap.h>
 0008           ; #include <sys/confnet.h>
 0008           ; #include <sys/socket.h>
 0008           ; 
 0008           ; #include <arpa/inet.h>
 0008           ; #include <net/route.h>
 0008           ; 
 0008           ; #include <pro/httpd.h>
 0008           ; #include <pro/dhcp.h>
 0008           ; #include <pro/ssi.h>
 0008           ; #include <pro/asp.h>
 0008           ; #include <pro/discover.h>
 0008           ; 
 0008           ; #ifdef NUTDEBUG
 0008           ; #include <sys/osdebug.h>
 0008           ; #include <net/netdebug.h>
 0008           ; #endif
 0008           ; 
 0008           ; /* Server thread stack size. */
 0008           ; #ifndef HTTPD_SERVICE_STACK
 0008           ; #if defined(__AVR__)
 0008           ; #define HTTPD_SERVICE_STACK ((580 * NUT_THREAD_STACK_MULT) + NUT_THREAD_STACK_ADD)
 0008           ; #elif defined(__arm__)
 0008           ; #define HTTPD_SERVICE_STACK ((1024 * NUT_THREAD_STACK_MULT) + NUT_THREAD_STACK_ADD)
 0008           ; #else
 0008           ; #define HTTPD_SERVICE_STACK  ((2048 * NUT_THREAD_STACK_MULT) + NUT_THREAD_STACK_ADD)
 0008           ; #endif
 0008           ; #endif
 0008           ; 
 0008           ; static char *html_mt = "text/html";
 0008           ; 
 0008           ; 
 0008           ; /**************************************************************/
 0008           ; /*  ASPCallback                                               */
 0008           ; /*                                                            */
 0008           ; /* This routine must have been registered by                  */
 0008           ; /* NutRegisterAspCallback() and is automatically called by    */
 0008           ; /* NutHttpProcessFileRequest() when the server process a page */
 0008           ; /* with an asp function.                                      */
 0008           ; /*                                                            */
 0008           ; /* Return 0 on success, -1 otherwise.                         */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -