亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cgi.c

?? freertosV4.40 是一種small的嵌入式系統。利于嵌入式開好者入門學習嵌入式操作系統。通過對于源碼的學習可以很好的掌握freertos的運行機制。
?? C
字號:
/**
 * \addtogroup httpd
 * @{
 */

/**
 * \file
 * HTTP server script language C functions file.
 * \author Adam Dunkels <adam@dunkels.com>
 *
 * This file contains functions that are called by the web server
 * scripts. The functions takes one argument, and the return value is
 * interpreted as follows. A zero means that the function did not
 * complete and should be invoked for the next packet as well. A
 * non-zero value indicates that the function has completed and that
 * the web server should move along to the next script line.
 *
 */

/*
 * Copyright (c) 2001, Adam Dunkels.
 * All rights reserved. 
 *
 * Redistribution and use in source and binary forms, with or without 
 * modification, are permitted provided that the following conditions 
 * are met: 
 * 1. Redistributions of source code must retain the above copyright 
 *    notice, this list of conditions and the following disclaimer. 
 * 2. Redistributions in binary form must reproduce the above copyright 
 *    notice, this list of conditions and the following disclaimer in the 
 *    documentation and/or other materials provided with the distribution. 
 * 3. The name of the author may not be used to endorse or promote
 *    products derived from this software without specific prior
 *    written permission.  
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.  
 *
 * This file is part of the uIP TCP/IP stack.
 *
 * $Id: cgi.c,v 1.23.2.4 2003/10/07 13:22:27 adam Exp $
 *
 */

#include "uip.h"
#include "cgi.h"
#include "httpd.h"
#include "fs.h"

#include <stdio.h>
#include <string.h>

static u8_t print_stats(u8_t next);
static u8_t file_stats(u8_t next);
static u8_t tcp_stats(u8_t next);

cgifunction cgitab[] = {
  print_stats,   /* CGI function "a" */
  file_stats,    /* CGI function "b" */
  tcp_stats      /* CGI function "c" */
};

static const char closed[] =   /*  "CLOSED",*/
{0x43, 0x4c, 0x4f, 0x53, 0x45, 0x44, 0};
static const char syn_rcvd[] = /*  "SYN-RCVD",*/
{0x53, 0x59, 0x4e, 0x2d, 0x52, 0x43, 0x56, 
 0x44,  0};
static const char syn_sent[] = /*  "SYN-SENT",*/
{0x53, 0x59, 0x4e, 0x2d, 0x53, 0x45, 0x4e, 
 0x54,  0};
static const char established[] = /*  "ESTABLISHED",*/
{0x45, 0x53, 0x54, 0x41, 0x42, 0x4c, 0x49, 0x53, 0x48, 
 0x45, 0x44, 0};
static const char fin_wait_1[] = /*  "FIN-WAIT-1",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49, 
 0x54, 0x2d, 0x31, 0};
static const char fin_wait_2[] = /*  "FIN-WAIT-2",*/
{0x46, 0x49, 0x4e, 0x2d, 0x57, 0x41, 0x49, 
 0x54, 0x2d, 0x32, 0};
static const char closing[] = /*  "CLOSING",*/
{0x43, 0x4c, 0x4f, 0x53, 0x49, 
 0x4e, 0x47, 0};
static const char time_wait[] = /*  "TIME-WAIT,"*/
{0x54, 0x49, 0x4d, 0x45, 0x2d, 0x57, 0x41, 
 0x49, 0x54, 0};
static const char last_ack[] = /*  "LAST-ACK"*/
{0x4c, 0x41, 0x53, 0x54, 0x2d, 0x41, 0x43, 
 0x4b, 0};

static const char *states[] = {
  closed,
  syn_rcvd,
  syn_sent,
  established,
  fin_wait_1,
  fin_wait_2,
  closing,
  time_wait,
  last_ack};
  

/*-----------------------------------------------------------------------------------*/
/* print_stats:
 *
 * Prints out a part of the uIP statistics. The statistics data is
 * written into the uip_appdata buffer. It overwrites any incoming
 * packet.
 */
