Add Broadcom / Netgear changes from RAXE 1.0.0.48
[project/bcm63xx/u-boot.git] / board / broadcom / bcmbca / httpd / httpd.h
1 /**
2 * \addtogroup httpd
3 * @{
4 */
5
6 /**
7 * \file
8 * HTTP server header file.
9 * \author Adam Dunkels <adam@dunkels.com>
10 */
11
12 /*
13 * Copyright (c) 2001, Adam Dunkels.
14 * All rights reserved.
15 *
16 * Redistribution and use in source and binary forms, with or without
17 * modification, are permitted provided that the following conditions
18 * are met:
19 * 1. Redistributions of source code must retain the above copyright
20 * notice, this list of conditions and the following disclaimer.
21 * 2. Redistributions in binary form must reproduce the above copyright
22 * notice, this list of conditions and the following disclaimer in the
23 * documentation and/or other materials provided with the distribution.
24 * 3. The name of the author may not be used to endorse or promote
25 * products derived from this software without specific prior
26 * written permission.
27 *
28 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS
29 * OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
30 * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
31 * ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY
32 * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
33 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
34 * GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
35 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
36 * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
37 * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
38 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
39 *
40 * This file is part of the uIP TCP/IP stack.
41 *
42 * $Id: httpd.h,v 1.4.2.3 2003/10/06 22:56:44 adam Exp $
43 *
44 */
45
46 #ifndef __HTTPD_H__
47 #define __HTTPD_H__
48
49 typedef enum
50 {
51 TRANSFER_START,
52 TRANSFER_CONTINUE,
53 TRANSFER_END
54 } STREAM_TRANSFER_STATE;
55
56 typedef enum
57 {
58 NEXT_STREAM_DATA,
59 STOP_STREAM_DATA
60 } STREAM_TRANSFER_STATUS;
61
62 typedef enum
63 {
64 STREAM_UPGRADE_OK,
65 STREAM_UPGRADE_ERR
66 } STREAM_UPGRADE_STATUS;
67
68 void httpd_appcall(void);
69
70 /* UIP_APPCALL: the name of the application function. This function
71 must return void and take no arguments (i.e., C type "void
72 appfunc(void)"). */
73 #ifndef UIP_APPCALL
74 #define UIP_APPCALL httpd_appcall
75 #endif
76
77 struct httpd_state {
78 unsigned long state;
79 unsigned long count;
80 u8_t *dataptr;
81 unsigned long upload;
82 unsigned long upload_total;
83 };
84
85 /* UIP_APPSTATE_SIZE: The size of the application-specific state
86 stored in the uip_conn structure. */
87 #ifndef UIP_APPSTATE_SIZE
88 #define UIP_APPSTATE_SIZE (sizeof(struct httpd_state))
89 #endif
90
91 //#define FS_STATISTICS 1
92
93 extern struct httpd_state *hs;
94
95 extern STREAM_TRANSFER_STATUS (*handle_data_stream)(char *data_stream_ptr, unsigned int len, STREAM_TRANSFER_STATE state);
96 extern STREAM_UPGRADE_STATUS (*get_stream_upgrade_status)(void);
97
98 #endif /* __HTTPD_H__ */