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

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

?? cgi.c

?? c51版本的uip(一個超小型的TCPIP棧,支持tcpudparpicmp.
?? C
字號:
/*
 * 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. All advertising materials mentioning features or use of this software
 *    must display the following acknowledgement:
 *      This product includes software developed by Adam Dunkels.
 * 4. 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.21 2002/01/13 21:12:40 adam Exp $
 *
 */

/*
 * This file includes functions that are called by the web server
 * scripts. The functions takes no 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.
 *
 */

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

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

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

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

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

static code 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(void)
{
#if UIP_STATISTICS
  u16_t i, j;
  u8_t *buf;
  u16_t *databytes;
  
  if(uip_acked()) {
    /* 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(void)
{
  /* 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(uip_acked()) {
    return 1;
  }
  uip_send(uip_appdata, sprintf((char *)uip_appdata, "%5u", fs_count(&hs->script[4])));  
  return 0;
}
/*-----------------------------------------------------------------------------------*/
static u8_t
tcp_stats(void)
{
  struct uip_conn *conn;  

  if(uip_acked()) {
    /* 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>%d</td><td>%d</td><td>%c %c</td></tr>\r\n",
				  conn->nrtx,
				  conn->timer,
				  (conn->tcpstateflags & UIP_OUTSTANDING)? '*':' ',
    				  (conn->tcpstateflags & UIP_STOPPED)? '!':' '));
  } else {
    uip_send(uip_appdata, sprintf((char *)uip_appdata,
				  "<tr align=\"center\"><td>%d.%d.%d.%d:%d</td><td>%s</td><td>%d</td><td>%d</td><td>%c %c</td></tr>\r\n",
				  ntohs(conn->ripaddr[0]) >> 8,
				  ntohs(conn->ripaddr[0]) & 0xff,
				  ntohs(conn->ripaddr[1]) >> 8,
				  ntohs(conn->ripaddr[1]) & 0xff,
				  ntohs(conn->rport),
				  states[conn->tcpstateflags & TS_MASK],
				  conn->nrtx,
				  conn->timer,
				  (conn->tcpstateflags & UIP_OUTSTANDING)? '*':' ',
    				  (conn->tcpstateflags & UIP_STOPPED)? '!':' '));
  }
  return 0;
}
/*-----------------------------------------------------------------------------------*/

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
色噜噜夜夜夜综合网| 欧美tk—视频vk| 色哟哟一区二区在线观看| 国产在线一区二区| 国产一区二区三区四区五区美女 | 欧美唯美清纯偷拍| 色婷婷综合在线| 欧美主播一区二区三区| 欧美系列一区二区| 精品视频999| 欧美一区二区三区色| 日韩三级.com| 久久久久久亚洲综合| 亚洲免费观看高清完整版在线观看熊| 国产精品国产三级国产| 中文字幕免费观看一区| 亚洲欧美一区二区三区孕妇| 亚洲一区二区三区视频在线播放 | 亚洲天堂网中文字| 亚洲人成亚洲人成在线观看图片| 亚洲免费观看高清完整版在线观看熊| 亚洲精品国产精华液| 日日夜夜免费精品| 韩国女主播一区二区三区| 国产91精品一区二区| 91小视频在线免费看| 欧美日韩亚洲综合| 精品少妇一区二区三区在线播放| 欧美精品一区二区三区久久久| 久久精品视频一区二区| 亚洲久草在线视频| 日本中文字幕一区二区视频| 国产伦精品一区二区三区视频青涩 | 国产一区视频网站| youjizz国产精品| 欧美视频一区二区三区四区| 日韩一区二区精品在线观看| 国产日产欧美一区二区三区| 亚洲男同1069视频| 蜜臀久久99精品久久久画质超高清| 国内精品久久久久影院一蜜桃| 成人午夜在线免费| 欧洲国产伦久久久久久久| 日韩欧美成人激情| 中文字幕中文字幕一区| 三级在线观看一区二区| 成人午夜激情影院| 欧美视频一区在线| 国产拍欧美日韩视频二区| 亚洲综合成人在线视频| 狠狠久久亚洲欧美| 欧美性色黄大片| 久久久三级国产网站| 亚洲一区在线播放| 高清成人免费视频| 3atv一区二区三区| 亚洲色图丝袜美腿| 国产一区二区中文字幕| 欧美日韩一区二区三区免费看| 国产亚洲污的网站| 视频精品一区二区| 91麻豆国产精品久久| 久久中文娱乐网| 婷婷六月综合网| 99热精品国产| 久久久久久久久一| 视频一区二区欧美| 日本久久一区二区三区| 日本一区二区三区电影| 麻豆成人91精品二区三区| 在线观看www91| 中文字幕永久在线不卡| 国内精品伊人久久久久影院对白| 欧美日本在线看| 亚洲精品乱码久久久久久| 国产精品 欧美精品| 91精品免费在线| 一区二区三区四区国产精品| 国产成人精品免费视频网站| 欧美一区二区三区男人的天堂| 一区二区三区久久久| aaa国产一区| 欧美激情综合网| 精品一区二区久久久| 欧美精品一级二级| 亚洲最新在线观看| 亚洲欧美另类久久久精品| 久久99日本精品| 久久99精品一区二区三区三区| 欧美视频在线不卡| 亚洲欧美日韩国产综合在线| 高清不卡一区二区在线| 久久精品在这里| 国内精品写真在线观看| 日韩一区二区三区视频在线 | 国产亚洲精品福利| 久久精品国产亚洲一区二区三区 | 尤物视频一区二区| 成人手机在线视频| 国产亚洲精品资源在线26u| 久久精品久久综合| 日韩一级二级三级| 天天色综合成人网| 欧美一区二区三区视频| 奇米影视一区二区三区| 日韩一区二区在线免费观看| 蜜桃视频在线一区| 欧美成人猛片aaaaaaa| 九九热在线视频观看这里只有精品| 日韩一卡二卡三卡| 肉肉av福利一精品导航| 欧美极品另类videosde| 91精品欧美综合在线观看最新| 精品噜噜噜噜久久久久久久久试看 | 欧美一区二区三区性视频| 亚洲国产成人精品视频| 欧美福利视频一区| 免费日韩伦理电影| 26uuuu精品一区二区| 成人免费三级在线| 综合激情成人伊人| 欧美性感一类影片在线播放| 日韩黄色片在线观看| 日韩欧美精品在线| 国产自产2019最新不卡| 国产精品国产三级国产普通话99| 96av麻豆蜜桃一区二区| 亚洲一区二区在线视频| 欧美一区二区三区在线电影| 国产精品1024| 亚洲精品中文在线| 欧美老肥妇做.爰bbww视频| 六月丁香综合在线视频| 国产日韩欧美激情| 色婷婷久久99综合精品jk白丝| 亚洲国产精品一区二区www在线 | 亚洲日本在线a| 欧美高清视频一二三区| 国产一区二三区好的| 国产白丝网站精品污在线入口| 日本aⅴ亚洲精品中文乱码| 91在线视频在线| 久久免费美女视频| 91啪亚洲精品| 日本伊人色综合网| 国产三级精品在线| 欧美亚洲综合在线| 国内偷窥港台综合视频在线播放| 中文字幕中文字幕在线一区| 欧美日韩亚洲综合一区| 国产成人精品综合在线观看| 亚洲综合色噜噜狠狠| 久久久亚洲综合| 欧美色涩在线第一页| 国产伦理精品不卡| 亚洲成人动漫在线免费观看| 国产日本欧美一区二区| 欧美日韩一二区| 国产91精品免费| 美女网站在线免费欧美精品| 亚洲特级片在线| 精品国产乱码久久久久久浪潮| 色八戒一区二区三区| 国产在线观看免费一区| 亚洲一区二区高清| 国产精品丝袜91| 精品入口麻豆88视频| 欧美在线色视频| 国产成人av自拍| 奇米在线7777在线精品| 一区二区三区四区av| 日本一区二区免费在线观看视频 | 欧美性受极品xxxx喷水| 国模娜娜一区二区三区| 一区二区国产盗摄色噜噜| 国产日韩欧美一区二区三区综合| 337p亚洲精品色噜噜噜| 色综合久久久久久久久| 懂色一区二区三区免费观看| 美国十次了思思久久精品导航| 一区二区高清在线| 最新成人av在线| 欧美国产日韩在线观看| 26uuu色噜噜精品一区二区| 欧美日韩国产精品成人| 在线观看网站黄不卡| 成人高清免费观看| 国产自产2019最新不卡| 男人的天堂亚洲一区| 亚洲成人综合在线| 亚洲精品免费在线播放| 国产精品久久久久久妇女6080| 欧美成人女星排名| 日韩视频免费观看高清完整版| 欧美日韩一区二区三区在线 | 久久久国际精品| 精品久久人人做人人爰| 91精品在线一区二区| 欧美日韩不卡一区二区| 欧美区在线观看|