Murat Kilivan / Mbed 2 deprecated HTMLServer_Sample

Dependencies:   EthernetInterface HttpServer mbed-rpc mbed-rtos mbed

Fork of giken9_HTMLServer_Sample by Yasushi TAUCHI

Committer:
yueee_yt
Date:
Wed Mar 12 04:39:15 2014 +0000
Revision:
2:14b689a85306
Parent:
0:7766f6712673
bug fix

Who changed what in which revision?

UserRevisionLine numberNew contents of line
yueee_yt 0:7766f6712673 1 /*
yueee_yt 0:7766f6712673 2 * Copyright (c) 2001-2003 Swedish Institute of Computer Science.
yueee_yt 0:7766f6712673 3 * All rights reserved.
yueee_yt 0:7766f6712673 4 *
yueee_yt 0:7766f6712673 5 * Redistribution and use in source and binary forms, with or without modification,
yueee_yt 0:7766f6712673 6 * are permitted provided that the following conditions are met:
yueee_yt 0:7766f6712673 7 *
yueee_yt 0:7766f6712673 8 * 1. Redistributions of source code must retain the above copyright notice,
yueee_yt 0:7766f6712673 9 * this list of conditions and the following disclaimer.
yueee_yt 0:7766f6712673 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
yueee_yt 0:7766f6712673 11 * this list of conditions and the following disclaimer in the documentation
yueee_yt 0:7766f6712673 12 * and/or other materials provided with the distribution.
yueee_yt 0:7766f6712673 13 * 3. The name of the author may not be used to endorse or promote products
yueee_yt 0:7766f6712673 14 * derived from this software without specific prior written permission.
yueee_yt 0:7766f6712673 15 *
yueee_yt 0:7766f6712673 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
yueee_yt 0:7766f6712673 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
yueee_yt 0:7766f6712673 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
yueee_yt 0:7766f6712673 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
yueee_yt 0:7766f6712673 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
yueee_yt 0:7766f6712673 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
yueee_yt 0:7766f6712673 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
yueee_yt 0:7766f6712673 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
yueee_yt 0:7766f6712673 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
yueee_yt 0:7766f6712673 25 * OF SUCH DAMAGE.
yueee_yt 0:7766f6712673 26 *
yueee_yt 0:7766f6712673 27 * This file is part of the lwIP TCP/IP stack.
yueee_yt 0:7766f6712673 28 *
yueee_yt 0:7766f6712673 29 * Author: Adam Dunkels <adam@sics.se>
yueee_yt 0:7766f6712673 30 *
yueee_yt 0:7766f6712673 31 */
yueee_yt 0:7766f6712673 32 #ifndef __CC_H__
yueee_yt 0:7766f6712673 33 #define __CC_H__
yueee_yt 0:7766f6712673 34
yueee_yt 0:7766f6712673 35 #include <stdint.h>
yueee_yt 0:7766f6712673 36
yueee_yt 0:7766f6712673 37 /* Types based on stdint.h */
yueee_yt 0:7766f6712673 38 typedef uint8_t u8_t;
yueee_yt 0:7766f6712673 39 typedef int8_t s8_t;
yueee_yt 0:7766f6712673 40 typedef uint16_t u16_t;
yueee_yt 0:7766f6712673 41 typedef int16_t s16_t;
yueee_yt 0:7766f6712673 42 typedef uint32_t u32_t;
yueee_yt 0:7766f6712673 43 typedef int32_t s32_t;
yueee_yt 0:7766f6712673 44 typedef uintptr_t mem_ptr_t;
yueee_yt 0:7766f6712673 45
yueee_yt 0:7766f6712673 46 /* Define (sn)printf formatters for these lwIP types */
yueee_yt 0:7766f6712673 47 #define U16_F "hu"
yueee_yt 0:7766f6712673 48 #define S16_F "hd"
yueee_yt 0:7766f6712673 49 #define X16_F "hx"
yueee_yt 0:7766f6712673 50 #define U32_F "lu"
yueee_yt 0:7766f6712673 51 #define S32_F "ld"
yueee_yt 0:7766f6712673 52 #define X32_F "lx"
yueee_yt 0:7766f6712673 53 #define SZT_F "uz"
yueee_yt 0:7766f6712673 54
yueee_yt 0:7766f6712673 55 /* ARM/LPC17xx is little endian only */
yueee_yt 0:7766f6712673 56 #define BYTE_ORDER LITTLE_ENDIAN
yueee_yt 0:7766f6712673 57
yueee_yt 0:7766f6712673 58 /* Use LWIP error codes */
yueee_yt 0:7766f6712673 59 #define LWIP_PROVIDE_ERRNO
yueee_yt 0:7766f6712673 60
yueee_yt 0:7766f6712673 61 #if defined(__arm__) && defined(__ARMCC_VERSION)
yueee_yt 0:7766f6712673 62 /* Keil uVision4 tools */
yueee_yt 0:7766f6712673 63 #define PACK_STRUCT_BEGIN __packed
yueee_yt 0:7766f6712673 64 #define PACK_STRUCT_STRUCT
yueee_yt 0:7766f6712673 65 #define PACK_STRUCT_END
yueee_yt 0:7766f6712673 66 #define PACK_STRUCT_FIELD(fld) fld
yueee_yt 0:7766f6712673 67 #define ALIGNED(n) __align(n)
yueee_yt 0:7766f6712673 68 #elif defined (__IAR_SYSTEMS_ICC__)
yueee_yt 0:7766f6712673 69 /* IAR Embedded Workbench tools */
yueee_yt 0:7766f6712673 70 #define PACK_STRUCT_BEGIN __packed
yueee_yt 0:7766f6712673 71 #define PACK_STRUCT_STRUCT
yueee_yt 0:7766f6712673 72 #define PACK_STRUCT_END
yueee_yt 0:7766f6712673 73 #define PACK_STRUCT_FIELD(fld) fld
yueee_yt 0:7766f6712673 74 // #define PACK_STRUCT_USE_INCLUDES
yueee_yt 0:7766f6712673 75 #error NEEDS ALIGNED // FIXME TBD
yueee_yt 0:7766f6712673 76 #else
yueee_yt 0:7766f6712673 77 /* GCC tools (CodeSourcery) */
yueee_yt 0:7766f6712673 78 #define PACK_STRUCT_BEGIN
yueee_yt 0:7766f6712673 79 #define PACK_STRUCT_STRUCT __attribute__ ((__packed__))
yueee_yt 0:7766f6712673 80 #define PACK_STRUCT_END
yueee_yt 0:7766f6712673 81 #define PACK_STRUCT_FIELD(fld) fld
yueee_yt 0:7766f6712673 82 #define ALIGNED(n) __attribute__((aligned (n)))
yueee_yt 0:7766f6712673 83 #endif
yueee_yt 0:7766f6712673 84
yueee_yt 0:7766f6712673 85 /* Provide Thumb-2 routines for GCC to improve performance */
yueee_yt 0:7766f6712673 86 #if defined(TOOLCHAIN_GCC) && defined(__thumb2__)
yueee_yt 0:7766f6712673 87 #define MEMCPY(dst,src,len) thumb2_memcpy(dst,src,len)
yueee_yt 0:7766f6712673 88 #define LWIP_CHKSUM thumb2_checksum
yueee_yt 0:7766f6712673 89 /* Set algorithm to 0 so that unused lwip_standard_chksum function
yueee_yt 0:7766f6712673 90 doesn't generate compiler warning */
yueee_yt 0:7766f6712673 91 #define LWIP_CHKSUM_ALGORITHM 0
yueee_yt 0:7766f6712673 92
yueee_yt 0:7766f6712673 93 void* thumb2_memcpy(void* pDest, const void* pSource, size_t length);
yueee_yt 0:7766f6712673 94 u16_t thumb2_checksum(void* pData, int length);
yueee_yt 0:7766f6712673 95 #else
yueee_yt 0:7766f6712673 96 /* Used with IP headers only */
yueee_yt 0:7766f6712673 97 #define LWIP_CHKSUM_ALGORITHM 1
yueee_yt 0:7766f6712673 98 #endif
yueee_yt 0:7766f6712673 99
yueee_yt 0:7766f6712673 100
yueee_yt 0:7766f6712673 101 #ifdef LWIP_DEBUG
yueee_yt 0:7766f6712673 102
yueee_yt 0:7766f6712673 103 #include "stdio.h"
yueee_yt 0:7766f6712673 104
yueee_yt 0:7766f6712673 105 void assert_printf(char *msg, int line, char *file);
yueee_yt 0:7766f6712673 106
yueee_yt 0:7766f6712673 107 /* Plaform specific diagnostic output */
yueee_yt 0:7766f6712673 108 #define LWIP_PLATFORM_DIAG(vars) printf vars
yueee_yt 0:7766f6712673 109 #define LWIP_PLATFORM_ASSERT(flag) { assert_printf((flag), __LINE__, __FILE__); }
yueee_yt 0:7766f6712673 110 #else
yueee_yt 0:7766f6712673 111 #define LWIP_PLATFORM_DIAG(msg) { ; }
yueee_yt 0:7766f6712673 112 #define LWIP_PLATFORM_ASSERT(flag) { ; }
yueee_yt 0:7766f6712673 113 #endif
yueee_yt 0:7766f6712673 114
yueee_yt 0:7766f6712673 115 #include "cmsis.h"
yueee_yt 0:7766f6712673 116 #define LWIP_PLATFORM_HTONS(x) __REV16(x)
yueee_yt 0:7766f6712673 117 #define LWIP_PLATFORM_HTONL(x) __REV(x)
yueee_yt 0:7766f6712673 118
yueee_yt 0:7766f6712673 119 #endif /* __CC_H__ */