static u8_t
print_stats(u8_t next)
{
#if UIP_STATISTICS
  u16_t i, j;
  u8_t *buf;
  u16_t *databytes;
  
  if(next) {
    /* If our last data has been acknowledged, we move on the next
       chunk of statistics. */
    hs->count = hs->count + 4;
    if(hs->count >= sizeof(struct uip_stats)/sizeof(u16_t)) {
      /* We have printed out all statistics, so we return 1 to
	 indicate that we are done. */
      return 1;
    }
  }

  /* Write part of the statistics into the uip_appdata buffer. */
  databytes = (u16_t *)&uip_stat + hs->count;
  buf       = (u8_t *)uip_appdata;

  j = 4 + 1;
  i = hs->count;
  while (i < sizeof(struct uip_stats)/sizeof(u16_t) && --j > 0) {
    sprintf((char *)buf, "%5u\r\n", *databytes);
    ++databytes;
    buf += 6;
    ++i;
  }

  /* Send the data. */
  uip_send(uip_appdata, buf - uip_appdata);
  
  return 0;
#else
  return 1;
#endif /* UIP_STATISTICS */
}
/*-----------------------------------------------------------------------------------*/
static u8_t
file_stats(u8_t next)
{
  /* We use sprintf() to print the number of file accesses to a
     particular file (given as an argument to the function in the
     script). We then use uip_send() to actually send the data. */
  if(next) {
    return 1;
  }
  uip_send(uip_appdata, sprintf((char *)uip_appdata, "%5u", fs_count(&hs->script[4])));  
  return 0;
}
/*-----------------------------------------------------------------------------------*/
static u8_t
tcp_stats(u8_t next)
{
  struct uip_conn *conn;  

  if(next) {
    /* If the previously sent data has been acknowledged, we move
       forward one connection. */
    if(++hs->count == UIP_CONNS) {
      /* If all connections has been printed out, we are done and
	 return 1. */
      return 1;
    }
  }
  
  conn = &uip_conns[hs->count];
  if((conn->tcpstateflags & TS_MASK) == CLOSED) {
    uip_send(uip_appdata, sprintf((char *)uip_appdata,
				  "<tr align=\"center\"><td>-</td><td>-</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
				  conn->nrtx,
				  conn->timer,
				  (uip_outstanding(conn))? '*':' ',
    				  (uip_stopped(conn))? '!':' '));
  } else {
    uip_send(uip_appdata, sprintf((char *)uip_appdata,
				  "<tr align=\"center\"><td>%u.%u.%u.%u:%u</td><td>%s</td><td>%u</td><td>%u</td><td>%c %c</td></tr>\r\n",
				  htons(conn->ripaddr[0]) >> 8,
				  htons(conn->ripaddr[0]) & 0xff,
				  htons(conn->ripaddr[1]) >> 8,
				  htons(conn->ripaddr[1]) & 0xff,
				  htons(conn->rport),
				  states[conn->tcpstateflags & TS_MASK],
				  conn->nrtx,
				  conn->timer,
				  (uip_outstanding(conn))? '*':' ',
    				  (uip_stopped(conn))? '!':' '));
  }
  return 0;
}
/*-----------------------------------------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产精品精华液ab| 亚洲国产精品综合小说图片区| 精品视频在线视频| 成人动漫中文字幕| 三级久久三级久久久| 亚洲欧美日韩国产综合| 国产精品视频看| 国产精品久久久久影视| 国产亚洲欧美激情| 中文字幕乱码亚洲精品一区| 欧美va亚洲va香蕉在线 | 日韩一区二区三区免费观看| 91蜜桃免费观看视频| 久久激情综合网| 国产一区二区0| 精品一区二区在线播放| 国产精品一区二区无线| 激情综合色播激情啊| 日韩激情在线观看| 另类小说视频一区二区| 蜜臀av亚洲一区中文字幕| 久久66热re国产| 久久国产精品色婷婷| 国产一区在线精品| 国产成+人+日韩+欧美+亚洲| 国产一区二区电影| 91免费在线看| 在线免费观看日本欧美| 欧美在线观看一区二区| 欧美日本在线播放| 欧美一级二级在线观看| 精品少妇一区二区三区在线播放| 国产亚洲成aⅴ人片在线观看| 国产偷国产偷精品高清尤物| 中文字幕一区二区在线观看| 亚洲女同女同女同女同女同69| 亚洲精品伦理在线| 蜜桃久久久久久久| 国产一区二区看久久| 欧洲精品在线观看| 777午夜精品视频在线播放| 欧美精品亚洲一区二区在线播放| 精品日本一线二线三线不卡| 久久青草欧美一区二区三区| 亚洲欧美国产高清| 日韩成人伦理电影在线观看| 国内精品久久久久影院色| 大胆亚洲人体视频| 欧美性色综合网| 久久久久久久免费视频了| 中文字幕亚洲一区二区va在线| 亚洲成人激情综合网| 色婷婷综合久色| 欧美视频一区二| 久久久99精品免费观看不卡| 日韩伦理av电影| 蜜臀av亚洲一区中文字幕| 国产成人精品亚洲午夜麻豆| 国产91丝袜在线播放0| 欧美亚洲一区二区三区四区| 日韩一区二区在线观看| 亚洲精品v日韩精品| 免费观看久久久4p| 91精彩视频在线| 精品国产伦理网| 亚洲美女在线国产| 成人免费毛片app| 欧美精品18+| 亚洲激情欧美激情| 国内偷窥港台综合视频在线播放| 欧美亚洲国产一卡| 久久久国产精华| 午夜精品久久久久久久久久久| bt7086福利一区国产| 91精品啪在线观看国产60岁| 亚洲人快播电影网| 狠狠色丁香婷综合久久| 6080亚洲精品一区二区| 国产精品久久久久久久蜜臀| 极品少妇xxxx精品少妇偷拍| 91麻豆精品视频| 日韩视频国产视频| 天天综合天天综合色| 99久久精品国产毛片| 26uuu久久综合| 午夜精品久久久| 色婷婷av一区二区三区之一色屋| 久久女同性恋中文字幕| 午夜精品成人在线| 欧美三区在线视频| 1000部国产精品成人观看| 国v精品久久久网| 日韩欧美国产小视频| 亚洲精品欧美激情| av亚洲精华国产精华精| 久久先锋资源网| 国产一区二区三区最好精华液| 欧美日韩一区二区欧美激情| 亚洲综合色网站| 色诱亚洲精品久久久久久| 中文字幕在线一区| 国产成人在线免费| 欧美日韩国产bt| 偷拍一区二区三区四区| 在线一区二区三区四区| 亚洲国产视频一区| 色久优优欧美色久优优| 伊人婷婷欧美激情| 91一区二区在线观看| 久久久青草青青国产亚洲免观| 日本vs亚洲vs韩国一区三区 | 中文字幕中文字幕在线一区| 国产福利91精品| 国产精品免费视频一区| 精品无人码麻豆乱码1区2区 | 国产精品国产三级国产普通话99| 丁香婷婷综合五月| 欧美激情艳妇裸体舞| av在线这里只有精品| 日韩一区欧美小说| 91亚洲精品一区二区乱码| 亚洲女性喷水在线观看一区| 91色乱码一区二区三区| 亚洲人吸女人奶水| 91黄色免费版| 男男成人高潮片免费网站| 91精品国产色综合久久不卡蜜臀 | 3d动漫精品啪啪一区二区竹菊| 欧美一区二区人人喊爽| 卡一卡二国产精品| 欧美精品一区二区三| 成人午夜大片免费观看| 亚洲欧美在线高清| 91精品国产一区二区三区香蕉 | 成人免费看片app下载| 成人久久18免费网站麻豆| 一区二区三区四区在线播放| 欧美性猛交一区二区三区精品| 日韩av电影免费观看高清完整版| 欧美一区二区高清| 国产成人亚洲综合a∨婷婷图片| 中文一区二区完整视频在线观看| www.欧美日韩| 天堂在线亚洲视频| 精品粉嫩超白一线天av| 91亚洲国产成人精品一区二区三 | 中文字幕人成不卡一区| 欧美日本在线看| 狠狠v欧美v日韩v亚洲ⅴ| 综合久久久久久| 欧美日韩精品一区二区三区| 欧美激情一区二区三区四区| 欧美日韩激情一区二区| 裸体一区二区三区| 亚洲精选免费视频| 91精品国产麻豆国产自产在线 | 一区二区三区四区视频精品免费 | 粗大黑人巨茎大战欧美成人| 1024亚洲合集| 精品久久久久久综合日本欧美| 国产成人免费视| 日韩高清一区二区| 日本一区二区三区在线不卡| 欧美放荡的少妇| 国产成人免费在线观看| 亚洲成人免费观看| 国产精品麻豆欧美日韩ww| 91在线国产观看| 国内一区二区视频| 亚洲激情综合网| 国产精品乱码一区二区三区软件| 欧美日韩国产成人在线免费| 99re热视频这里只精品| 另类小说图片综合网| 亚洲第一成人在线| 国产欧美日产一区| 欧美一区二区高清| 色婷婷av一区二区| 亚洲成av人**亚洲成av**| 国产精品久久99| 日韩欧美黄色影院| 欧美日韩免费一区二区三区视频| 国产精品99久久久久久久女警| 亚洲国产成人91porn| 国产精品无遮挡| 国产欧美一区二区精品忘忧草 | 欧美一区二区三区白人| 99久久国产综合精品色伊| 国产99精品视频| 久久97超碰国产精品超碰| 日韩av二区在线播放| 亚洲毛片av在线| 亚洲男同1069视频| 国产欧美精品一区二区色综合| 欧美不卡视频一区| 91超碰这里只有精品国产| 不卡一区二区三区四区| 国产在线乱码一区二区三区| 亚洲一二三四久久| 一区二区三区欧美在线观看|