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

Interactions with global dfg from individual runtime. More...

#include <netinet/ip.h>
#include "dfg.h"

Go to the source code of this file.

Functions

void set_local_runtime (struct dfg_runtime *rt)
 Sets the local runtime to be equal to the provided rt. More...
 
int init_runtime_dfg (char *filename, int runtime_id)
 Initializes the DFG as loaded from a JSON file, and sets the global variables such that the DFG and runtime can be accessed. More...
 
int controller_address (struct sockaddr_in *addr)
 Gets the sockaddr associated with the global controller. More...
 
int local_runtime_id ()
 
int local_runtime_port ()
 
uint32_t local_runtime_ip ()
 
struct dedos_dfgget_dfg ()
 
void free_runtime_dfg ()
 Frees the runtime's static instance of the DFG. More...
 

Detailed Description

Interactions with global dfg from individual runtime.

Definition in file runtime_dfg.h.

Function Documentation

int controller_address ( struct sockaddr_in *  addr)

Gets the sockaddr associated with the global controller.

Parameters
addrOutput parameter to be filled with controller's ip and port
Returns
0 on success, -1 on error

Definition at line 77 of file runtime_dfg.c.

void free_runtime_dfg ( )

Frees the runtime's static instance of the DFG.

Definition at line 119 of file runtime_dfg.c.

struct dedos_dfg* get_dfg ( )
Returns
the DFG with which this runtime was instantiated

Definition at line 115 of file runtime_dfg.c.

int init_runtime_dfg ( char *  filename,
int  runtime_id 
)

Initializes the DFG as loaded from a JSON file, and sets the global variables such that the DFG and runtime can be accessed.

Parameters
filenameFile from which to load the json DFG
runtime_idIdenitifer for this runtime
Returns
0 on success, -1 on error

Definition at line 41 of file runtime_dfg.c.

int local_runtime_id ( )
Returns
the ID of the local runtime

Definition at line 91 of file runtime_dfg.c.

uint32_t local_runtime_ip ( )

Definition at line 107 of file runtime_dfg.c.

int local_runtime_port ( )
Returns
the port on which the local runtime is listening

Definition at line 99 of file runtime_dfg.c.

void set_local_runtime ( struct dfg_runtime rt)

Sets the local runtime to be equal to the provided rt.

Really should only be used from testing. Use init_runtime_dfg instead

Definition at line 37 of file runtime_dfg.c.