coreHTTP  v2.0.2
HTTP/1.1 Client Library
transport_interface.h
Go to the documentation of this file.
1 /*
2  * coreHTTP v2.0.2
3  * Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Permission is hereby granted, free of charge, to any person obtaining a copy of
6  * this software and associated documentation files (the "Software"), to deal in
7  * the Software without restriction, including without limitation the rights to
8  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
9  * the Software, and to permit persons to whom the Software is furnished to do so,
10  * subject to the following conditions:
11  *
12  * The above copyright notice and this permission notice shall be included in all
13  * copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
17  * FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
18  * COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
19  * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
20  * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
28 #ifndef TRANSPORT_INTERFACE_H_
29 #define TRANSPORT_INTERFACE_H_
30 
31 #include <stdint.h>
32 #include <stddef.h>
33 
34 /* *INDENT-OFF* */
35 #ifdef __cplusplus
36  extern "C" {
37 #endif
38 /* *INDENT-ON* */
39 
187 /* @[define_networkcontext] */
188 struct NetworkContext;
189 typedef struct NetworkContext NetworkContext_t;
190 /* @[define_networkcontext] */
191 
218 /* @[define_transportrecv] */
219 typedef int32_t ( * TransportRecv_t )( NetworkContext_t * pNetworkContext,
220  void * pBuffer,
221  size_t bytesToRecv );
222 /* @[define_transportrecv] */
223 
240 /* @[define_transportsend] */
241 typedef int32_t ( * TransportSend_t )( NetworkContext_t * pNetworkContext,
242  const void * pBuffer,
243  size_t bytesToSend );
244 /* @[define_transportsend] */
245 
250 /* @[define_transportinterface] */
251 typedef struct TransportInterface
252 {
257 /* @[define_transportinterface] */
258 
259 /* *INDENT-OFF* */
260 #ifdef __cplusplus
261  }
262 #endif
263 /* *INDENT-ON* */
264 
265 #endif /* ifndef TRANSPORT_INTERFACE_H_ */
NetworkContext_t
struct NetworkContext NetworkContext_t
The NetworkContext is an incomplete type. An implementation of this interface must define struct Netw...
Definition: transport_interface.h:189
TransportInterface_t::send
TransportSend_t send
Definition: transport_interface.h:254
TransportSend_t
int32_t(* TransportSend_t)(NetworkContext_t *pNetworkContext, const void *pBuffer, size_t bytesToSend)
Transport interface for sending data over the network.
Definition: transport_interface.h:241
TransportRecv_t
int32_t(* TransportRecv_t)(NetworkContext_t *pNetworkContext, void *pBuffer, size_t bytesToRecv)
Transport interface for receiving data on the network.
Definition: transport_interface.h:219
TransportInterface_t::pNetworkContext
NetworkContext_t * pNetworkContext
Definition: transport_interface.h:255
TransportInterface_t::recv
TransportRecv_t recv
Definition: transport_interface.h:253
TransportInterface_t
The transport layer interface.
Definition: transport_interface.h:252