source: EcnlProtoTool/trunk/asp3_dcre/tinet/netapp/wwws.h@ 321

Last change on this file since 321 was 321, checked in by coas-nagasima, 7 years ago

文字コードを設定

  • Property svn:eol-style set to native
  • Property svn:mime-type set to text/x-chdr;charset=UTF-8
File size: 4.4 KB
Line 
1/*
2 * TINET (TCP/IP Protocol Stack)
3 *
4 * Copyright (C) 2001-2009 by Dep. of Computer Science and Engineering
5 * Tomakomai National College of Technology, JAPAN
6 *
7 * 上記著作権者は,以下の (1)~(4) の条件か,Free Software Foundation
8 * によって公表されている GNU General Public License の Version 2 に記
9 * 述されている条件を満たす場合に限り,本ソフトウェア(本ソフトウェア
10 * を改変したものを含む.以下同じ)を使用・複製・改変・再配布(以下,
11 * 利用と呼ぶ)することを無償で許諾する.
12 * (1) 本ソフトウェアをソースコードの形で利用する場合には,上記の著作
13 * 権表示,この利用条件および下記の無保証規定が,そのままの形でソー
14 * スコード中に含まれていること.
15 * (2) 本ソフトウェアを,ライブラリ形式など,他のソフトウェア開発に使
16 * 用できる形で再配布する場合には,再配布に伴うドキュメント(利用
17 * 者マニュアルなど)に,上記の著作権表示,この利用条件および下記
18 * の無保証規定を掲載すること.
19 * (3) 本ソフトウェアを,機器に組み込むなど,他のソフトウェア開発に使
20 * 用できない形で再配布する場合には,次の条件を満たすこと.
21 * (a) 再配布に伴うドキュメント(利用者マニュアルなど)に,上記の著
22 * 作権表示,この利用条件および下記の無保証規定を掲載すること.
23 * (4) 本ソフトウェアの利用により直接的または間接的に生じるいかなる損
24 * 害からも,上記著作権者およびTOPPERSプロジェクトを免責すること.
25 *
26 * 本ソフトウェアは,無保証で提供されているものである.上記著作権者お
27 * よびTOPPERSプロジェクトは,本ソフトウェアに関して,その適用可能性も
28 * 含めて,いかなる保証も行わない.また,本ソフトウェアの利用により直
29 * 接的または間接的に生じたいかなる損害に関しても,その責任を負わない.
30 *
31 * @(#) $Id$
32 */
33
34#ifndef _WWWS_H_
35#define _WWWS_H_
36
37/*
38 * WWW サーバ
39 */
40
41#include <tinet_defs.h>
42
43#include <net/if.h>
44#include <net/if_ppp.h>
45#include <net/if_loop.h>
46#include <net/ethernet.h>
47
48#include <netinet6/in6.h>
49#include <netinet/ip.h>
50#include <netinet/ip6.h>
51#include <netinet/tcp.h>
52
53#ifdef TOPPERS_S810_CLG3_85
54#define WWW_SRV_STACK_SIZE 768 /* タスクのスタックサイズ */
55#else /* of #ifdef TOPPERS_S810_CLG3_85 */
56#define WWW_SRV_STACK_SIZE 1024 /* タスクのスタックサイズ */
57#endif /* of #ifdef TOPPERS_S810_CLG3_85 */
58#define WWW_SRV_MAIN_PRIORITY 5 /* タスクの優先度 */
59
60/*
61 * TCP 送受信ウインドバッファサイズ
62 */
63
64#if defined(NUM_MPF_NET_BUF_IF_PDU) && NUM_MPF_NET_BUF_IF_PDU > 0
65
66#define WWW_SRV_SWBUF_SIZE ((IF_MTU-(IP_HDR_SIZE+TCP_HDR_SIZE))*1)
67
68#else /* of #if defined(NUM_MPF_NET_BUF_IF_PDU) && NUM_MPF_NET_BUF_IF_PDU > 0 */
69
70#if defined(SUPPORT_INET4)
71#define WWW_SRV_SWBUF_SIZE (TCP_MSS)
72#endif
73
74#if defined(SUPPORT_INET6)
75#define WWW_SRV_SWBUF_SIZE (TCP6_MSS)
76#endif
77
78#endif /* of #if defined(NUM_MPF_NET_BUF_IF_PDU) && NUM_MPF_NET_BUF_IF_PDU > 0 */
79
80#if defined(SUPPORT_INET4)
81#define WWW_SRV_RWBUF_SIZE (TCP_MSS)
82#endif
83
84#if defined(SUPPORT_INET6)
85#define WWW_SRV_RWBUF_SIZE (TCP6_MSS)
86#endif
87
88#define WWW_RBUFF_SIZE (WWW_SRV_RWBUF_SIZE)
89#define WWW_LINE_SIZE 80
90#define WWW_NUM_FIELDS 4
91
92#ifndef _MACRO_ONLY
93
94typedef struct line {
95 uint8_t len;
96 uint8_t num;
97 uint8_t off[WWW_NUM_FIELDS];
98 char buf[WWW_LINE_SIZE + 1];
99 } T_WWW_LINE;
100
101#ifdef USE_COPYSAVE_API
102
103typedef struct www_buffer {
104 char *buf;
105 uint16_t len;
106 uint16_t index;
107 } T_WWW_BUFFER;
108
109#else /* of #ifdef USE_COPYSAVE_API */
110
111typedef struct www_buffer {
112 uint16_t len;
113 uint16_t index;
114 char buf[WWW_RBUFF_SIZE];
115 } T_WWW_BUFFER;
116
117#endif /* of #ifdef USE_COPYSAVE_API */
118
119typedef struct www_rwbuf {
120 T_WWW_BUFFER sbuf;
121 T_WWW_BUFFER rbuf;
122 char unget;
123 } T_WWW_RWBUF;
124
125/* タスク */
126
127extern void www_srv_task (intptr_t exinf);
128
129/*
130 * TCP 送受信バッファ
131 */
132
133extern uint8_t www_srv_swbuf[NUM_WWW_SRV_TASKS][WWW_SRV_SWBUF_SIZE];
134extern uint8_t www_srv_rwbuf[NUM_WWW_SRV_TASKS][WWW_SRV_RWBUF_SIZE];
135
136#endif /* of #ifndef _MACRO_ONLY */
137
138#endif /* of #ifndef _WWWS_H_ */
Note: See TracBrowser for help on using the repository browser.