My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
Functions
msu_calls.h File Reference

Declares the methods available for calling an MSU from another MSU. More...

#include "local_msu.h"
#include "msu_message.h"
#include "routing.h"
#include "logging.h"

Go to the source code of this file.

Functions

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_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 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_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_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_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 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 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)
 

Detailed Description

Declares the methods available for calling an MSU from another MSU.

Note: All functions in this file which receive a key make a COPY of the key, and as such it can have local scope.

Definition in file msu_calls.h.

Function Documentation

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.

Parameters
senderThe MSU sending the message
destThe MSU to receive the message
hdrThe header of the message received by the sender. To be modified with provinance and used in routing decisions
data_sizeSize of the data to be enqueued to the next MSU
dataThe data to be enqueued to the next MSU
Returns
0 on success, -1 on error

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.

Parameters
senderThe MSU sending the message
endpointThe endpoint to which the message is to be delivered
endpoint_typeThe MSU type of the endpoint to receive the message
hdrThe header of the MSU message received by the sender
data_sizeThe size of the sending data
dataThe data sent
Returns
0 on success, -1 on error

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.

Parameters
senderThe MSU sending the message
dst_typeThe MSU type to receive the message
hdrThe header to be used in routing, passed on from the sender's received message
data_sizeSize of the data to be enqueued
dataThe data to be enqueued
Returns
0 on success, -1 on error

Definition at line 146 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

Parameters
senderThe MSU sending the message
destThe MSU to receive the message
keyThe key to assign to the header of the new MSU message
data_sizeSize of the data to be enqueued to the next MSU
datathe data to be enqueued to the next MSU
Returns
0 on success, -1 on error

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.

Parameters
senderThe MSU sending the message
endpointThe endpoint to which the message is to be delivered
endpoint_typeThe MSU type of the endpoint to receive the message
hdrThe header of the MSU message received by the sender
data_sizeThe size of the sending data
dataThe data sent
Returns
0 on success, -1 on error

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.

Parameters
senderThe MSU sending the message
dst_typeThe MSU type to receive the message
keyThe key to assign to the message header
data_sizeThe size of the data to be enqueued
dataThe data to be enqueued
Returns
0 on success, -1 on error

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.

Parameters
senderThe MSU sending the message
destThe MSU to which the message should be delivered
intervalThe amount of time later at which the MSU should be called
hdrThe header of the MSU messge received by the sender
data_sizeThe size of the sending data
datathe data sent
Returns
0 on success, -1 on error

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.

Parameters
senderThe MSU sending the message
destThe MSU to which the message should be delivered
intervalThe amount of time later at which the MSU should be called
hdrThe header of the MSU messge received by the sender
data_sizeThe size of the sending data
datathe data sent
Returns
0 on success, -1 on error

Definition at line 121 of file msu_calls.c.