My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
ctrl_runtime_messages.h
Go to the documentation of this file.
1 /*
2 START OF LICENSE STUB
3  DeDOS: Declarative Dispersion-Oriented Software
4  Copyright (C) 2017 University of Pennsylvania, Georgetown University
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 END OF LICENSE STUB
19 */
25 #ifndef CTRL_RUNTIME_MESSAGES_H_
26 #define CTRL_RUNTIME_MESSAGES_H_
27 #include "dfg.h"
28 
29 #include <unistd.h>
30 #include <stdbool.h>
31 
37 
38  // These first messages are meant for delivery to the main thread
44  // TODO: CTRL_REPORT: a message type for requesting runtime status
45 
46  // These messages are meant for delivery to worker threads for MSUs
50 };
51 
58  int id;
59  // TODO: implement confirmation based on ID of sent message
60  int thread_id;
62  size_t payload_size;
63 };
64 
65 
67 // Main thread messages
69 
75  unsigned int runtime_id;
77  int port;
78 };
79 
85  int thread_id;
88  // TODO: Change blocking_mode to thread_mode
89 };
90 
96  int thread_id;
97 };
98 
111 };
112 
118  int route_id;
119  int type_id;
120  int msu_id;
122  int key; /*<< Key to associate with a route endpoint.
123  Neccessary for subtypes ::ADD_ENDPOINT, ::MOD_ENDPOINT */
124  unsigned int runtime_id; /*<< Id of runtime on which endpoint is located.
125  Neccessary for subtype ::ADD_ENDPOINT */
126 };
127 
129 // Worker thread messages
131 
137  int msu_id;
138  int type_id;
140  // TODO: Replace init_data with payload of variable size
141 };
142 
147  bool force;
148  int msu_id;
149 };
150 
157 };
158 
166  int route_id;
167  int msu_id;
168 };
169 
170 #endif
payload: ctrl_create_thread_msg
payload: ctrl_msu_route_msg
All messages sent from controller to runtime are prefixed with this header.
Payload for messages of type CTRL_DELETE_MSU.
Adds a route to an MSU.
Payload for messages of type CTRL_DELETE_THREAD.
payload: ctrl_add_runtime_msg
ctrl_runtime_msg_type
The various top-level types of messages which can be sent from the controller to runtimes.
enum ctrl_msu_route_type type
Sub-type of message.
uint32_t ip
ip address of the runtime to connect to.
enum blocking_mode mode
The mode of the thread.
Deletes a route.
Payload for messages of type CTRL_MODIFY_ROUTE.
ctrl_route_msg_type
Sub-types for messages of type CTRL_MODIFY_ROUTE, which have payload ctrl_route_msg.
int route_id
Route to which the message applies.
payload: ctrl_create_msu_msg
size_t payload_size
Payload will be serialized following this struct.
Payload for messages of type CTRL_CREATE_MSU.
int msu_id
MSU to which the route is to be added or removed.
int type_id
Type ID of the MSU to create.
int thread_id
The ID to give to the created thread.
Payload for messages of type CTRL_CONNECT_TO_RUNTIME.
int id
Id for confirmation message (not implemented)
Payload for messages of type CTRL_CREATE_THREAD.
int route_id
ID of route to be added or removed.
blocking_mode
Whether an MSU is blocking or non-blocking.
Definition: dfg.h:161
Data with which an MSU is initialized, and the payload for messages of type CTRL_CREATE_MSU.
Definition: dfg.h:66
int msu_id
ID of the MSU to be deleted.
payload: ctrl_route_msg
Payload for messages of type CTRL_MSU_ROUTES.
Adds an endpoint to a route.
int thread_id
The ID of the thread to be deleted.
ctrl_msu_route_type
Sub-types for payloads of type CTRL_MSU_ROUTES.
int msu_id
ID of the MSU to create.
Removes a route from an MSU.
payload: ctrl_delete_thread_msg
Interfaces for the creation and modification of the data-flow-graph and and general description of th...
int msu_id
ID of MSU to add/delete/modify.
int thread_id
ID of the Thread to which the message is to be delivered.
Deletes an endpoint from a route.
int type_id
MSU Type of the route.
enum ctrl_runtime_msg_type type
Identifies the type of payload that follows.
enum ctrl_route_msg_type type
sub-type of message
Modifies the key corresponding to a route endpoint.
bool force
If true, forces the deletion of an MSU even if it has existing states.
Creates a new route.
unsigned int uint32_t
Definition: uthash.h:96
struct msu_init_data init_data
Initial data to pass to the MSU.
int port
port of the runtime to connect to
payload: ctrl_delete_msu_msg
unsigned int runtime_id
ID of the runtime to connect to.