]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Plus/Source/FreeRTOS-Plus-UDP/FreeRTOS_DNS.c
Update FreeRTOS+ more demos that use FreeRTOS+CLI to remove casting to int8_t * from...
[freertos] / FreeRTOS-Plus / Source / FreeRTOS-Plus-UDP / FreeRTOS_DNS.c
index 57366eea11bb8064c794312972af798b4ad55a63..5eb6e2a49897433030d79b9e3b58880f43c49437 100644 (file)
@@ -5,11 +5,11 @@
  * This file is part of the FreeRTOS+UDP distribution.  The FreeRTOS+UDP license\r
  * terms are different to the FreeRTOS license terms.\r
  *\r
- * FreeRTOS+UDP uses a dual license model that allows the software to be used \r
- * under a standard GPL open source license, or a commercial license.  The \r
- * standard GPL license (unlike the modified GPL license under which FreeRTOS \r
- * itself is distributed) requires that all software statically linked with \r
- * FreeRTOS+UDP is also distributed under the same GPL V2 license terms.  \r
+ * FreeRTOS+UDP uses a dual license model that allows the software to be used\r
+ * under a standard GPL open source license, or a commercial license.  The\r
+ * standard GPL license (unlike the modified GPL license under which FreeRTOS\r
+ * itself is distributed) requires that all software statically linked with\r
+ * FreeRTOS+UDP is also distributed under the same GPL V2 license terms.\r
  * Details of both license options follow:\r
  *\r
  * - Open source licensing -\r
@@ -21,9 +21,9 @@
  *\r
  * - Commercial licensing -\r
  * Businesses and individuals that for commercial or other reasons cannot comply\r
- * with the terms of the GPL V2 license must obtain a commercial license before \r
- * incorporating FreeRTOS+UDP into proprietary software for distribution in any \r
- * form.  Commercial licenses can be purchased from http://shop.freertos.org/udp \r
+ * with the terms of the GPL V2 license must obtain a commercial license before\r
+ * incorporating FreeRTOS+UDP into proprietary software for distribution in any\r
+ * form.  Commercial licenses can be purchased from http://shop.freertos.org/udp\r
  * and do not require any source files to be changed.\r
  *\r
  * FreeRTOS+UDP is distributed in the hope that it will be useful.  You cannot\r
@@ -99,7 +99,7 @@ static xSocket_t prvCreateDNSSocket( void );
 /*\r
  * Create the DNS message in the zero copy buffer passed in the first parameter.\r
  */\r
-static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const uint8_t *pcHostName, uint16_t usIdentifier );\r
+static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const char *pcHostName, uint16_t usIdentifier );\r
 \r
 /*\r
  * Simple routine that jumps over the NAME field of a resource record.\r
@@ -128,7 +128,7 @@ typedef struct xDNSMessage xDNSMessage_t;
 \r
 /*-----------------------------------------------------------*/\r
 \r
-uint32_t FreeRTOS_gethostbyname( const uint8_t *pcHostName )\r
+uint32_t FreeRTOS_gethostbyname( const char *pcHostName )\r
 {\r
 static uint16_t usIdentifier = 0;\r
 struct freertos_sockaddr xAddress;\r
@@ -139,7 +139,7 @@ static uint32_t ulAddressLength;
 portBASE_TYPE xAttempt;\r
 int32_t lBytes;\r
 size_t xPayloadLength;\r
-const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( ( const char * const ) pcHostName ) + sizeof( uint16_t ) + sizeof( uint16_t ) + 2; /* Two for the count of characters in the first subdomain part, and the string end byte */\r
+const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( pcHostName ) + sizeof( uint16_t ) + sizeof( uint16_t ) + 2; /* Two for the count of characters in the first subdomain part, and the string end byte */\r
 \r
        if( xDNSSocket == NULL )\r
        {\r
@@ -207,7 +207,7 @@ const size_t xExpectedPayloadLength = sizeof( xDNSMessage_t ) + strlen( ( const
 }\r
 /*-----------------------------------------------------------*/\r
 \r
-static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const uint8_t *pcHostName, uint16_t usIdentifier )\r
+static size_t prvCreateDNSMessage( uint8_t *pucUDPPayloadBuffer, const char *pcHostName, uint16_t usIdentifier )\r
 {\r
 xDNSMessage_t *pxDNSMessageHeader;\r
 uint8_t *pucStart, *pucByte;\r
@@ -237,10 +237,10 @@ static const xDNSMessage_t xDefaultPartDNSHeader =
        pucByte = pucStart + 1;\r
 \r
        /* Copy in the host name. */\r
-       strcpy( ( char * ) pucByte, ( const char * ) pcHostName );\r
+       strcpy( ( char * ) pucByte, pcHostName );\r
 \r
        /* Mark the end of the string. */\r
-       pucByte += strlen( ( const char * ) pcHostName );\r
+       pucByte += strlen( pcHostName );\r
        *pucByte = 0x00;\r
 \r
        /* Walk the string to replace the '.' characters with byte counts.\r