-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.camkes
117 lines (92 loc) · 3.27 KB
/
main.camkes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
/*
* Demo TLS API
*
* Copyright (C) 2020-2024, HENSOLDT Cyber GmbH
*
* SPDX-License-Identifier: GPL-2.0-or-later
*
* For commercial licensing, contact: [email protected]
*/
import <std_connector.camkes>;
import <if_OS_Entropy.camkes>;
#include "config/SystemConfig.h"
#include "config/DemoConfig.h"
#include "EntropySource/camkes/EntropySource.camkes"
EntropySource_COMPONENT_DEFINE(EntropySource)
#include "TimeServer/camkes/TimeServer.camkes"
TimeServer_COMPONENT_DEFINE(TimeServer)
#include "TlsServer/camkes/TlsServer.camkes"
TlsServer_COMPONENT_DEFINE(TlsServer)
#include "NetworkStack_PicoTcp/camkes/NetworkStack_PicoTcp.camkes"
NetworkStack_PicoTcp_COMPONENT_DEFINE(
NetworkStack_PicoTcp,
NIC_DRIVER_RINGBUFFER_SIZE,
NetworkStack_PicoTcp_NO_ADDITIONAL_INTERFACES
)
#include "components/DemoApp/DemoApp.camkes"
#include "plat_nic.camkes"
assembly {
composition {
//----------------------------------------------------------------------
// Components used in application
//----------------------------------------------------------------------
component TimeServer timeServer;
TLS_API_DEMO_NIC_INSTANCE(nwDriver)
component EntropySource entropySource_demo;
component EntropySource entropySource_tlsServer;
component NetworkStack_PicoTcp nwStack;
component TlsServer tlsServer;
component DemoApp demoApp;
//----------------------------------------------------------------------
// Establish Connections
//----------------------------------------------------------------------
TimeServer_INSTANCE_CONNECT_CLIENTS(
timeServer,
// platform specific components, macro will add a comma(s) if any
TLS_API_DEMO_NIC_CONNECTION_TIMESERVER(nwDriver)
nwStack.timeServer_rpc, nwStack.timeServer_notify)
EntropySource_INSTANCE_CONNECT_CLIENT(
entropySource_demo,
demoApp.entropy_rpc, demoApp.entropy_port
)
EntropySource_INSTANCE_CONNECT_CLIENT(
entropySource_tlsServer,
tlsServer.entropy_rpc , tlsServer.entropy_port
)
NetworkStack_PicoTcp_INSTANCE_CONNECT(
nwStack,
nwDriver
)
NetworkStack_PicoTcp_INSTANCE_CONNECT_CLIENTS(
nwStack,
demoApp, networkStack,
tlsServer, networkStack
)
TlsServer_INSTANCE_CONNECT_CLIENTS(
tlsServer,
demoApp, tls
)
}
configuration {
TimeServer_CLIENT_ASSIGN_BADGES(
// platform specific components, macro will add a comma(s) if any
TLS_API_DEMO_NIC_TIMESERVER_CLIENTS(nwDriver)
nwStack.timeServer_rpc
)
TlsServer_CLIENT_ASSIGN_BADGES(
demoApp, tls
)
TlsServer_INSTANCE_CONFIGURE(
tlsServer, TLS_HOST_CERT)
TLS_API_DEMO_NIC_CONFIG(nwDriver)
NetworkStack_PicoTcp_CLIENT_ASSIGN_BADGES(
demoApp, networkStack,
tlsServer, networkStack
)
NetworkStack_PicoTcp_INSTANCE_CONFIGURE_CLIENTS(
nwStack,
4,
4
)
}
}