Advertisement
Guest User

PIC32-WEB, MOD-WIFI config

a guest
Apr 23rd, 2013
511
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 26.40 KB | None | 0 0
  1. /*********************************************************************
  2.  *
  3.  *  Microchip TCP/IP Stack Demo Application Configuration Header
  4.  *
  5.  *********************************************************************
  6.  * FileName:        TCPIPConfig.h
  7.  * Dependencies:    Microchip TCP/IP Stack
  8.  * Processor:       PIC18, PIC24F, PIC24H, dsPIC30F, dsPIC33F, PIC32
  9.  * Compiler:        Microchip C32 v1.10 or higher
  10.  *                  Microchip C30 v3.12 or higher
  11.  *                  Microchip C18 v3.34 or higher
  12.  *                  HI-TECH PICC-18 PRO 9.63PL2 or higher
  13.  * Company:         Microchip Technology, Inc.
  14.  *
  15.  * Software License Agreement
  16.  *
  17.  * Copyright (C) 2002-2009 Microchip Technology Inc.  All rights
  18.  * reserved.
  19.  *
  20.  * Microchip licenses to you the right to use, modify, copy, and
  21.  * distribute:
  22.  * (i)  the Software when embedded on a Microchip microcontroller or
  23.  *      digital signal controller product ("Device") which is
  24.  *      integrated into Licensee's product; or
  25.  * (ii) ONLY the Software driver source files ENC28J60.c, ENC28J60.h,
  26.  *      ENCX24J600.c and ENCX24J600.h ported to a non-Microchip device
  27.  *      used in conjunction with a Microchip ethernet controller for
  28.  *      the sole purpose of interfacing with the ethernet controller.
  29.  *
  30.  * You should refer to the license agreement accompanying this
  31.  * Software for additional information regarding your rights and
  32.  * obligations.
  33.  *
  34.  * THE SOFTWARE AND DOCUMENTATION ARE PROVIDED "AS IS" WITHOUT
  35.  * WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT
  36.  * LIMITATION, ANY WARRANTY OF MERCHANTABILITY, FITNESS FOR A
  37.  * PARTICULAR PURPOSE, TITLE AND NON-INFRINGEMENT. IN NO EVENT SHALL
  38.  * MICROCHIP BE LIABLE FOR ANY INCIDENTAL, SPECIAL, INDIRECT OR
  39.  * CONSEQUENTIAL DAMAGES, LOST PROFITS OR LOST DATA, COST OF
  40.  * PROCUREMENT OF SUBSTITUTE GOODS, TECHNOLOGY OR SERVICES, ANY CLAIMS
  41.  * BY THIRD PARTIES (INCLUDING BUT NOT LIMITED TO ANY DEFENSE
  42.  * THEREOF), ANY CLAIMS FOR INDEMNITY OR CONTRIBUTION, OR OTHER
  43.  * SIMILAR COSTS, WHETHER ASSERTED ON THE BASIS OF CONTRACT, TORT
  44.  * (INCLUDING NEGLIGENCE), BREACH OF WARRANTY, OR OTHERWISE.
  45.  *
  46.  *
  47.  * Author               Date        Comment
  48.  *~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
  49.  * Howard Schlunder     10/04/2006  Original
  50.  * Ken Hesky            07/01/2008  Added ZG2100-specific features
  51.  * SG                   03/25/2009  Added ZGLinkMgrII specific features
  52.  ********************************************************************/
  53. #ifndef __TCPIPCONFIG_H
  54. #define __TCPIPCONFIG_H
  55.  
  56. #include "GenericTypeDefs.h"
  57. #include "Compiler.h"
  58. #define GENERATED_BY_TCPIPCONFIG "Version 1.0.3603.26345"
  59.  
  60. // =======================================================================
  61. //   Application Options
  62. // =======================================================================
  63.  
  64. /* Application Level Module Selection
  65.  *   Uncomment or comment the following lines to enable or
  66.  *   disabled the following high-level application modules.
  67.  */
  68. #define STACK_USE_UART                  // Application demo using UART for IP address display and stack configuration
  69. //#define STACK_USE_UART2TCP_BRIDGE     // UART to TCP Bridge application example
  70. //#define STACK_USE_IP_GLEANING
  71. #define STACK_USE_ICMP_SERVER           // Ping query and response capability
  72. //#define STACK_USE_ICMP_CLIENT         // Ping transmission capability
  73. //#define STACK_USE_HTTP_SERVER         // Old HTTP server
  74. #define STACK_USE_HTTP2_SERVER          // New HTTP server with POST, Cookies, Authentication, etc.
  75. //#define STACK_USE_SSL_SERVER          // SSL server socket support (Requires SW300052)
  76. //#define STACK_USE_SSL_CLIENT          // SSL client socket support (Requires SW300052)
  77. #define STACK_USE_AUTO_IP               // Dynamic link-layer IP address automatic configuration protocol
  78. #define STACK_USE_DHCP_CLIENT           // Dynamic Host Configuration Protocol client for obtaining IP address and other parameters
  79. #define STACK_USE_DHCP_SERVER           // Single host DHCP server
  80. //#define STACK_USE_FTP_SERVER          // File Transfer Protocol (old)
  81. //#define STACK_USE_SMTP_CLIENT         // Simple Mail Transfer Protocol for sending email
  82. //#define STACK_USE_SNMP_SERVER         // Simple Network Management Protocol v2C Community Agent
  83. //#define STACK_USE_TFTP_CLIENT         // Trivial File Transfer Protocol client
  84. //#define STACK_USE_GENERIC_TCP_CLIENT_EXAMPLE  // HTTP Client example in GenericTCPClient.c
  85. //#define STACK_USE_GENERIC_TCP_SERVER_EXAMPLE  // ToUpper server example in GenericTCPServer.c
  86. //#define STACK_USE_TELNET_SERVER           // Telnet server
  87. #define STACK_USE_ANNOUNCE              // Microchip Embedded Ethernet Device Discoverer server/client
  88. #define STACK_USE_DNS                   // Domain Name Service Client for resolving hostname strings to IP addresses
  89. #define STACK_USE_NBNS                  // NetBIOS Name Service Server for repsonding to NBNS hostname broadcast queries
  90. #define STACK_USE_REBOOT_SERVER         // Module for resetting this PIC remotely.  Primarily useful for a Bootloader.
  91. //#define STACK_USE_SNTP_CLIENT         // Simple Network Time Protocol for obtaining current date/time from Internet
  92. //#define STACK_USE_UDP_PERFORMANCE_TEST    // Module for testing UDP TX performance characteristics.  NOTE: Enabling this will cause a huge amount of UDP broadcast packets to flood your network on the discard port.  Use care when enabling this on production networks, especially with VPNs (could tunnel broadcast traffic across a limited bandwidth connection).
  93. #define STACK_USE_TCP_PERFORMANCE_TEST  // Module for testing TCP TX performance characteristics
  94. //#define STACK_USE_DYNAMICDNS_CLIENT       // Dynamic DNS client updater module
  95. //#define STACK_USE_BERKELEY_API            // Berekely Sockets APIs are available
  96.  
  97.  
  98. // =======================================================================
  99. //   Data Storage Options
  100. // =======================================================================
  101.  
  102. /* MPFS Configuration
  103.  *   MPFS is automatically included when required for other
  104.  *   applications.  If your custom application requires it
  105.  *   otherwise, uncomment the appropriate selection.
  106.  */
  107. //#define STACK_USE_MPFS
  108. #define STACK_USE_MPFS2
  109.  
  110. /* MPFS Storage Location
  111.  *   If html pages are stored in internal program memory,
  112.  *   comment both MPFS_USE_EEPROM and MPFS_USE_SPI_FLASH, then
  113.  *   include an MPFS image (.c or .s file) in the project.
  114.  *   If html pages are stored in external memory, uncomment the
  115.  *   appropriate definition.
  116.  *
  117.  *   Supported serial flash parts include the SST25VFxxxB series.
  118.  */
  119. //#define MPFS_USE_EEPROM
  120. //#define MPFS_USE_SPI_FLASH
  121.  
  122. /* EEPROM Addressing Selection
  123.  *   If using the 1Mbit EEPROM, uncomment this line
  124.  */
  125. //#define USE_EEPROM_25LC1024
  126.  
  127. /* EEPROM Reserved Area
  128.  *   Number of EEPROM bytes to be reserved before MPFS storage starts.
  129.  *   These bytes host application configurations such as IP Address,
  130.  *   MAC Address, and any other required variables.
  131.  *
  132.  *   For MPFS Classic, this setting must match the Reserved setting
  133.  *   on the Advanced Settings page of the MPFS2 Utility.
  134.  */
  135. #define MPFS_RESERVE_BLOCK              (137ul)
  136.  
  137. /* MPFS File Handles
  138.  *   Maximum number of simultaneously open MPFS2 files.
  139.  *   For MPFS Classic, this has no effect.
  140.  */
  141. #define MAX_MPFS_HANDLES                (7ul)
  142.  
  143.  
  144. // =======================================================================
  145. //   Network Addressing Options
  146. // =======================================================================
  147.  
  148. /* Default Network Configuration
  149.  *   These settings are only used if data is not found in EEPROM.
  150.  *   To clear EEPROM, hold BUTTON0, reset the board, and continue
  151.  *   holding until the LEDs flash.  Release, and reset again.
  152.  */
  153. #define MY_DEFAULT_HOST_NAME            "MOD-WIFI"
  154.  
  155. //#define MY_DEFAULT_MAC_BYTE1            (0x00)    // Use the default of
  156. //#define MY_DEFAULT_MAC_BYTE2            (0x04)    // 00-04-A3-00-00-00 if using
  157. //#define MY_DEFAULT_MAC_BYTE3            (0xA3)    // an ENCX24J600 or ZeroG ZG2100
  158. //#define MY_DEFAULT_MAC_BYTE4            (0x00)    // and wish to use the internal
  159. //#define MY_DEFAULT_MAC_BYTE5            (0x00)    // factory programmed MAC
  160. //#define MY_DEFAULT_MAC_BYTE6            (0x00)    // address instead.
  161.  
  162. #define MY_DEFAULT_MAC_BYTE1            (0x00)  // Use the default of
  163. #define MY_DEFAULT_MAC_BYTE2            (0x1E)  // 00-04-A3-00-00-00 if using
  164. #define MY_DEFAULT_MAC_BYTE3            (0xC0)  // an ENCX24J600 or ZeroG ZG2100
  165. #define MY_DEFAULT_MAC_BYTE4            (0x00)  // and wish to use the internal
  166. #define MY_DEFAULT_MAC_BYTE5            (0x21)  // factory programmed MAC
  167. #define MY_DEFAULT_MAC_BYTE6            (0xFF)  // address instea
  168.  
  169. #define MY_DEFAULT_IP_ADDR_BYTE1        (169ul)
  170. #define MY_DEFAULT_IP_ADDR_BYTE2        (254ul)
  171. #define MY_DEFAULT_IP_ADDR_BYTE3        (1ul)
  172. #define MY_DEFAULT_IP_ADDR_BYTE4        (1ul)
  173.  
  174. #define MY_DEFAULT_MASK_BYTE1           (255ul)
  175. #define MY_DEFAULT_MASK_BYTE2           (255ul)
  176. #define MY_DEFAULT_MASK_BYTE3           (255ul)
  177. #define MY_DEFAULT_MASK_BYTE4           (0ul)
  178.  
  179. #define MY_DEFAULT_GATE_BYTE1           (192ul)
  180. #define MY_DEFAULT_GATE_BYTE2           (168ul)
  181. #define MY_DEFAULT_GATE_BYTE3           (0ul)
  182. #define MY_DEFAULT_GATE_BYTE4           (1ul)
  183.  
  184. #define MY_DEFAULT_PRIMARY_DNS_BYTE1    (192ul)
  185. #define MY_DEFAULT_PRIMARY_DNS_BYTE2    (168ul)
  186. #define MY_DEFAULT_PRIMARY_DNS_BYTE3    (0ul)
  187. #define MY_DEFAULT_PRIMARY_DNS_BYTE4    (1ul)
  188.  
  189. #define MY_DEFAULT_SECONDARY_DNS_BYTE1  (0ul)
  190. #define MY_DEFAULT_SECONDARY_DNS_BYTE2  (0ul)
  191. #define MY_DEFAULT_SECONDARY_DNS_BYTE3  (0ul)
  192. #define MY_DEFAULT_SECONDARY_DNS_BYTE4  (0ul)
  193.  
  194.  
  195. // =======================================================================
  196. //   ZeroG Wireless Options
  197. //   If not using a ZG2100 device, ignore this section.
  198. // =======================================================================
  199.  
  200. #define STACK_USE_ZG2100
  201.  
  202. #define USE_GRATUITOUS_ARP
  203.  
  204. // Default SSID or wireless network name to connect to
  205. #define MY_DEFAULT_SSID_NAME                "OlimexAP"
  206.  
  207. /*******************************************/
  208. /* DOMAINS & CHANNEL COMPILE TIME DEFAULTS */
  209. /*******************************************/
  210. /* Valid domains:    kZGRegDomainFCC      Available Channels: 1 - 11     */
  211. /*                   kZGRegDomainIC       Available Channels: 1 - 11     */
  212. /*                   kZGRegDomainETSI     Available Channels: 1 - 13     */
  213. /*                   kZGRegDomainJapanA   Available Channels: 14         */
  214. /*                   kZGRegDomainJapanB   Available Channels: 1 - 13     */
  215. #define MY_DEFAULT_DOMAIN                   kZGRegDomainFCC
  216.  
  217. // When attempting to find the wireless network, only these radio channels
  218. // will be scanned.  Channels 1, 6, and 11 are the three non-overlapping
  219. // radio channels normally used in the FCC regulatory domain.  If you add
  220. // or subtract radio channels, be sure to also update the
  221. // MY_DEFAULT_CHANNEL_LIST_SIZE setting.
  222. #define MY_DEFAULT_CHANNEL_SCAN_LIST        {1, 6, 10, 11, }
  223.     #define END_OF_MY_DEFAULT_CHANNEL_SCAN_LIST
  224.  
  225. // Count of elements in the MY_DEFAULT_CHANNEL_SCAN_LIST macro
  226. #define MY_DEFAULT_CHANNEL_LIST_SIZE        (4u)
  227.  
  228. /**********************************/
  229. /* SECURITY COMPILE TIME DEFAULTS */
  230. /**********************************/
  231. // Security used on WiFi network.  Legal values are:
  232. // kKeyTypeNone: No encryption/authentication
  233. // kKeyTypeWep: Wired Equivalency Protocol (WEP) encryption
  234. // kKeyTypePsk: WPA-PSK Personal or WPA2-PSK Personal TKIP or AES
  235. //              encryption with precalculated key (see MY_DEFAULT_PSK).
  236. // kKeyTypeCalcPsk: WPA-PSK Personal or WPA2-PSK Personal TKIP or AES
  237. //              encryption with the hardware dynamically generating the
  238. //              needed key for the selected SSID and passphrase.  This
  239. //              option requires more time to associate with the access
  240. //              point relative to kKeyTypePsk which has the key
  241. //              pre-calculated.
  242. #define MY_DEFAULT_ENCRYPTION_TYPE          kKeyTypePsk
  243.  
  244. // If using security type of kKeyTypePsk, then this section must be set to
  245. // match the key for the MY_DEFAULT_SSID_NAME and MY_DEFAULT_PSK_PHRASE
  246. // combination.  The tool at http://www.wireshark.org/tools/wpa-psk.html
  247. // can be used to generate this field.
  248. #define MY_DEFAULT_PSK  { 0x4d, 0x74, 0xd7, 0xcc, 0xb6, 0x0e, 0xe9, 0x3a, 0x5f, 0x09, 0x35, 0x02, 0x55, 0x0f, \
  249.                           0xc1, 0x5e, 0x0d, 0x32, 0xe8, 0x68, 0x62, 0x5f, 0x64, 0x0c, 0x47, 0x16, 0x13, 0x70, \
  250.                           0x4c, 0xb8, 0x8b, 0x50 }
  251.     #define END_OF_MY_DEFAULT_PSK
  252.  
  253. // Default pass phrase used for kKeyTypePsk and kKeyTypeCalcPsk security modes
  254. #define MY_DEFAULT_PSK_PHRASE               "PutkoMafani"
  255.  
  256. #define MY_DEFAULT_WEP_KEY_LEN              kZGWEPKeyLenLong
  257. #define MY_DEFAULT_WEP_KEYS                 MY_DEFAULT_WEP_KEYS_LONG
  258.  
  259. // Default WEP keys used in kKeyTypeWep security mode
  260. #define MY_DEFAULT_WEP_KEYS_LONG                {   {{0x00,0x01,0x02,0x03,0x04,0x05,0x06,0x07,0x08,0x09,0x0A,0x0B,0x0C}},\
  261.                                                 {{0x10,0x11,0x12,0x13,0x14,0x15,0x16,0x17,0x18,0x19,0x1A,0x1B,0x1C}},\
  262.                                                 {{0x20,0x21,0x22,0x23,0x24,0x25,0x26,0x27,0x28,0x29,0x2A,0x2B,0x2C}},\
  263.                                                 {{0x30,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x3A,0x3B,0x3C}},\
  264.                                                 }
  265.     #define END_OF_MY_DEFAULT_WEP_KEYS_LONG
  266. #define MY_DEFAULT_WEP_KEYS_SHORT               {   {{0x00,0x01,0x02,0x03,0x04}},\
  267.                                                 {{0x10,0x11,0x12,0x13,0x14}},\
  268.                                                 {{0x20,0x21,0x22,0x23,0x24}},\
  269.                                                 {{0x30,0x31,0x32,0x33,0x34}},\
  270.                                                 }
  271.     #define END_OF_MY_DEFAULT_WEP_KEYS_SHORT
  272.  
  273. /* Valid Key Index: 0, 1, 2, 3  */
  274. #define MY_DEFAULT_WEP_KEY_INDEX            (0u)
  275.  
  276. /* Valid WEP auth:   kZGAuthAlgOpen   */
  277. /*                   kZGAuthAlgShared */
  278. #define MY_DEFAULT_WEP_AUTH                 kZGAuthAlgOpen
  279.  
  280. // These options are required for all PIC devices
  281. #if defined(__18CXX)
  282.     #define ZG_NO_FUNC_PTRS                 y
  283. #endif
  284. #define ZG_CONFIG_LIBRARY                   y
  285. #define ZG_PKG_STDIO                        y
  286. #define ZG_RAW_DRIVER                       y
  287.  
  288. // These options are configurable
  289. // Provides indication if AP beacons are lost
  290. #define CONNECTION_LOST_FEATURE             y
  291.  
  292. // Command line interface
  293. //#define ZG_CONFIG_CONSOLE                   y
  294.  
  295. // Provides API to switch between static and dynamic IP addressing
  296. #if defined ( ZG_CONFIG_CONSOLE )
  297.     //#define ZG_CONFIG_DHCP                  y
  298. #endif
  299.  
  300. // WiFi (BSS), Adhoc (IBSS) connection management turn on/off
  301. #define ZG_CONFIG_LINKMGRII                 y
  302.  
  303. // Default link management
  304. /* Valid Modes:   kZGLMNetworkModeIdle            (Standby / neutral state)  */
  305. /*                kZGLMNetworkModeAdhoc           (IBSS networks)            */
  306. /*                kZGLMNetworkModeInfrastructure  (BSS networks)             */
  307. #define MY_DEFAULT_LINK_MGMT                kZGLMNetworkModeInfrastructure
  308.  
  309. // Uncomment this line if you do NOT need IBSS "adhoc" networks.
  310. // If uncommented, ensure that MY_DEFAULT_LINK_MGMT is not kZGLMNetworkModeAdhoc
  311. #define ZG_CONFIG_NO_ADHOCMGRII             y
  312.  
  313. // Uncomment this line if you do NOT need BSS "managed" networks.
  314. // If uncommented, ensure that MY_DEFAULT_LINK_MGMT is not kZGLMNetworkModeInfrastructure
  315. //#define ZG_CONFIG_NO_WIFIMGRII              y
  316.  
  317. // Enable Iperf application code.  Iperf is for performance benchmarking
  318. // and should normally be left disabled, unless you are using the TCPIP
  319. // WiFi Iperf App project.
  320. //#define STACK_USE_IPERF                     // Iperf Application
  321.  
  322.  
  323. // =======================================================================
  324. //   PIC32MX7XX/6XX MAC Layer Options
  325. //   If not using a PIC32MX7XX/6XX device, ignore this section.
  326. // =======================================================================
  327. #define ETH_CFG_LINK            0       // set to 1 if you need to config the link to specific following parameters
  328.                                         // otherwise the default connection will be attempted
  329.                                         // depending on the selected PHY
  330.     #define ETH_CFG_AUTO        1       // use auto negotiation
  331.     #define ETH_CFG_10          1       // use/advertise 10 Mbps capability
  332.     #define ETH_CFG_100         1       // use/advertise 100 Mbps capability
  333.     #define ETH_CFG_HDUPLEX     1       // use/advertise half duplex capability
  334.     #define ETH_CFG_FDUPLEX     1       // use/advertise full duplex capability
  335.     #define ETH_CFG_AUTO_MDIX   1       // use/advertise auto MDIX capability
  336.     #define ETH_CFG_SWAP_MDIX   1       // use swapped MDIX. else normal MDIX
  337.    
  338. #define EMAC_TX_DESCRIPTORS     2       // number of the TX descriptors to be created
  339. #define EMAC_RX_DESCRIPTORS     8       // number of the RX descriptors and RX buffers to be created
  340.  
  341. #define EMAC_RX_BUFF_SIZE       1536    // size of a RX buffer. should be multiple of 16
  342.                                         // this is the size of all receive buffers processed by the ETHC
  343.                                         // The size should be enough to accomodate any network received packet
  344.                                         // If the packets are larger, they will have to take multiple RX buffers
  345.                                         // The current implementation does not handle this situation right now and the packet is discarded.
  346.  
  347.  
  348. // =======================================================================
  349. //   Transport Layer Options
  350. // =======================================================================
  351.  
  352. /* Transport Layer Configuration
  353.  *   The following low level modules are automatically enabled
  354.  *   based on module selections above.  If your custom module
  355.  *   requires them otherwise, enable them here.
  356.  */
  357. //#define STACK_USE_TCP
  358. //#define STACK_USE_UDP
  359.  
  360. /* Client Mode Configuration
  361.  *   Uncomment following line if this stack will be used in CLIENT
  362.  *   mode.  In CLIENT mode, some functions specific to client operation
  363.  *   are enabled.
  364.  */
  365. #define STACK_CLIENT_MODE
  366.  
  367. /* TCP Socket Memory Allocation
  368.  *   TCP needs memory to buffer incoming and outgoing data.  The
  369.  *   amount and medium of storage can be allocated on a per-socket
  370.  *   basis using the example below as a guide.
  371.  */
  372.     // Allocate how much total RAM (in bytes) you want to allocate
  373.     // for use by your TCP TCBs, RX FIFOs, and TX FIFOs.
  374.     #define TCP_ETH_RAM_SIZE                    (4096ul)
  375.     #define TCP_PIC_RAM_SIZE                    (0ul)
  376.     #define TCP_SPI_RAM_SIZE                    (0ul)
  377.     #define TCP_SPI_RAM_BASE_ADDRESS            (0x00)
  378.  
  379.     // Define names of socket types
  380.     #define TCP_SOCKET_TYPES
  381.         #define TCP_PURPOSE_GENERIC_TCP_CLIENT 0
  382.         #define TCP_PURPOSE_GENERIC_TCP_SERVER 1
  383.         #define TCP_PURPOSE_TELNET 2
  384.         #define TCP_PURPOSE_FTP_COMMAND 3
  385.         #define TCP_PURPOSE_FTP_DATA 4
  386.         #define TCP_PURPOSE_TCP_PERFORMANCE_TX 5
  387.         #define TCP_PURPOSE_TCP_PERFORMANCE_RX 6
  388.         #define TCP_PURPOSE_UART_2_TCP_BRIDGE 7
  389.         #define TCP_PURPOSE_HTTP_SERVER 8
  390.         #define TCP_PURPOSE_DEFAULT 9
  391.         #define TCP_PURPOSE_BERKELEY_SERVER 10
  392.         #define TCP_PURPOSE_BERKELEY_CLIENT 11
  393.     #define END_OF_TCP_SOCKET_TYPES
  394.  
  395.     #if defined(__TCP_C)
  396.         // Define what types of sockets are needed, how many of
  397.         // each to include, where their TCB, TX FIFO, and RX FIFO
  398.         // should be stored, and how big the RX and TX FIFOs should
  399.         // be.  Making this initializer bigger or smaller defines
  400.         // how many total TCP sockets are available.
  401.         //
  402.         // Each socket requires up to 56 bytes of PIC RAM and
  403.         // 48+(TX FIFO size)+(RX FIFO size) bytes of TCP_*_RAM each.
  404.         //
  405.         // Note: The RX FIFO must be at least 1 byte in order to
  406.         // receive SYN and FIN messages required by TCP.  The TX
  407.         // FIFO can be zero if desired.
  408.         #define TCP_CONFIGURATION
  409.         ROM struct
  410.         {
  411.             BYTE vSocketPurpose;
  412.             BYTE vMemoryMedium;
  413.             WORD wTXBufferSize;
  414.             WORD wRXBufferSize;
  415.         } TCPSocketInitializer[] =
  416.         {
  417.             //{TCP_PURPOSE_GENERIC_TCP_CLIENT, TCP_ETH_RAM, 125, 100},
  418.             //{TCP_PURPOSE_GENERIC_TCP_SERVER, TCP_ETH_RAM, 20, 20},
  419.             //{TCP_PURPOSE_TELNET, TCP_ETH_RAM, 200, 150},
  420.             //{TCP_PURPOSE_FTP_COMMAND, TCP_ETH_RAM, 100, 40},
  421.             //{TCP_PURPOSE_FTP_DATA, TCP_ETH_RAM, 0, 128},
  422.             //{TCP_PURPOSE_TCP_PERFORMANCE_TX, TCP_ETH_RAM, 200, 1},
  423.             //{TCP_PURPOSE_TCP_PERFORMANCE_RX, TCP_ETH_RAM, 40, 1500},
  424.             //{TCP_PURPOSE_UART_2_TCP_BRIDGE, TCP_ETH_RAM, 256, 256},
  425.             {TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 1000, 1000},
  426.             {TCP_PURPOSE_HTTP_SERVER, TCP_ETH_RAM, 1000, 1000},
  427.             //{TCP_PURPOSE_DEFAULT, TCP_ETH_RAM, 1000, 1000},
  428.             //{TCP_PURPOSE_BERKELEY_SERVER, TCP_ETH_RAM, 25, 20},
  429.             //{TCP_PURPOSE_BERKELEY_CLIENT, TCP_ETH_RAM, 125, 100},
  430.         };
  431.         #define END_OF_TCP_CONFIGURATION
  432.     #endif
  433.  
  434. /* UDP Socket Configuration
  435.  *   Define the maximum number of available UDP Sockets, and whether
  436.  *   or not to include a checksum on packets being transmitted.
  437.  */
  438. #define MAX_UDP_SOCKETS     (9u)
  439. #define UDP_USE_TX_CHECKSUM     // This slows UDP TX performance by nearly 50%, except when using the ENCX24J600, which has a super fast DMA and incurs virtually no speed pentalty.
  440.  
  441.  
  442. /* Berkeley API Sockets Configuration
  443.  *   Note that each Berkeley socket internally uses one TCP or UDP socket
  444.  *   defined by MAX_UDP_SOCKETS and the TCPSocketInitializer[] array.
  445.  *   Therefore, this number MUST be less than or equal to MAX_UDP_SOCKETS + the
  446.  *   number of TCP sockets defined by the TCPSocketInitializer[] array
  447.  *   (i.e. sizeof(TCPSocketInitializer)/sizeof(TCPSocketInitializer[0])).
  448.  *   This define has no effect if STACK_USE_BERKELEY_API is not defined and
  449.  *   Berkeley Sockets are disabled.  Set this value as low as your application
  450.  *   requires to avoid waisting RAM.
  451.  */
  452. #define BSD_SOCKET_COUNT (5u)
  453.  
  454.  
  455. // =======================================================================
  456. //   Application-Specific Options
  457. // =======================================================================
  458.  
  459. // -- HTTP2 Server options -----------------------------------------------
  460.  
  461.     // Maximum numbers of simultaneous HTTP connections allowed.
  462.     // Each connection consumes 2 bytes of RAM and a TCP socket
  463.     #define MAX_HTTP_CONNECTIONS    (2u)
  464.  
  465.     // Indicate what file to serve when no specific one is requested
  466.     #define HTTP_DEFAULT_FILE       "index.htm"
  467.     #define HTTPS_DEFAULT_FILE      "index.htm"
  468.     #define HTTP_DEFAULT_LEN        (10u)       // For buffer overrun protection.
  469.                                                 // Set to longest length of above two strings.
  470.  
  471.     // Configure MPFS over HTTP updating
  472.     // Comment this line to disable updating via HTTP
  473.     #define HTTP_MPFS_UPLOAD        "mpfsupload"
  474.     //#define HTTP_MPFS_UPLOAD_REQUIRES_AUTH    // Require password for MPFS uploads
  475.         // Certain firewall and router combinations cause the MPFS2 Utility to fail
  476.         // when uploading.  If this happens, comment out this definition.
  477.  
  478.     // Define which HTTP modules to use
  479.     // If not using a specific module, comment it to save resources
  480.     #define HTTP_USE_POST                   // Enable POST support
  481.     #define HTTP_USE_COOKIES                // Enable cookie support
  482.     #define HTTP_USE_AUTHENTICATION         // Enable basic authentication support
  483.  
  484.     //#define HTTP_NO_AUTH_WITHOUT_SSL      // Uncomment to require SSL before requesting a password
  485.     #define HTTP_SSL_ONLY_CHAR      0xFF    // Files beginning with this character will only be served over HTTPS
  486.                                             // Set to 0x00 to require for all files
  487.                                             // Set to 0xff to require for no files
  488.  
  489.     #define STACK_USE_HTTP_APP_RECONFIG     // Use the AppConfig web page in the Demo App (~2.5kb ROM, ~0b RAM)
  490.     #define STACK_USE_HTTP_MD5_DEMO         // Use the MD5 Demo web page (~5kb ROM, ~160b RAM)
  491.     //#define STACK_USE_HTTP_EMAIL_DEMO     // Use the e-mail demo web page
  492.  
  493. // -- SSL Options --------------------------------------------------------
  494.  
  495.     #define MAX_SSL_CONNECTIONS     (2ul)   // Maximum connections via SSL
  496.     #define MAX_SSL_SESSIONS        (2ul)   // Max # of cached SSL sessions
  497.     #define MAX_SSL_BUFFERS         (4ul)   // Max # of SSL buffers (2 per socket)
  498.     #define MAX_SSL_HASHES          (5ul)   // Max # of SSL hashes  (2 per, plus 1 to avoid deadlock)
  499.  
  500.     // Bits in SSL RSA key.  This parameter is used for SSL sever
  501.     // connections only.  The only valid value is 512 bits (768 and 1024
  502.     // bits do not work at this time).  Note, however, that SSL client
  503.     // operations do currently work up to 1024 bit RSA key length.
  504.     #define SSL_RSA_KEY_SIZE        (512ul)
  505.  
  506.  
  507. // -- Telnet Options -----------------------------------------------------
  508.  
  509.     // Number of simultaneously allowed Telnet sessions.  Note that you
  510.     // must have an equal number of TCP_PURPOSE_TELNET type TCP sockets
  511.     // declared in the TCPSocketInitializer[] array above for multiple
  512.     // connections to work.  If fewer sockets are available than this
  513.     // definition, then the the lesser of the two quantities will be the
  514.     // actual limit.
  515.     #define MAX_TELNET_CONNECTIONS  (1u)
  516.  
  517.     // Default local listening port for the Telnet server.  Port 23 is the
  518.     // protocol default.
  519.     #define TELNET_PORT             (23u)
  520.  
  521.     // Default local listening port for the Telnet server when SSL secured.
  522.     // Port 992 is the telnets protocol default.
  523.     #define TELNETS_PORT            992
  524.  
  525.     // Force all connecting clients to be SSL secured and connected via
  526.     // TELNETS_PORT.  Connections on port TELNET_PORT will be ignored.  If
  527.     // STACK_USE_SSL_SERVER is undefined, this entire setting is ignored
  528.     // (server will accept unsecured connections on TELNET_PORT and won't even
  529.     // listen on TELNETS_PORT).
  530.     //#define TELNET_REJECT_UNSECURED
  531.  
  532.     // Default username and password required to login to the Telnet server.
  533.     #define TELNET_USERNAME         "admin"
  534.     #define TELNET_PASSWORD         "microchip"
  535.  
  536.  
  537. // -- SNMP Options -------------------------------------------------------
  538.  
  539.     // Comment following line if SNMP TRAP support is needed
  540.     //#define SNMP_TRAP_DISABLED
  541.  
  542.     // This is the maximum length for community string.
  543.     // Application must ensure that this length is observed.
  544.     // SNMP module adds one byte extra after SNMP_COMMUNITY_MAX_LEN
  545.     // for adding '\0' NULL character.
  546.     #define SNMP_COMMUNITY_MAX_LEN      (8u)
  547.     #define SNMP_MAX_COMMUNITY_SUPPORT  (3u)
  548.     #define NOTIFY_COMMUNITY_LEN        (SNMP_COMMUNITY_MAX_LEN)
  549.  
  550.     // Default SNMPv2C community names.  These can be overridden at run time if
  551.     // alternate strings are present in external EEPROM or Flash (actual
  552.     // strings are stored in AppConfig.readCommunity[] and
  553.     // AppConfig.writeCommunity[] arrays).  These strings are case sensitive.
  554.     // An empty string means disabled (not matchable).
  555.     // For application security, these default community names should not be
  556.     // used, but should all be disabled to force the end user to select unique
  557.     // community names.  These defaults are provided only to make it easier to
  558.     // start development.  Specifying more strings than
  559.     // SNMP_MAX_COMMUNITY_SUPPORT will result in the later strings being
  560.     // ignored (but still wasting program memory).  Specifying fewer strings is
  561.     // legal, as long as at least one is present.  A string larger than
  562.     // SNMP_COMMUNITY_MAX_LEN bytes will be ignored.
  563.     #define SNMP_READ_COMMUNITIES        {"public", "read", ""}
  564.     #define END_OF_SNMP_READ_COMMUNITIES
  565.     #define SNMP_WRITE_COMMUNITIES        {"private", "write", "public"}
  566.     #define END_OF_SNMP_WRITE_COMMUNITIES
  567. #endif
  568.  
  569.  
  570. //#define MPFS_USE_FAT     
  571.  
  572. #define MDD_ROOT_DIR_PATH       "\\"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement