My fork of the HTTPServer (working)

Dependents:   DGWWebServer LAN2

Committer:
screamer
Date:
Mon Aug 06 09:23:14 2012 +0000
Revision:
0:7a64fbb4069d
[mbed] converted /DGWWebServer/HTTPServer

Who changed what in which revision?

UserRevisionLine numberNew contents of line
screamer 0:7a64fbb4069d 1 /*
screamer 0:7a64fbb4069d 2 * Copyright (c) 2001-2004 Swedish Institute of Computer Science.
screamer 0:7a64fbb4069d 3 * All rights reserved.
screamer 0:7a64fbb4069d 4 *
screamer 0:7a64fbb4069d 5 * Redistribution and use in source and binary forms, with or without modification,
screamer 0:7a64fbb4069d 6 * are permitted provided that the following conditions are met:
screamer 0:7a64fbb4069d 7 *
screamer 0:7a64fbb4069d 8 * 1. Redistributions of source code must retain the above copyright notice,
screamer 0:7a64fbb4069d 9 * this list of conditions and the following disclaimer.
screamer 0:7a64fbb4069d 10 * 2. Redistributions in binary form must reproduce the above copyright notice,
screamer 0:7a64fbb4069d 11 * this list of conditions and the following disclaimer in the documentation
screamer 0:7a64fbb4069d 12 * and/or other materials provided with the distribution.
screamer 0:7a64fbb4069d 13 * 3. The name of the author may not be used to endorse or promote products
screamer 0:7a64fbb4069d 14 * derived from this software without specific prior written permission.
screamer 0:7a64fbb4069d 15 *
screamer 0:7a64fbb4069d 16 * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED
screamer 0:7a64fbb4069d 17 * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
screamer 0:7a64fbb4069d 18 * MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT
screamer 0:7a64fbb4069d 19 * SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
screamer 0:7a64fbb4069d 20 * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
screamer 0:7a64fbb4069d 21 * OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
screamer 0:7a64fbb4069d 22 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
screamer 0:7a64fbb4069d 23 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
screamer 0:7a64fbb4069d 24 * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY
screamer 0:7a64fbb4069d 25 * OF SUCH DAMAGE.
screamer 0:7a64fbb4069d 26 *
screamer 0:7a64fbb4069d 27 * This file is part of the lwIP TCP/IP stack.
screamer 0:7a64fbb4069d 28 *
screamer 0:7a64fbb4069d 29 * Author: Adam Dunkels <adam@sics.se>
screamer 0:7a64fbb4069d 30 *
screamer 0:7a64fbb4069d 31 */
screamer 0:7a64fbb4069d 32 #ifndef __LWIP_INET_H__
screamer 0:7a64fbb4069d 33 #define __LWIP_INET_H__
screamer 0:7a64fbb4069d 34
screamer 0:7a64fbb4069d 35 #include "lwip/opt.h"
screamer 0:7a64fbb4069d 36
screamer 0:7a64fbb4069d 37 #ifdef __cplusplus
screamer 0:7a64fbb4069d 38 extern "C" {
screamer 0:7a64fbb4069d 39 #endif
screamer 0:7a64fbb4069d 40
screamer 0:7a64fbb4069d 41 /* For compatibility with BSD code */
screamer 0:7a64fbb4069d 42 struct in_addr {
screamer 0:7a64fbb4069d 43 u32_t s_addr;
screamer 0:7a64fbb4069d 44 };
screamer 0:7a64fbb4069d 45
screamer 0:7a64fbb4069d 46 #define INADDR_NONE ((u32_t)0xffffffffUL) /* 255.255.255.255 */
screamer 0:7a64fbb4069d 47 #define INADDR_LOOPBACK ((u32_t)0x7f000001UL) /* 127.0.0.1 */
screamer 0:7a64fbb4069d 48 #define INADDR_ANY ((u32_t)0x00000000UL) /* 0.0.0.0 */
screamer 0:7a64fbb4069d 49 #define INADDR_BROADCAST ((u32_t)0xffffffffUL) /* 255.255.255.255 */
screamer 0:7a64fbb4069d 50
screamer 0:7a64fbb4069d 51 u32_t inet_addr(const char *cp);
screamer 0:7a64fbb4069d 52 int inet_aton(const char *cp, struct in_addr *addr);
screamer 0:7a64fbb4069d 53 char *inet_ntoa(struct in_addr addr); /* returns ptr to static buffer; not reentrant! */
screamer 0:7a64fbb4069d 54
screamer 0:7a64fbb4069d 55 #ifdef htons
screamer 0:7a64fbb4069d 56 #undef htons
screamer 0:7a64fbb4069d 57 #endif /* htons */
screamer 0:7a64fbb4069d 58 #ifdef htonl
screamer 0:7a64fbb4069d 59 #undef htonl
screamer 0:7a64fbb4069d 60 #endif /* htonl */
screamer 0:7a64fbb4069d 61 #ifdef ntohs
screamer 0:7a64fbb4069d 62 #undef ntohs
screamer 0:7a64fbb4069d 63 #endif /* ntohs */
screamer 0:7a64fbb4069d 64 #ifdef ntohl
screamer 0:7a64fbb4069d 65 #undef ntohl
screamer 0:7a64fbb4069d 66 #endif /* ntohl */
screamer 0:7a64fbb4069d 67
screamer 0:7a64fbb4069d 68 #ifndef LWIP_PLATFORM_BYTESWAP
screamer 0:7a64fbb4069d 69 #define LWIP_PLATFORM_BYTESWAP 0
screamer 0:7a64fbb4069d 70 #endif
screamer 0:7a64fbb4069d 71
screamer 0:7a64fbb4069d 72 #if BYTE_ORDER == BIG_ENDIAN
screamer 0:7a64fbb4069d 73 #define htons(x) (x)
screamer 0:7a64fbb4069d 74 #define ntohs(x) (x)
screamer 0:7a64fbb4069d 75 #define htonl(x) (x)
screamer 0:7a64fbb4069d 76 #define ntohl(x) (x)
screamer 0:7a64fbb4069d 77 #else /* BYTE_ORDER != BIG_ENDIAN */
screamer 0:7a64fbb4069d 78 #ifdef LWIP_PREFIX_BYTEORDER_FUNCS
screamer 0:7a64fbb4069d 79 /* workaround for naming collisions on some platforms */
screamer 0:7a64fbb4069d 80 #define htons lwip_htons
screamer 0:7a64fbb4069d 81 #define ntohs lwip_ntohs
screamer 0:7a64fbb4069d 82 #define htonl lwip_htonl
screamer 0:7a64fbb4069d 83 #define ntohl lwip_ntohl
screamer 0:7a64fbb4069d 84 #endif /* LWIP_PREFIX_BYTEORDER_FUNCS */
screamer 0:7a64fbb4069d 85 #if LWIP_PLATFORM_BYTESWAP
screamer 0:7a64fbb4069d 86 #define htons(x) LWIP_PLATFORM_HTONS(x)
screamer 0:7a64fbb4069d 87 #define ntohs(x) LWIP_PLATFORM_HTONS(x)
screamer 0:7a64fbb4069d 88 #define htonl(x) LWIP_PLATFORM_HTONL(x)
screamer 0:7a64fbb4069d 89 #define ntohl(x) LWIP_PLATFORM_HTONL(x)
screamer 0:7a64fbb4069d 90 #else /* LWIP_PLATFORM_BYTESWAP */
screamer 0:7a64fbb4069d 91 u16_t htons(u16_t x);
screamer 0:7a64fbb4069d 92 u16_t ntohs(u16_t x);
screamer 0:7a64fbb4069d 93 u32_t htonl(u32_t x);
screamer 0:7a64fbb4069d 94 u32_t ntohl(u32_t x);
screamer 0:7a64fbb4069d 95 #endif /* LWIP_PLATFORM_BYTESWAP */
screamer 0:7a64fbb4069d 96
screamer 0:7a64fbb4069d 97 #endif /* BYTE_ORDER == BIG_ENDIAN */
screamer 0:7a64fbb4069d 98
screamer 0:7a64fbb4069d 99 #ifdef __cplusplus
screamer 0:7a64fbb4069d 100 }
screamer 0:7a64fbb4069d 101 #endif
screamer 0:7a64fbb4069d 102
screamer 0:7a64fbb4069d 103 #endif /* __LWIP_INET_H__ */