Communication with global controller from runtime. More...
#include "netinet/ip.h"
#include "ctrl_runtime_messages.h"
#include "rt_controller_messages.h"
#include <stdbool.h>
Go to the source code of this file.
Functions | |
int | send_to_controller (struct rt_controller_msg_hdr *msg, void *payload) |
Sends a message to the global controller. More... | |
int | init_controller_socket (struct sockaddr_in *addr) |
Initilizes a connection with the global controller located at the provided address. More... | |
int | handle_controller_communication (int fd) |
Reads and processes a controller message off of the provided file descriptor. More... | |
int | send_ack_message (int ack_id, bool success) |
WILL Send an acknoweledgement of success for a specific message. More... | |
bool | is_controller_fd (int fd) |
Checks if fd is file descriptor for controller. More... | |
int | send_stats_to_controller () |
Samples the relevant statistics and sends them to the controller. More... | |
Communication with global controller from runtime.
Definition in file controller_communication.h.
int handle_controller_communication | ( | int | fd | ) |
Reads and processes a controller message off of the provided file descriptor.
Controller message should start with ctrl_runtime_msg_hdr. fd File descriptor off of which to read the message
Definition at line 419 of file controller_communication.c.
int init_controller_socket | ( | struct sockaddr_in * | addr | ) |
Initilizes a connection with the global controller located at the provided address.
Definition at line 448 of file controller_communication.c.
bool is_controller_fd | ( | int | fd | ) |
Checks if fd
is file descriptor for controller.
Definition at line 443 of file controller_communication.c.
int send_ack_message | ( | int | ack_id, |
bool | success | ||
) |
WILL Send an acknoweledgement of success for a specific message.
Not yet used
Definition at line 380 of file controller_communication.c.
int send_stats_to_controller | ( | ) |
Samples the relevant statistics and sends them to the controller.
Definition at line 462 of file controller_communication.c.
int send_to_controller | ( | struct rt_controller_msg_hdr * | msg, |
void * | payload | ||
) |
Sends a message to the global controller.
msg | Message to send. Must define payload_len. |
Definition at line 47 of file controller_communication.c.