]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/https/include/iot_https_utils.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Source / FreeRTOS-IoT-Libraries / c_sdk / standard / https / include / iot_https_utils.h
diff --git a/FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/https/include/iot_https_utils.h b/FreeRTOS-Labs/Source/FreeRTOS-IoT-Libraries/c_sdk/standard/https/include/iot_https_utils.h
new file mode 100644 (file)
index 0000000..849d3fa
--- /dev/null
@@ -0,0 +1,95 @@
+/*\r
+ * Amazon FreeRTOS HTTPS Client V1.1.0\r
+ * Copyright (C) 2019 Amazon.com, Inc. or its affiliates.  All Rights Reserved.\r
+ *\r
+ * Permission is hereby granted, free of charge, to any person obtaining a copy of\r
+ * this software and associated documentation files (the "Software"), to deal in\r
+ * the Software without restriction, including without limitation the rights to\r
+ * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of\r
+ * the Software, and to permit persons to whom the Software is furnished to do so,\r
+ * subject to the following conditions:\r
+ *\r
+ * The above copyright notice and this permission notice shall be included in all\r
+ * copies or substantial portions of the Software.\r
+ *\r
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\r
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS\r
+ * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR\r
+ * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER\r
+ * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN\r
+ * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\r
+ *\r
+ * http://aws.amazon.com/freertos\r
+ * http://www.FreeRTOS.org\r
+ */\r
+\r
+/**\r
+ * @file iot_https_utils.h\r
+ * @brief User facing HTTPS Client library utilities.\r
+ */\r
+\r
+#ifndef IOT_HTTPS_UTILS_H_\r
+#define IOT_HTTPS_UTILS_H_\r
+\r
+#include "types/iot_https_types.h"\r
+\r
+/*-----------------------------------------------------------*/\r
+\r
+/**\r
+ * @brief Retrieve the path from the input URL.\r
+ *\r
+ * This function retrieves the location and length of the path from within the\r
+ * input the URL. The query is not included in the length returned.\r
+ *\r
+ * The URL MUST start with "http://" or "https://" to find the path.\r
+ *\r
+ * For example, if the URL is:\r
+ * pUrl = "https://www.somewebsite.com/path/to/item.txt?optionalquery=stuff"\r
+ *\r
+ * *pPath = "/path/to/item.txt?optionalquery=stuff"\r
+ * *pPathLen = 17\r
+ *\r
+ * @param[in] pUrl - URL string to parse.\r
+ * @param[in] urlLen - The length of the URL string input.\r
+ * @param[out] pPath - pointer within input url that the path starts at.\r
+ * @param[out] pPathLen - Length of the path.\r
+ *\r
+ * - #IOT_HTTPS_OK if the path was successfully parsed.\r
+ * - #IOT_HTTPS_PARSING_ERROR if there was an error parsing the URL.\r
+ * - #IOT_HTTPS_NOT_FOUND if the path was not found.\r
+ */\r
+IotHttpsReturnCode_t IotHttpsClient_GetUrlPath( const char * pUrl,\r
+                                                size_t urlLen,\r
+                                                const char ** pPath,\r
+                                                size_t * pPathLen );\r
+\r
+/**\r
+ * @brief Retrieve the Address from the input URL.\r
+ *\r
+ * This function retrieves the location and length of the address from within\r
+ * the input URL. The path and query are not included in the length returned.\r
+ *\r
+ * The URL MUST start with "http://" or "https://" to find the address.\r
+ *\r
+ * For example, if the URL is:\r
+ * pUrl = "https://www.somewebsite.com/path/to/item.txt?optionalquery=stuff"\r
+ *\r
+ * *pAddress = "www.somewebsite.com/path/to/item.txt?optionalquery=stuff"\r
+ * *pAddressLen = 19\r
+ *\r
+ * @param[in] pUrl - URL string to parse.\r
+ * @param[in] urlLen - The length of the URL string input.\r
+ * @param[out] pAddress - pointer within input url that the address starts at.\r
+ * @param[out] pAddressLen - Length of the address.\r
+ *\r
+ * @return One of the following:\r
+ * - #IOT_HTTPS_OK if the path was successfully parsed.\r
+ * - #IOT_HTTPS_PARSING_ERROR if there was an error parsing the URL.\r
+ * - #IOT_HTTPS_NOT_FOUND if the address was not found.\r
+ */\r
+IotHttpsReturnCode_t IotHttpsClient_GetUrlAddress( const char * pUrl,\r
+                                                   size_t urlLen,\r
+                                                   const char ** pAddress,\r
+                                                   size_t * pAddressLen );\r
+\r
+#endif /* IOT_HTTPS_UTILS_H_ */\r