Skip to content

Commit 4a9a7a4

Browse files
sarenameasSarena Meas
authored andcommitted
Restructure Directories and Add required Submodules (FreeRTOS#2)
Submodules: cbmc/aws-templates-for-cbmc-proofs test/CMock source/third_party/http-parser Directories: |- cbmc |- docs |- source | |-portable | |-include | |-third_party (http-parser) | |-source_file1.c | |-source_file2.c | |-source_file3.c | |- tools (if any) |- test
1 parent f78922f commit 4a9a7a4

File tree

13 files changed

+83
-0
lines changed

13 files changed

+83
-0
lines changed

.gitmodules

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
[submodule "cbmc/aws-templates-for-cbmc-proofs"]
2+
path = cbmc/aws-templates-for-cbmc-proofs
3+
url = https://github.com/awslabs/aws-templates-for-cbmc-proofs.git
4+
[submodule "test/CMock"]
5+
path = test/CMock
6+
url = https://github.com/ThrowTheSwitch/CMock.git
7+
[submodule "source/third_party/http_parser"]
8+
path = source/third_party/http_parser
9+
url = https://github.com/nodejs/http-parser.git
File renamed without changes.
File renamed without changes.

source/portable/transport_interface.h

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
/*
2+
* Copyright (C) 2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
3+
*
4+
* Permission is hereby granted, free of charge, to any person obtaining a copy of
5+
* this software and associated documentation files (the "Software"), to deal in
6+
* the Software without restriction, including without limitation the rights to
7+
* use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
8+
* the Software, and to permit persons to whom the Software is furnished to do so,
9+
* subject to the following conditions:
10+
*
11+
* The above copyright notice and this permission notice shall be included in all
12+
* copies or substantial portions of the Software.
13+
*
14+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
16+
* FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
17+
* COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
18+
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
19+
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
20+
*/
21+
22+
#ifndef TRANSPORT_INTERFACE_H_
23+
#define TRANSPORT_INTERFACE_H_
24+
25+
#include <stdint.h>
26+
#include <stddef.h>
27+
28+
/**
29+
* @brief The NetworkContext is an incomplete type. An implementation of this
30+
* interface must define NetworkContext as per the requirements. This context
31+
* is passed into the network interface functions.
32+
*/
33+
struct NetworkContext;
34+
typedef struct NetworkContext NetworkContext_t;
35+
36+
/**
37+
* @brief Transport interface for receiving data on the network.
38+
*
39+
* @param[in] pNetworkContext Implementation-defined network context.
40+
* @param[in] pBuffer Buffer to receive the data into.
41+
* @param[in] bytesToRecv Number of bytes requested from the network.
42+
*
43+
* @return The number of bytes received or a negative error code.
44+
*/
45+
typedef int32_t ( * TransportRecv_t )( const NetworkContext_t * pNetworkContext,
46+
void * pBuffer,
47+
size_t bytesToRecv );
48+
49+
/**
50+
* @brief Transport interface for sending data over the network.
51+
*
52+
* @param[in] pNetworkContext Implementation-defined network context.
53+
* @param[in] pBuffer Buffer containing the bytes to send over the network stack.
54+
* @param[in] bytesToSend Number of bytes to send over the network.
55+
*
56+
* @return The number of bytes sent or a negative error code.
57+
*/
58+
typedef int32_t ( * TransportSend_t )( const NetworkContext_t * pNetworkContext,
59+
const void * pBuffer,
60+
size_t bytesToSend );
61+
62+
/**
63+
* @brief The transport layer interface.
64+
*/
65+
typedef struct TransportInterface
66+
{
67+
TransportRecv_t recv; /**< Transport receive interface. */
68+
TransportSend_t send; /**< Transport send interface. */
69+
NetworkContext_t * pNetworkContext; /**< Implementation-defined network context. */
70+
} TransportInterface_t;
71+
72+
#endif /* ifndef TRANSPORT_INTERFACE_H_ */
File renamed without changes.
File renamed without changes.

test/CMock

Submodule CMock added at 150573c

0 commit comments

Comments
 (0)