coreHTTP  v2.0.0
HTTP/1.1 Client Library
transport_interface.h
Go to the documentation of this file.
1 /*
2  * coreHTTP v2.0.0
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 
181 /* @[define_networkcontext] */
182 struct NetworkContext;
183 typedef struct NetworkContext NetworkContext_t;
184 /* @[define_networkcontext] */
185 
212 /* @[define_transportrecv] */
213 typedef int32_t ( * TransportRecv_t )( NetworkContext_t * pNetworkContext,
214  void * pBuffer,
215  size_t bytesToRecv );
216 /* @[define_transportrecv] */
217 
234 /* @[define_transportsend] */
235 typedef int32_t ( * TransportSend_t )( NetworkContext_t * pNetworkContext,
236  const void * pBuffer,
237  size_t bytesToSend );
238 /* @[define_transportsend] */
239 
244 /* @[define_transportinterface] */
245 typedef struct TransportInterface
246 {
251 /* @[define_transportinterface] */
252 
253 #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:183
TransportInterface_t::send
TransportSend_t send
Definition: transport_interface.h:248
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:235
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:213
TransportInterface_t::pNetworkContext
NetworkContext_t * pNetworkContext
Definition: transport_interface.h:249
TransportInterface_t::recv
TransportRecv_t recv
Definition: transport_interface.h:247
TransportInterface_t
The transport layer interface.
Definition: transport_interface.h:246