Defines methods used for calling MSUs from other MSUs. More...
#include "msu_calls.h"
#include "logging.h"
#include "thread_message.h"
#include "output_thread.h"
#include "routing_strategies.h"
#include "profiler.h"
Go to the source code of this file.
Functions | |
static int | enqueue_for_remote_send (struct msu_msg *msg, struct msu_type *dst_type, struct msu_endpoint *dst) |
Calls type-specific MSU serialization function and enqueues data into main thread queue so it can be forwarded to remote MSU. More... | |
int | call_local_msu (struct local_msu *sender, struct local_msu *dest, struct msu_msg_hdr *hdr, size_t data_size, void *data) |
Enqueues a message in the queue of a local MSU. More... | |
int | schedule_local_msu_call (struct local_msu *sender, struct local_msu *dest, struct timespec *interval, struct msu_msg_hdr *hdr, size_t data_size, void *data) |
Schedules a call to a local MSU to occur at some point in the future. More... | |
int | schedule_local_msu_init_call (struct local_msu *sender, struct local_msu *dest, struct timespec *interval, struct msu_msg_key *key, size_t data_size, void *data) |
Schedules a call to a local MSU to occur at some point in the future. More... | |
int | init_call_local_msu (struct local_msu *sender, struct local_msu *dest, struct msu_msg_key *key, size_t data_size, void *data) |
Enqueues a new message in the queue of a local MSU. More... | |
int | call_msu_type (struct local_msu *sender, struct msu_type *dst_type, struct msu_msg_hdr *hdr, size_t data_size, void *data) |
Sends an MSU message to a destination of the given type, utilizing the sending MSU's routing function. More... | |
int | init_call_msu_type (struct local_msu *sender, struct msu_type *dst_type, struct msu_msg_key *key, size_t data_size, void *data) |
Sends an MSU message to a destination of the specified type. More... | |
int | call_msu_endpoint (struct local_msu *sender, struct msu_endpoint *endpoint, struct msu_type *endpoint_type, struct msu_msg_hdr *hdr, size_t data_size, void *data) |
Sends an MSU message to a speicific destination, either local or remote. More... | |
int | init_call_msu_endpoint (struct local_msu *sender, struct msu_endpoint *endpoint, struct msu_type *endpoint_type, struct msu_msg_key *key, size_t data_size, void *data) |
Sends an MSU message to a specific destination, either local or remote. More... | |
int | call_msu_error (struct local_msu *sender, struct msu_endpoint *endpoint, struct msu_type *endpoint_type, struct msu_msg_hdr *hdr, size_t data_size, void *data) |
Defines methods used for calling MSUs from other MSUs.
Definition in file msu_calls.c.
int call_local_msu | ( | struct local_msu * | sender, |
struct local_msu * | dest, | ||
struct msu_msg_hdr * | hdr, | ||
size_t | data_size, | ||
void * | data | ||
) |
Enqueues a message in the queue of a local MSU.
sender | The MSU sending the message |
dest | The MSU to receive the message |
hdr | The header of the message received by the sender. To be modified with provinance and used in routing decisions |
data_size | Size of the data to be enqueued to the next MSU |
data | The data to be enqueued to the next MSU |
Definition at line 77 of file msu_calls.c.
int call_msu_endpoint | ( | struct local_msu * | sender, |
struct msu_endpoint * | endpoint, | ||
struct msu_type * | endpoint_type, | ||
struct msu_msg_hdr * | hdr, | ||
size_t | data_size, | ||
void * | data | ||
) |
Sends an MSU message to a speicific destination, either local or remote.
sender | The MSU sending the message |
endpoint | The endpoint to which the message is to be delivered |
endpoint_type | The MSU type of the endpoint to receive the message |
hdr | The header of the MSU message received by the sender |
data_size | The size of the sending data |
data | The data sent |
Definition at line 217 of file msu_calls.c.
int call_msu_error | ( | struct local_msu * | sender, |
struct msu_endpoint * | endpoint, | ||
struct msu_type * | endpoint_type, | ||
struct msu_msg_hdr * | hdr, | ||
size_t | data_size, | ||
void * | data | ||
) |
Definition at line 271 of file msu_calls.c.
int call_msu_type | ( | struct local_msu * | sender, |
struct msu_type * | dst_type, | ||
struct msu_msg_hdr * | hdr, | ||
size_t | data_size, | ||
void * | data | ||
) |
Sends an MSU message to a destination of the given type, utilizing the sending MSU's routing function.
sender | The MSU sending the message |
dst_type | The MSU type to receive the message |
hdr | The header to be used in routing, passed on from the sender's received message |
data_size | Size of the data to be enqueued |
data | The data to be enqueued |
Definition at line 146 of file msu_calls.c.
|
static |
Calls type-specific MSU serialization function and enqueues data into main thread queue so it can be forwarded to remote MSU.
msg | Message to be enqueued to the remote MSU |
dst_type | MSU type of the destination |
dst | The specific MSU destination |
Definition at line 40 of file msu_calls.c.
int init_call_local_msu | ( | struct local_msu * | sender, |
struct local_msu * | dest, | ||
struct msu_msg_key * | key, | ||
size_t | data_size, | ||
void * | data | ||
) |
Enqueues a new message in the queue of a local MSU.
This function is identical to call_local_msu()
with the exception that it creates the required header from the specified message key. It is to be used for initial enqueueing rather than existing message passsing
sender | The MSU sending the message |
dest | The MSU to receive the message |
key | The key to assign to the header of the new MSU message |
data_size | Size of the data to be enqueued to the next MSU |
data | the data to be enqueued to the next MSU |
Definition at line 134 of file msu_calls.c.
int init_call_msu_endpoint | ( | struct local_msu * | sender, |
struct msu_endpoint * | endpoint, | ||
struct msu_type * | endpoint_type, | ||
struct msu_msg_key * | key, | ||
size_t | data_size, | ||
void * | data | ||
) |
Sends an MSU message to a specific destination, either local or remote.
This function is identical to call_msu_endpoint with the exception that it constructs the header for the message and is to be used for initial enqueues.
sender | The MSU sending the message |
endpoint | The endpoint to which the message is to be delivered |
endpoint_type | The MSU type of the endpoint to receive the message |
hdr | The header of the MSU message received by the sender |
data_size | The size of the sending data |
data | The data sent |
Definition at line 258 of file msu_calls.c.
int init_call_msu_type | ( | struct local_msu * | sender, |
struct msu_type * | dst_type, | ||
struct msu_msg_key * | key, | ||
size_t | data_size, | ||
void * | data | ||
) |
Sends an MSU message to a destination of the specified type.
This function is identical to call_msu_type with the exception that it performs header initialization. To be used when performing an initial enqueue, rather than continuing a chain of enqueues.
sender | The MSU sending the message |
dst_type | The MSU type to receive the message |
key | The key to assign to the message header |
data_size | The size of the data to be enqueued |
data | The data to be enqueued |
Definition at line 205 of file msu_calls.c.
int schedule_local_msu_call | ( | struct local_msu * | sender, |
struct local_msu * | dest, | ||
struct timespec * | interval, | ||
struct msu_msg_hdr * | hdr, | ||
size_t | data_size, | ||
void * | data | ||
) |
Schedules a call to a local MSU to occur at some point in the future.
sender | The MSU sending the message |
dest | The MSU to which the message should be delivered |
interval | The amount of time later at which the MSU should be called |
hdr | The header of the MSU messge received by the sender |
data_size | The size of the sending data |
data | the data sent |
Definition at line 97 of file msu_calls.c.
int schedule_local_msu_init_call | ( | struct local_msu * | sender, |
struct local_msu * | dest, | ||
struct timespec * | interval, | ||
struct msu_msg_key * | key, | ||
size_t | data_size, | ||
void * | data | ||
) |
Schedules a call to a local MSU to occur at some point in the future.
Note: This function is identical to schedule_local_msu_call, but is meant for times when the message flow is just beginning, and is to be used for initial enqueues.
sender | The MSU sending the message |
dest | The MSU to which the message should be delivered |
interval | The amount of time later at which the MSU should be called |
hdr | The header of the MSU messge received by the sender |
data_size | The size of the sending data |
data | the data sent |
Definition at line 121 of file msu_calls.c.