Make Webserver allow HTTP requests for files with up to 50 characters in the path...
authorDean Camera <dean@fourwalledcubicle.com>
Sun, 7 Feb 2010 10:46:02 +0000 (10:46 +0000)
committerDean Camera <dean@fourwalledcubicle.com>
Sun, 7 Feb 2010 10:46:02 +0000 (10:46 +0000)
Change Webserver project's ENABLE_DHCP compile time option to ENABLE_DHCP_CLIENT to more accurately indicate its function.

LUFA/ManPages/LUFAPoweredProjects.txt
Projects/Webserver/Lib/DHCPClientApp.c
Projects/Webserver/Lib/uIPManagement.c
Projects/Webserver/Lib/uip/uipopt.h
Projects/Webserver/Webserver.txt
Projects/Webserver/makefile

index dfcd712..e7561e6 100644 (file)
@@ -33,6 +33,7 @@
  *  can be incorporated into many different applications.\r
  *\r
  *  - Arcade Controller: http://fletchtronics.net/arcade-controller-made-petunia\r
  *  can be incorporated into many different applications.\r
  *\r
  *  - Arcade Controller: http://fletchtronics.net/arcade-controller-made-petunia\r
+ *  - AVR USB Modem, a 3G Wireless Modem host: http://code.google.com/p/avrusbmodem/\r
  *  - Bicycle POV: http://www.code.google.com/p/bicycleledpov/\r
  *  - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig\r
  *  - ClockTamer, a configurable clock generator: http://code.google.com/p/clock-tamer/\r
  *  - Bicycle POV: http://www.code.google.com/p/bicycleledpov/\r
  *  - CAMTRIG, a remote Camera Trigger device: http://code.astraw.com/projects/motmot/camtrig\r
  *  - ClockTamer, a configurable clock generator: http://code.google.com/p/clock-tamer/\r
index 64cd707..2097062 100644 (file)
@@ -36,7 +36,7 @@
  \r
 #include "DHCPClientApp.h"\r
 \r
  \r
 #include "DHCPClientApp.h"\r
 \r
-#if defined(ENABLE_DHCP) || defined(__DOXYGEN__)\r
+#if defined(ENABLE_DHCP_CLIENT) || defined(__DOXYGEN__)\r
 /** Timer for managing the timeout period for a DHCP server to respond */\r
 struct timer DHCPTimer;\r
 \r
 /** Timer for managing the timeout period for a DHCP server to respond */\r
 struct timer DHCPTimer;\r
 \r
index c7773c4..ba2a505 100644 (file)
@@ -212,7 +212,7 @@ static void uIPManagement_ManageConnections(void)
                        }\r
                }\r
                \r
                        }\r
                }\r
                \r
-               #if defined(ENABLE_DHCP)\r
+               #if defined(ENABLE_DHCP_CLIENT)\r
                for (uint8_t i = 0; i < UIP_UDP_CONNS; i++)\r
                {\r
                        /* Run periodic connection management for each UDP connection */\r
                for (uint8_t i = 0; i < UIP_UDP_CONNS; i++)\r
                {\r
                        /* Run periodic connection management for each UDP connection */\r
index c8b3ad5..c8d0cd2 100644 (file)
@@ -689,7 +689,7 @@ typedef union
                uint8_t  CurrentState;
                uint8_t  NextState;
                
                uint8_t  CurrentState;
                uint8_t  NextState;
                
-               char     FileName[30];
+               char     FileName[50];
                FIL      FileHandle;
                bool     FileOpen;
                uint32_t ACKedFilePos;
                FIL      FileHandle;
                bool     FileOpen;
                uint32_t ACKedFilePos;
index 59b5302..9cee32e 100644 (file)
  *  To use this project, plug the USB AVR into a computer, so that it enumerates as a standard Mass Storage device. Load\r
  *  HTML files onto the disk, so that they can be served out to clients -- the default file to serve should be called\r
  *  <i>index.htm</i>. Filenames must be in 8.3 format for them to be retrieved correctly by the webserver, and the total\r
  *  To use this project, plug the USB AVR into a computer, so that it enumerates as a standard Mass Storage device. Load\r
  *  HTML files onto the disk, so that they can be served out to clients -- the default file to serve should be called\r
  *  <i>index.htm</i>. Filenames must be in 8.3 format for them to be retrieved correctly by the webserver, and the total\r
- *  requested file path must be equal to or less than 50 characters.\r
+ *  requested file path must be equal to or less than 50 characters (set in uipopt.h).\r
  *\r
  *  When attached to a RNDIS class device, such as a USB (desktop) modem, the system will enumerate the device, set the\r
  *\r
  *  When attached to a RNDIS class device, such as a USB (desktop) modem, the system will enumerate the device, set the\r
- *  appropriate parameters needed for connectivity and begin listening for new HTTP connections on port 80. The device IP,\r
- *  netmask and default gateway IP must be set to values appropriate for the RNDIS device being used for this project to \r
- *  work, if the DHCP client is disabled (see \ref SSec_Options).\r
+ *  appropriate parameters needed for connectivity and begin listening for new HTTP connections on port 80 and TELNET\r
+ *  connections on port 23. The device IP, netmask and default gateway IP must be set to values appropriate for the RNDIS\r
+ *  device being used for this project to work if the DHCP client is disabled (see \ref SSec_Options) - otherwise, the device\r
+ *  will query the network's DHCP server for these parameters automatically.\r
  *\r
  *\r
- *  When properly configured, the webserver can be accessed from any HTTP webrowser by typing in the device's static or\r
- *  dynamically allocated IP address.\r
+ *  When properly configured, the webserver can be accessed from any HTTP webrowser by typing in the device's statically or\r
+ *  dynamically allocated IP address. The TELNET client can be accessed via any network socket app by connecting to the device\r
+ *  on port 23 on the device's statically or dynamically allocated IP address.\r
  *\r
  *  \section SSec_Options Project Options\r
  *\r
  *\r
  *  \section SSec_Options Project Options\r
  *\r
@@ -76,7 +78,7 @@
  *    <td><b>Description:</b></td>\r
  *   </tr>\r
  *   <tr>\r
  *    <td><b>Description:</b></td>\r
  *   </tr>\r
  *   <tr>\r
- *    <td>ENABLE_DHCP=<i>x</i></td>\r
+ *    <td>ENABLE_DHCP_CLIENT=<i>x</i></td>\r
  *    <td>Makefile CDEFS</td>\r
  *    <td>When set to 1, this enables the DHCP client for dynamic IP allocation of the network settings from a DHCP server.\r
  *        To disable DHCP and use the fixed address settings set elsewhere, set this to zero (do not undefine it).</td>\r
  *    <td>Makefile CDEFS</td>\r
  *    <td>When set to 1, this enables the DHCP client for dynamic IP allocation of the network settings from a DHCP server.\r
  *        To disable DHCP and use the fixed address settings set elsewhere, set this to zero (do not undefine it).</td>\r
  *   <tr>\r
  *    <td>DEVICE_IP_ADDRESS</td>\r
  *    <td>Lib/uIPManagement.h</td>\r
  *   <tr>\r
  *    <td>DEVICE_IP_ADDRESS</td>\r
  *    <td>Lib/uIPManagement.h</td>\r
- *    <td>IP address that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP is not defined).</td>\r
+ *    <td>IP address that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP_CLIENT is zero).</td>\r
  *   </tr>\r
  *   <tr>\r
  *    <td>DEVICE_NETMASK</td>\r
  *    <td>Lib/uIPManagement.h</td>\r
  *   </tr>\r
  *   <tr>\r
  *    <td>DEVICE_NETMASK</td>\r
  *    <td>Lib/uIPManagement.h</td>\r
