]> git.sur5r.net Git - freertos/blobdiff - FreeRTOS-Labs/Source/FreeRTOS-Plus-TCP/include/NetworkBufferManagement.h
Add the Labs projects provided in the V10.2.1_191129 zip file.
[freertos] / FreeRTOS-Labs / Source / FreeRTOS-Plus-TCP / include / NetworkBufferManagement.h
diff --git a/FreeRTOS-Labs/Source/FreeRTOS-Plus-TCP/include/NetworkBufferManagement.h b/FreeRTOS-Labs/Source/FreeRTOS-Plus-TCP/include/NetworkBufferManagement.h
new file mode 100644 (file)
index 0000000..9543ef4
--- /dev/null
@@ -0,0 +1,70 @@
+/*\r
+ * FreeRTOS+TCP 191100 experimental\r
+ * Copyright (C) 2018 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
+#ifndef NETWORK_BUFFER_MANAGEMENT_H\r
+#define NETWORK_BUFFER_MANAGEMENT_H\r
+\r
+#ifdef __cplusplus\r
+extern "C" {\r
+#endif\r
+\r
+/* NOTE PUBLIC API FUNCTIONS. */\r
+BaseType_t xNetworkBuffersInitialise( void );\r
+NetworkBufferDescriptor_t *pxGetNetworkBufferWithDescriptor( size_t xRequestedSizeBytes, TickType_t xBlockTimeTicks );\r
+NetworkBufferDescriptor_t *pxNetworkBufferGetFromISR( size_t xRequestedSizeBytes );\r
+void vReleaseNetworkBufferAndDescriptor( NetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+BaseType_t vNetworkBufferReleaseFromISR( NetworkBufferDescriptor_t * const pxNetworkBuffer );\r
+uint8_t *pucGetNetworkBuffer( size_t *pxRequestedSizeBytes );\r
+void vReleaseNetworkBuffer( uint8_t *pucEthernetBuffer );\r
+\r
+/* Get the current number of free network buffers. */\r
+UBaseType_t uxGetNumberOfFreeNetworkBuffers( void );\r
+\r
+/* Get the lowest number of free network buffers. */\r
+UBaseType_t uxGetMinimumFreeNetworkBuffers( void );\r
+\r
+/* Copy a network buffer into a bigger buffer. */\r
+NetworkBufferDescriptor_t *pxDuplicateNetworkBufferWithDescriptor( NetworkBufferDescriptor_t * const pxNetworkBuffer,\r
+       BaseType_t xNewLength);\r
+\r
+/* Increase the size of a Network Buffer.\r
+In case BufferAllocation_2.c is used, the new space must be allocated. */\r
+NetworkBufferDescriptor_t *pxResizeNetworkBufferWithDescriptor( NetworkBufferDescriptor_t * pxNetworkBuffer,\r
+       size_t xNewSizeBytes );\r
+\r
+#if ipconfigTCP_IP_SANITY\r
+       /*\r
+        * Check if an address is a valid pointer to a network descriptor\r
+        * by looking it up in the array of network descriptors\r
+        */\r
+       UBaseType_t bIsValidNetworkDescriptor (const NetworkBufferDescriptor_t * pxDesc);\r
+       BaseType_t prvIsFreeBuffer( const NetworkBufferDescriptor_t *pxDescr );\r
+#endif\r
+\r
+#ifdef __cplusplus\r
+} // extern "C"\r
+#endif\r
+\r
+#endif /* NETWORK_BUFFER_MANAGEMENT_H */\r