00001 00002 00003 00056 #ifndef __TCPIPCONFIG_H 00057 #define __TCPIPCONFIG_H 00058 00059 #include "TCPIP.h" 00060 #include "projectdefs.h" 00061 00062 // ======================================================================= 00063 // Application Options 00064 // ======================================================================= 00065 00066 /* Application Level Module Selection 00067 * Uncomment or comment the following lines to enable or 00068 * disabled the following high-level application modules. 00069 */ 00070 #define STACK_USE_ICMP_SERVER 00071 #define STACK_USE_HTTP2_SERVER 00072 #define STACK_USE_DHCP_CLIENT 00073 #define STACK_USE_MPFS2 00074 00075 /* MPFS File Handles 00076 * Maximum number of simultaneously open MPFS2 files. 00077 * For MPFS Classic, this has no effect. 00078 */ 00079 #define MAX_MPFS_HANDLES (5ul) 00080 00081 // ======================================================================= 00082 // Transport Layer Options 00083 // ======================================================================= 00084 00085 /* Transport Layer Configuration 00086 * The following low level modules are automatically enabled 00087 * based on module selections above. If your custom module 00088 * requires them otherwise, enable them here. 00089 */ 00090 #define STACK_USE_TCP 00091 #define STACK_USE_UDP 00092 00093 /* Client Mode Configuration 00094 * Uncomment following line if this stack will be used in CLIENT 00095 * mode. In CLIENT mode, some functions specific to client operation 00096 * are enabled. 00097 */ 00098 #define STACK_CLIENT_MODE 00099 00100 /* TCP Socket Memory Allocation 00101 * TCP needs memory to buffer incoming and outgoing data. The 00102 * amount and medium of storage can be allocated on a per-socket 00103 * basis using the example below as a guide. 00104 */ 00105 // Allocate how much total RAM (in bytes) you want to allocate 00106 // for use by your TCP TCBs, RX FIFOs, and TX FIFOs. 00107 #define TCP_ETH_RAM_SIZE (5220ul) 00108 #define TCP_PIC_RAM_SIZE (0ul) 00109 #define TCP_SPI_RAM_SIZE (0ul) 00110 #define TCP_SPI_RAM_BASE_ADDRESS (0x00) 00111 00112 // Define names of socket types 00113 #define TCP_SOCKET_TYPES 00114 #define TCP_PURPOSE_GENERIC_TCP_CLIENT 0 00115 #define TCP_PURPOSE_GENERIC_TCP_SERVER 1 00116 #define TCP_PURPOSE_TELNET 2 00117 #define TCP_PURPOSE_FTP_COMMAND 3 00118 #define TCP_PURPOSE_FTP_DATA 4 00119 #define TCP_PURPOSE_TCP_PERFORMANCE_TX 5 00120 #define TCP_PURPOSE_TCP_PERFORMANCE_RX 6 00121 #define TCP_PURPOSE_UART_2_TCP_BRIDGE 7 00122 #define TCP_PURPOSE_HTTP_SERVER 8 00123 #define TCP_PURPOSE_DEFAULT 9 00124 #define TCP_PURPOSE_BERKELEY_SERVER 10 00125 #define TCP_PURPOSE_BERKELEY_CLIENT 11 00126 #define END_OF_TCP_SOCKET_TYPES 00127 00128 #if defined(__TCP_C) 00129 // Define what types of sockets are needed, how many of 00130 // each to include, where their TCB, TX FIFO, and RX FIFO 00131 // should be stored, and how big the RX and TX FIFOs should 00132 // be. Making this initializer bigger or smaller defines 00133 // how many total TCP sockets are available. 00134 // 00135 // Each socket requires up to 48 bytes of PIC RAM and 00136 // 40+(TX FIFO size)+(RX FIFO size) bytes bytes of 00137 // TCP_*_RAM each. 00138 // Note: The RX FIFO must be at least 1 byte in order to 00139 // receive SYN and FIN messages required by TCP. The TX 00140 // FIFO can be zero if desired. 00141 #define TCP_CONFIGURATION 00142 ROM struct 00143 { 00144 BYTE vSocketPurpose; 00145 BYTE vMemoryMedium; 00146 WORD wTXBufferSize; 00147 WORD wRXBufferSize; 00148 } TCPSocketInitializer[] = 00149 { 00150 {TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 1500, 500}, 00151 00152 PROJECT_SOCKET_CONFIGURATION 00153 }; 00154 #define END_OF_TCP_CONFIGURATION 00155 #endif 00156 00157 /* UDP Socket Configuration 00158 * Define the maximum number of available UDP Sockets, and whether 00159 * or not to include a checksum on packets being transmitted. 00160 */ 00161 #define MAX_UDP_SOCKETS (5u) 00162 #define UDP_USE_TX_CHECKSUM // This slows UDP TX performance by nearly 50% 00163 00164 // ======================================================================= 00165 // Application-Specific Options 00166 // ======================================================================= 00167 00168 // -- HTTP2 Server options ----------------------------------------------- 00169 00170 // Maximum numbers of simultaneous HTTP connections allowed. 00171 // Each connection consumes 2 bytes of RAM and a TCP socket 00172 #define MAX_HTTP_CONNECTIONS (1u) 00173 00174 // Indicate what file to serve when no specific one is requested 00175 #define HTTP_DEFAULT_FILE "index.htm" 00176 #define HTTPS_DEFAULT_FILE "index.htm" 00177 #define HTTP_DEFAULT_LEN (10u) // For buffer overrun protection. 00178 // Set to longest length of above two strings. 00179 00180 #define HTTP_USE_POST // Enable POST support 00181 #endif
1.5.5