- *    <td>Netmask that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP is not defined).</td>\r
+ *    <td>Netmask that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP_CLIENT is zero).</td>\r
  *   </tr>\r
  *   <tr>\r
  *    <td>DEVICE_GATEWAY</td>\r
  *    <td>Lib/uIPManagement.h</td>\r
  *   </tr>\r
  *   <tr>\r
  *    <td>DEVICE_GATEWAY</td>\r
  *    <td>Lib/uIPManagement.h</td>\r
- *    <td>Default routing gateway that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP\r
- *        is not defined).</td>\r
+ *    <td>Default routing gateway that the webserver should use when connected to a RNDIS device (when ENABLE_DHCP_CLIENT\r
+ *        is zero).</td>\r
  *   </tr>\r
  *  </table>\r
  */
\ No newline at end of file
  *   </tr>\r
  *  </table>\r
  */
\ No newline at end of file
index 98ee03c..2097988 100644 (file)
@@ -198,9 +198,9 @@ CSTANDARD = -std=gnu99
 \r
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)\r
 \r
 # Place -D or -U options here for C sources\r
 CDEFS  = -DF_CPU=$(F_CPU)UL -DF_CLOCK=$(F_CLOCK)UL -DBOARD=BOARD_$(BOARD) $(LUFA_OPTS)\r
-CDEFS += -DENABLE_DHCP=1\r
+CDEFS += -DENABLE_DHCP_CLIENT=1\r
 \r
 \r
-CDEFS += -DUIP_CONF_UDP=ENABLE_DHCP -DUIP_CONF_TCP=1 -DUIP_CONF_UDP_CONNS=1 -DUIP_CONF_MAX_CONNECTIONS=5\r
+CDEFS += -DUIP_CONF_UDP=ENABLE_DHCP_CLIENT -DUIP_CONF_TCP=1 -DUIP_CONF_UDP_CONNS=1 -DUIP_CONF_MAX_CONNECTIONS=5\r
 CDEFS += -DUIP_CONF_MAX_LISTENPORTS=5 -DUIP_URGDATA=0 -DUIP_CONF_BUFFER_SIZE=1514 -DUIP_ARCH_CHKSUM=0 \r
 CDEFS += -DUIP_CONF_LL_802154=0 -DUIP_CONF_LL_80211=0 -DUIP_CONF_ROUTER=0 -DUIP_CONF_ICMP6=0\r
 CDEFS += -DUIP_ARCH_ADD32=0 -DUIP_CONF_ICMP_DEST_UNREACH=1 -DUIP_NEIGHBOR_CONF_ADDRTYPE=0\r
 CDEFS += -DUIP_CONF_MAX_LISTENPORTS=5 -DUIP_URGDATA=0 -DUIP_CONF_BUFFER_SIZE=1514 -DUIP_ARCH_CHKSUM=0 \r
 CDEFS += -DUIP_CONF_LL_802154=0 -DUIP_CONF_LL_80211=0 -DUIP_CONF_ROUTER=0 -DUIP_CONF_ICMP6=0\r
 CDEFS += -DUIP_ARCH_ADD32=0 -DUIP_CONF_ICMP_DEST_UNREACH=1 -DUIP_NEIGHBOR_CONF_ADDRTYPE=0\r