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 * SETUP: Make sure we define everything we will need.
screamer 0:7a64fbb4069d 3 *
screamer 0:7a64fbb4069d 4 * We have create three types of pools:
screamer 0:7a64fbb4069d 5 * 1) MEMPOOL - standard pools
screamer 0:7a64fbb4069d 6 * 2) MALLOC_MEMPOOL - to be used by mem_malloc in mem.c
screamer 0:7a64fbb4069d 7 * 3) PBUF_MEMPOOL - a mempool of pbuf's, so include space for the pbuf struct
screamer 0:7a64fbb4069d 8 *
screamer 0:7a64fbb4069d 9 * If the include'r doesn't require any special treatment of each of the types
screamer 0:7a64fbb4069d 10 * above, then will declare #2 & #3 to be just standard mempools.
screamer 0:7a64fbb4069d 11 */
screamer 0:7a64fbb4069d 12 #ifndef LWIP_MALLOC_MEMPOOL
screamer 0:7a64fbb4069d 13 /* This treats "malloc pools" just like any other pool.
screamer 0:7a64fbb4069d 14 The pools are a little bigger to provide 'size' as the amount of user data. */
screamer 0:7a64fbb4069d 15 #define LWIP_MALLOC_MEMPOOL(num, size) LWIP_MEMPOOL(POOL_##size, num, (size + sizeof(struct memp_malloc_helper)), "MALLOC_"#size)
screamer 0:7a64fbb4069d 16 #define LWIP_MALLOC_MEMPOOL_START
screamer 0:7a64fbb4069d 17 #define LWIP_MALLOC_MEMPOOL_END
screamer 0:7a64fbb4069d 18 #endif /* LWIP_MALLOC_MEMPOOL */
screamer 0:7a64fbb4069d 19
screamer 0:7a64fbb4069d 20 #ifndef LWIP_PBUF_MEMPOOL
screamer 0:7a64fbb4069d 21 /* This treats "pbuf pools" just like any other pool.
screamer 0:7a64fbb4069d 22 * Allocates buffers for a pbuf struct AND a payload size */
screamer 0:7a64fbb4069d 23 #define LWIP_PBUF_MEMPOOL(name, num, payload, desc) LWIP_MEMPOOL(name, num, (MEMP_ALIGN_SIZE(sizeof(struct pbuf)) + MEMP_ALIGN_SIZE(payload)), desc)
screamer 0:7a64fbb4069d 24 #endif /* LWIP_PBUF_MEMPOOL */
screamer 0:7a64fbb4069d 25
screamer 0:7a64fbb4069d 26
screamer 0:7a64fbb4069d 27 /*
screamer 0:7a64fbb4069d 28 * A list of internal pools used by LWIP.
screamer 0:7a64fbb4069d 29 *
screamer 0:7a64fbb4069d 30 * LWIP_MEMPOOL(pool_name, number_elements, element_size, pool_description)
screamer 0:7a64fbb4069d 31 * creates a pool name MEMP_pool_name. description is used in stats.c
screamer 0:7a64fbb4069d 32 */
screamer 0:7a64fbb4069d 33 #if LWIP_RAW
screamer 0:7a64fbb4069d 34 LWIP_MEMPOOL(RAW_PCB, MEMP_NUM_RAW_PCB, sizeof(struct raw_pcb), "RAW_PCB")
screamer 0:7a64fbb4069d 35 #endif /* LWIP_RAW */
screamer 0:7a64fbb4069d 36
screamer 0:7a64fbb4069d 37 #if LWIP_UDP
screamer 0:7a64fbb4069d 38 LWIP_MEMPOOL(UDP_PCB, MEMP_NUM_UDP_PCB, sizeof(struct udp_pcb), "UDP_PCB")
screamer 0:7a64fbb4069d 39 #endif /* LWIP_UDP */
screamer 0:7a64fbb4069d 40
screamer 0:7a64fbb4069d 41 #if LWIP_TCP
screamer 0:7a64fbb4069d 42 LWIP_MEMPOOL(TCP_PCB, MEMP_NUM_TCP_PCB, sizeof(struct tcp_pcb), "TCP_PCB")
screamer 0:7a64fbb4069d 43 LWIP_MEMPOOL(TCP_PCB_LISTEN, MEMP_NUM_TCP_PCB_LISTEN, sizeof(struct tcp_pcb_listen), "TCP_PCB_LISTEN")
screamer 0:7a64fbb4069d 44 LWIP_MEMPOOL(TCP_SEG, MEMP_NUM_TCP_SEG, sizeof(struct tcp_seg), "TCP_SEG")
screamer 0:7a64fbb4069d 45 #endif /* LWIP_TCP */
screamer 0:7a64fbb4069d 46
screamer 0:7a64fbb4069d 47 #if IP_REASSEMBLY
screamer 0:7a64fbb4069d 48 LWIP_MEMPOOL(REASSDATA, MEMP_NUM_REASSDATA, sizeof(struct ip_reassdata), "REASSDATA")
screamer 0:7a64fbb4069d 49 #endif /* IP_REASSEMBLY */
screamer 0:7a64fbb4069d 50
screamer 0:7a64fbb4069d 51 #if LWIP_NETCONN
screamer 0:7a64fbb4069d 52 LWIP_MEMPOOL(NETBUF, MEMP_NUM_NETBUF, sizeof(struct netbuf), "NETBUF")
screamer 0:7a64fbb4069d 53 LWIP_MEMPOOL(NETCONN, MEMP_NUM_NETCONN, sizeof(struct netconn), "NETCONN")
screamer 0:7a64fbb4069d 54 #endif /* LWIP_NETCONN */
screamer 0:7a64fbb4069d 55
screamer 0:7a64fbb4069d 56 #if NO_SYS==0
screamer 0:7a64fbb4069d 57 LWIP_MEMPOOL(TCPIP_MSG_API, MEMP_NUM_TCPIP_MSG_API, sizeof(struct tcpip_msg), "TCPIP_MSG_API")
screamer 0:7a64fbb4069d 58 LWIP_MEMPOOL(TCPIP_MSG_INPKT,MEMP_NUM_TCPIP_MSG_INPKT, sizeof(struct tcpip_msg), "TCPIP_MSG_INPKT")
screamer 0:7a64fbb4069d 59 #endif /* NO_SYS==0 */
screamer 0:7a64fbb4069d 60
screamer 0:7a64fbb4069d 61 #if ARP_QUEUEING
screamer 0:7a64fbb4069d 62 LWIP_MEMPOOL(ARP_QUEUE, MEMP_NUM_ARP_QUEUE, sizeof(struct etharp_q_entry), "ARP_QUEUE")
screamer 0:7a64fbb4069d 63 #endif /* ARP_QUEUEING */
screamer 0:7a64fbb4069d 64
screamer 0:7a64fbb4069d 65 #if LWIP_IGMP
screamer 0:7a64fbb4069d 66 LWIP_MEMPOOL(IGMP_GROUP, MEMP_NUM_IGMP_GROUP, sizeof(struct igmp_group), "IGMP_GROUP")
screamer 0:7a64fbb4069d 67 #endif /* LWIP_IGMP */
screamer 0:7a64fbb4069d 68
screamer 0:7a64fbb4069d 69 #if NO_SYS==0
screamer 0:7a64fbb4069d 70 LWIP_MEMPOOL(SYS_TIMEOUT, MEMP_NUM_SYS_TIMEOUT, sizeof(struct sys_timeo), "SYS_TIMEOUT")
screamer 0:7a64fbb4069d 71 #endif /* NO_SYS==0 */
screamer 0:7a64fbb4069d 72
screamer 0:7a64fbb4069d 73
screamer 0:7a64fbb4069d 74 /*
screamer 0:7a64fbb4069d 75 * A list of pools of pbuf's used by LWIP.
screamer 0:7a64fbb4069d 76 *
screamer 0:7a64fbb4069d 77 * LWIP_PBUF_MEMPOOL(pool_name, number_elements, pbuf_payload_size, pool_description)
screamer 0:7a64fbb4069d 78 * creates a pool name MEMP_pool_name. description is used in stats.c
screamer 0:7a64fbb4069d 79 * This allocates enough space for the pbuf struct and a payload.
screamer 0:7a64fbb4069d 80 * (Example: pbuf_payload_size=0 allocates only size for the struct)
screamer 0:7a64fbb4069d 81 */
screamer 0:7a64fbb4069d 82 LWIP_PBUF_MEMPOOL(PBUF, MEMP_NUM_PBUF, 0, "PBUF_REF/ROM")
screamer 0:7a64fbb4069d 83 LWIP_PBUF_MEMPOOL(PBUF_POOL, PBUF_POOL_SIZE, PBUF_POOL_BUFSIZE, "PBUF_POOL")
screamer 0:7a64fbb4069d 84
screamer 0:7a64fbb4069d 85
screamer 0:7a64fbb4069d 86 /*
screamer 0:7a64fbb4069d 87 * Allow for user-defined pools; this must be explicitly set in lwipopts.h
screamer 0:7a64fbb4069d 88 * since the default is to NOT look for lwippools.h
screamer 0:7a64fbb4069d 89 */
screamer 0:7a64fbb4069d 90 #if MEMP_USE_CUSTOM_POOLS
screamer 0:7a64fbb4069d 91 #include "lwippools.h"
screamer 0:7a64fbb4069d 92 #endif /* MEMP_USE_CUSTOM_POOLS */
screamer 0:7a64fbb4069d 93
screamer 0:7a64fbb4069d 94 /*
screamer 0:7a64fbb4069d 95 * REQUIRED CLEANUP: Clear up so we don't get "multiply defined" error later
screamer 0:7a64fbb4069d 96 * (#undef is ignored for something that is not defined)
screamer 0:7a64fbb4069d 97 */
screamer 0:7a64fbb4069d 98 #undef LWIP_MEMPOOL
screamer 0:7a64fbb4069d 99 #undef LWIP_MALLOC_MEMPOOL
screamer 0:7a64fbb4069d 100 #undef LWIP_MALLOC_MEMPOOL_START
screamer 0:7a64fbb4069d 101 #undef LWIP_MALLOC_MEMPOOL_END
screamer 0:7a64fbb4069d 102 #undef LWIP_PBUF_MEMPOOL