cgi.lis

来自「uIP是免费的TCP/IP协议栈,我们将它移植到我们的AVR以太网开发板中」· LIS 代码 · 共 899 行 · 第 1/3 页

LIS
899
字号
                        .module cgi.c
                        .area data(ram, con, rel)
 0000           _cgitab::
 0000                   .blkw 1
                        .area idata
 0000 0400              .word PL_print_stats
                        .area data(ram, con, rel)
 0002                   .blkw 1
                        .area idata
 0002 0200              .word PL_file_stats
                        .area data(ram, con, rel)
 0004                   .blkw 1
                        .area idata
 0004 0000              .word PL_tcp_stats
                        .area data(ram, con, rel)
 0006                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0006                   .dbsym e cgitab _cgitab A[6:3]pfc
                        .area lit(rom, con, rel)
 0000           _closed:
 0000 434C              .byte 'C,'L
 0002 4F53              .byte 'O,'S
 0004 4544              .byte 'E,'D
 0006 00                .byte 0
 0007                   .dbsym s closed _closed A[7:7]kc
 0007           _syn_rcvd:
 0007 5359              .byte 'S,'Y
 0009 4E2D              .byte 'N,45
 000B 5243              .byte 'R,'C
 000D 5644              .byte 'V,'D
 000F 00                .byte 0
 0010                   .dbsym s syn_rcvd _syn_rcvd A[9:9]kc
 0010           _syn_sent:
 0010 5359              .byte 'S,'Y
 0012 4E2D              .byte 'N,45
 0014 5345              .byte 'S,'E
 0016 4E54              .byte 'N,'T
 0018 00                .byte 0
 0019                   .dbsym s syn_sent _syn_sent A[9:9]kc
 0019           _established:
 0019 4553              .byte 'E,'S
 001B 5441              .byte 'T,'A
 001D 424C              .byte 'B,'L
 001F 4953              .byte 'I,'S
 0021 4845              .byte 'H,'E
 0023 4400              .byte 'D,0
 0025                   .dbsym s established _established A[12:12]kc
 0025           _fin_wait_1:
 0025 4649              .byte 'F,'I
 0027 4E2D              .byte 'N,45
 0029 5741              .byte 'W,'A
 002B 4954              .byte 'I,'T
 002D 2D31              .byte 45,49
 002F 00                .byte 0
 0030                   .dbsym s fin_wait_1 _fin_wait_1 A[11:11]kc
 0030           _fin_wait_2:
 0030 4649              .byte 'F,'I
 0032 4E2D              .byte 'N,45
 0034 5741              .byte 'W,'A
 0036 4954              .byte 'I,'T
 0038 2D32              .byte 45,50
 003A 00                .byte 0
 003B                   .dbsym s fin_wait_2 _fin_wait_2 A[11:11]kc
 003B           _closing:
 003B 434C              .byte 'C,'L
 003D 4F53              .byte 'O,'S
 003F 494E              .byte 'I,'N
 0041 4700              .byte 'G,0
 0043                   .dbsym s closing _closing A[8:8]kc
 0043           _time_wait:
 0043 5449              .byte 'T,'I
 0045 4D45              .byte 'M,'E
 0047 2D57              .byte 45,'W
 0049 4149              .byte 'A,'I
 004B 5400              .byte 'T,0
 004D                   .dbsym s time_wait _time_wait A[10:10]kc
 004D           _last_ack:
 004D 4C41              .byte 'L,'A
 004F 5354              .byte 'S,'T
 0051 2D41              .byte 45,'A
 0053 434B              .byte 'C,'K
 0055 00                .byte 0
 0056                   .dbsym s last_ack _last_ack A[9:9]kc
                        .area data(ram, con, rel)
 0006                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0006           _states:
 0006                   .blkw 1
                        .area idata
 0006 0000              .word _closed
                        .area data(ram, con, rel)
 0008                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0008                   .blkw 1
                        .area idata
 0008 0700              .word _syn_rcvd
                        .area data(ram, con, rel)
 000A                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 000A                   .blkw 1
                        .area idata
 000A 1000              .word _syn_sent
                        .area data(ram, con, rel)
 000C                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 000C                   .blkw 1
                        .area idata
 000C 1900              .word _established
                        .area data(ram, con, rel)
 000E                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 000E                   .blkw 1
                        .area idata
 000E 2500              .word _fin_wait_1
                        .area data(ram, con, rel)
 0010                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0010                   .blkw 1
                        .area idata
 0010 3000              .word _fin_wait_2
                        .area data(ram, con, rel)
 0012                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0012                   .blkw 1
                        .area idata
 0012 3B00              .word _closing
                        .area data(ram, con, rel)
 0014                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0014                   .blkw 1
                        .area idata
 0014 4300              .word _time_wait
                        .area data(ram, con, rel)
 0016                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0016                   .blkw 1
                        .area idata
 0016 4D00              .word _last_ack
                        .area data(ram, con, rel)
 0018                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0018                   .dbsym s states _states A[18:9]pkc
                        .area text(rom, con, rel)
 0000                   .dbfile D:\hexok项目\AVRNET项目\AVRNET光盘\AVRuIP\cgi.c
 0000                   .dbfunc s print_stats _print_stats fc
 0000           ;              j -> R12,R13
 0000           ;      databytes -> y+2
 0000           ;              i -> R14,R15
 0000           ;            buf -> R10,R11
 0000           ;           next -> R10
                        .even
 0000           _print_stats:
 0000 0E940000          xcall push_gset5x
 0004 A02E              mov R10,R16
 0006 2497              sbiw R28,4
 0008                   .dbline -1
 0008                   .dbline 120
 0008           ; /**
 0008           ;  * \addtogroup httpd
 0008           ;  * @{
 0008           ;  */
 0008           ; 
 0008           ; /**
 0008           ;  * \file
 0008           ;  * HTTP server script language C functions file.
 0008           ;  * \author Adam Dunkels <adam@dunkels.com>
 0008           ;  *
 0008           ;  * This file contains functions that are called by the web server
 0008           ;  * scripts. The functions takes one argument, and the return value is
 0008           ;  * interpreted as follows. A zero means that the function did not
 0008           ;  * complete and should be invoked for the next packet as well. A
 0008           ;  * non-zero value indicates that the function has completed and that
 0008           ;  * the web server should move along to the next script line.
 0008           ;  *
 0008           ;  */
 0008           ; 
 0008           ; /*
 0008           ;  * Copyright (c) 2001, Adam Dunkels.
 0008           ;  * 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           ;  * 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. The name of the author may not be used to endorse or promote
 0008           ;  *    products derived from this software without specific prior
 0008           ;  *    written permission.  
 0008           ;  *
 0008           ;  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 0008           ;  * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 0008           ;  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 0008           ;  * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 0008           ;  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 0008           ;  * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 0008           ;  * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 0008           ;  * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 0008           ;  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 0008           ;  * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 0008           ;  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
 0008           ;  *
 0008           ;  * This file is part of the uIP TCP/IP stack.
 0008           ;  *
 0008           ;  * $Id: cgi.c,v 1.23.2.4 2003/10/07 13:22:27 adam Exp $
 0008           ;  *
 0008           ;  */
 0008           ; 
 0008           ; #include "uip.h"
 0008           ; #include "cgi.h"
 0008           ; #include "httpd.h"
 0008           ; #include "fs.h"
 0008           ; 
 0008           ; #include <stdio.h>
 0008           ; #include <string.h>
 0008           ; 
 0008           ; static u8_t print_stats(u8_t next);
 0008           ; static u8_t file_stats(u8_t next);
 0008           ; static u8_t tcp_stats(u8_t next);
 0008           ; 
 0008           ; cgifunction cgitab[] = {
 0008           ;   print_stats,   /* CGI function "a" */
 0008           ;   file_stats,    /* CGI function "b" */
 0008           ;   tcp_stats      /* CGI function "c" */
 0008           ; };
 0008           ; 
 0008           ; static const char closed[] =   /*  "CLOSED",*/
 0008           ; {0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0};
 0008           ; static const char syn_rcvd[] = /*  "SYN-RCVD",*/
 0008           ; {0x53, 0x59, 0x4e, 0x2d, 0x52, 0x43, 0x56, 
 0008           ;  0x44,  0};
 0008           ; static const char syn_sent[] = /*  "SYN-SENT",*/
 0008           ; {0x53, 0x59, 0x4e, 0x2d, 0x53, 0x45, 0x4e, 
 0008           ;  0x54,  0};
 0008           ; static const char established[] = /*  "ESTABLISHED",*/
 0008           ; {0x45, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x49, 0x53, 0x48, 
 0008           ;  0x45, 0x44, 0};
 0008           ; static const char fin_wait_1[] = /*  "FIN-WAIT-1",*/
 0008           ; {0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49, 
 0008           ;  0x54, 0x2d, 0x31, 0};
 0008           ; static const char fin_wait_2[] = /*  "FIN-WAIT-2",*/
 0008           ; {0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49, 
 0008           ;  0x54, 0x2d, 0x32, 0};
 0008           ; static const char closing[] = /*  "CLOSING",*/
 0008           ; {0x43, 0x4c, 0x4f, 0x53, 0x49, 
 0008           ;  0x4e, 0x47, 0};
 0008           ; static const char time_wait[] = /*  "TIME-WAIT,"*/
 0008           ; {0x54, 0x49, 0x4d, 0x45, 0x2d, 0x57, 0x41, 
 0008           ;  0x49, 0x54, 0};
 0008           ; static const char last_ack[] = /*  "LAST-ACK"*/
 0008           ; {0x4c, 0x41, 0x53, 0x54, 0x2d, 0x41, 0x43, 
 0008           ;  0x4b, 0};
 0008           ; 
 0008           ; static const char *states[] = {
 0008           ;   closed,
 0008           ;   syn_rcvd,
 0008           ;   syn_sent,
 0008           ;   established,
 0008           ;   fin_wait_1,
 0008           ;   fin_wait_2,
 0008           ;   closing,
 0008           ;   time_wait,
 0008           ;   last_ack};
 0008           ;   
 0008           ; 
 0008           ; /*-----------------------------------------------------------------------------------*/
 0008           ; /* print_stats:
 0008           ;  *
 0008           ;  * Prints out a part of the uIP statistics. The statistics data is
 0008           ;  * written into the uip_appdata buffer. It overwrites any incoming
 0008           ;  * packet.
 0008           ;  */
 0008           ; static u8_t
 0008           ; print_stats(u8_t next)
 0008           ; {
 0008                   .dbline 126
 0008           ; #if UIP_STATISTICS
 0008           ;   u16_t i, j;
 0008           ;   u8_t *buf;
 0008           ;   u16_t *databytes;
 0008           ;   
 0008           ;   if(next) {
 0008 AA20              tst R10
 000A B9F0              breq L8
 000C                   .dbline 126
 000C                   .dbline 129
 000C           ;     /* If our last data has been acknowledged, we move on the next
 000C           ;        chunk of statistics. */
 000C           ;     hs->count = hs->count + 4;
 000C 80910000          lds R24,_hs
 0010 90910100          lds R25,_hs+1
 0014 0196              adiw R24,1
 0016 FC01              movw R30,R24
 0018 8081              ldd R24,z+0
 001A 9181              ldd R25,z+1
 001C 0496              adiw R24,4
 001E 9183              std z+1,R25
 0020 8083              std z+0,R24
 0022                   .dbline 130
 0022           ;     if(hs->count >= sizeof(struct uip_stats)/sizeof(u16_t)) {
 0022 E0910000          lds R30,_hs
 0026 F0910100          lds R31,_hs+1
 002A 8181              ldd R24,z+1
 002C 9281              ldd R25,z+2
 002E 8631              cpi R24,22
 0030 E0E0              ldi R30,0
 0032 9E07              cpc R25,R30
 0034 10F0              brlo L10
 0036                   .dbline 130

⌨️ 快捷键说明

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