Multi-ApplicationOnlineProfiling  2.1
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
nsc.c File Reference
#include "nsc.h"
#include <string.h>
#include <errno.h>
#include <unistd.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <openssl/sha.h>
#include <signal.h>
#include "CRC64.h"
Include dependency graph for nsc.c:

Go to the source code of this file.

Data Structures

struct  nscRoutingThreadCtx
 

Functions

char * Context_host_from_env ()
 
char * Context_passwd_from_env ()
 
int Context_init_data (struct Context *ctx, char *phost_port, char *password)
 
int Context_init (struct Context *ctx)
 
void Context_release (struct Context *ctx)
 
static int _nodeSharedCache_send (int socket, char *key, uint32_t len_key, char *json, uint32_t len_json, uint32_t action)
 
static int _nodeSharedCache_send_up (struct nodeSharedCache *nsc, char *key, uint32_t len_key, char *json, uint32_t len_json, uint32_t action)
 
int nodeSharedCache_send_up (struct nodeSharedCache *nsc, char *key, char *json, uint32_t action)
 
static int _nodeSharedCache_send_down (struct nodeSharedCache *nsc, char *key, uint32_t len_key, char *json, uint32_t len_json, uint32_t action)
 
int nodeSharedCache_send_down (struct nodeSharedCache *nsc, char *key, char *json, uint32_t action)
 
void socket_flag_timeouts (int socket, int *socket_flagged_read, int *socket_flagged_write)
 
int nodeSharedCache_incoming_set (struct nodeSharedCache *nsc, char *key_buff, char *read_buff, uint32_t data_len)
 
int safe_write (int fd, void *src, size_t size)
 
static int nodeSharedCacheRead_Header (int socket, uint32_t *action, uint32_t *key_len, uint32_t *data_len)
 
static int nodeSharedCacheRead_Key (int socket, char *key_buff, uint32_t key_len)
 
static int nodeSharedCacheRead_Payload (int socket, char *read_buff, uint32_t data_len, uint32_t max_buffer_size)
 
void * nodeSharedCache_read_loop (void *pnsc)
 
uint64_t nodeSharedCache_compute_auth_digest (char *passwd, char *challenge)
 
int nodeSharedCache_do_auth (struct nodeSharedCache *nsc)
 
int _nodeSharedCache_init (struct nodeSharedCache *nsc)
 
int nodeSharedCache_init (struct nodeSharedCache *nsc)
 
int nodeSharedCache_proxy_greetings (int socket)
 
int nodeSharedCache_proxy_auth (struct nodeSharedCache *nsc, int socket)
 
int nodeSharedCache_proxy_send_config (struct nodeSharedCache *nsc, int socket)
 
void * nodeSharedCache_proxy_routing_thread (void *arg)
 
int nodeSharedCache_proxy_accept_clients (struct nodeSharedCache *nsc)
 
int nodeSharedCache_proxy_init (struct nodeSharedCache *nsc, char *destination_server, int expected_clients)
 
void nodeSharedCache_wait (struct nodeSharedCache *nsc)
 
void nodeSharedCache_release (struct nodeSharedCache *nsc)
 
void nodeSharedCache_set_handler (char *key, json_t *elem, void *ctx)
 
void nodeSharedCache_delete_handler (char *key, void *ctx)
 
void nodeSharedCache_set_json (struct nodeSharedCache *nsc, char *key, char *json)
 
void nodeSharedCache_set (struct nodeSharedCache *nsc, char *key, json_t *json)
 
void nodeSharedCache_reduce_json (struct nodeSharedCache *nsc, char *key, char *json)
 
void nodeSharedCache_reduce (struct nodeSharedCache *nsc, char *key, json_t *elem)
 
json_tnodeSharedCache_get (struct nodeSharedCache *nsc, char *key)
 
char * nodeSharedCache_get_json (struct nodeSharedCache *nsc, char *key)
 
void nodeSharedCache_delete (struct nodeSharedCache *nsc, char *key)
 
void nodeSharedCache_commit (struct nodeSharedCache *nsc, char *key)
 

Function Documentation

int _nodeSharedCache_init ( struct nodeSharedCache nsc)

Definition at line 525 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int _nodeSharedCache_send ( int  socket,
char *  key,
uint32_t  len_key,
char *  json,
uint32_t  len_json,
uint32_t  action 
)
inlinestatic

Definition at line 207 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int _nodeSharedCache_send_down ( struct nodeSharedCache nsc,
char *  key,
uint32_t  len_key,
char *  json,
uint32_t  len_json,
uint32_t  action 
)
inlinestatic

Definition at line 268 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int _nodeSharedCache_send_up ( struct nodeSharedCache nsc,
char *  key,
uint32_t  len_key,
char *  json,
uint32_t  len_json,
uint32_t  action 
)
inlinestatic

Definition at line 236 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

char* Context_host_from_env ( )

Definition at line 15 of file nsc.c.

Here is the caller graph for this function:

int Context_init ( struct Context ctx)

Definition at line 92 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int Context_init_data ( struct Context ctx,
char *  phost_port,
char *  password 
)

Definition at line 40 of file nsc.c.

Here is the caller graph for this function:

char* Context_passwd_from_env ( )

Definition at line 27 of file nsc.c.

Here is the caller graph for this function:

void Context_release ( struct Context ctx)

Definition at line 97 of file nsc.c.

Here is the caller graph for this function:

void nodeSharedCache_commit ( struct nodeSharedCache nsc,
char *  key 
)

Definition at line 1235 of file nsc.c.

Here is the call graph for this function:

uint64_t nodeSharedCache_compute_auth_digest ( char *  passwd,
char *  challenge 
)

Definition at line 475 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void nodeSharedCache_delete ( struct nodeSharedCache nsc,
char *  key 
)

Definition at line 1230 of file nsc.c.

Here is the call graph for this function:

void nodeSharedCache_delete_handler ( char *  key,
void *  ctx 
)

Definition at line 1159 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int nodeSharedCache_do_auth ( struct nodeSharedCache nsc)

Definition at line 495 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

json_t* nodeSharedCache_get ( struct nodeSharedCache nsc,
char *  key 
)

Definition at line 1208 of file nsc.c.

Here is the call graph for this function:

char* nodeSharedCache_get_json ( struct nodeSharedCache nsc,
char *  key 
)

Definition at line 1215 of file nsc.c.

Here is the call graph for this function:

int nodeSharedCache_incoming_set ( struct nodeSharedCache nsc,
char *  key_buff,
char *  read_buff,
uint32_t  data_len 
)

Definition at line 148 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int nodeSharedCache_init ( struct nodeSharedCache nsc)

Definition at line 657 of file nsc.c.

Here is the call graph for this function:

int nodeSharedCache_proxy_accept_clients ( struct nodeSharedCache nsc)

Definition at line 860 of file nsc.c.

Here is the call graph for this function:

int nodeSharedCache_proxy_auth ( struct nodeSharedCache nsc,
int  socket 
)

Definition at line 706 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int nodeSharedCache_proxy_greetings ( int  socket)

Definition at line 677 of file nsc.c.

Here is the caller graph for this function:

int nodeSharedCache_proxy_init ( struct nodeSharedCache nsc,
char *  destination_server,
int  expected_clients 
)

Definition at line 962 of file nsc.c.

Here is the call graph for this function:

void* nodeSharedCache_proxy_routing_thread ( void *  arg)

Definition at line 771 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

int nodeSharedCache_proxy_send_config ( struct nodeSharedCache nsc,
int  socket 
)

Definition at line 749 of file nsc.c.

Here is the caller graph for this function:

void* nodeSharedCache_read_loop ( void *  pnsc)

Definition at line 387 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void nodeSharedCache_reduce ( struct nodeSharedCache nsc,
char *  key,
json_t elem 
)

Definition at line 1189 of file nsc.c.

Here is the call graph for this function:

void nodeSharedCache_reduce_json ( struct nodeSharedCache nsc,
char *  key,
char *  json 
)

Definition at line 1181 of file nsc.c.

Here is the call graph for this function:

void nodeSharedCache_release ( struct nodeSharedCache nsc)

Definition at line 1123 of file nsc.c.

Here is the call graph for this function:

int nodeSharedCache_send_down ( struct nodeSharedCache nsc,
char *  key,
char *  json,
uint32_t  action 
)

Definition at line 293 of file nsc.c.

Here is the call graph for this function:

int nodeSharedCache_send_up ( struct nodeSharedCache nsc,
char *  key,
char *  json,
uint32_t  action 
)

Definition at line 256 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void nodeSharedCache_set ( struct nodeSharedCache nsc,
char *  key,
json_t json 
)

Definition at line 1175 of file nsc.c.

Here is the call graph for this function:

void nodeSharedCache_set_handler ( char *  key,
json_t elem,
void *  ctx 
)

Definition at line 1143 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

void nodeSharedCache_set_json ( struct nodeSharedCache nsc,
char *  key,
char *  json 
)

Definition at line 1167 of file nsc.c.

Here is the call graph for this function:

void nodeSharedCache_wait ( struct nodeSharedCache nsc)

Definition at line 1096 of file nsc.c.

Here is the call graph for this function:

Here is the caller graph for this function:

static int nodeSharedCacheRead_Header ( int  socket,
uint32_t *  action,
uint32_t *  key_len,
uint32_t *  data_len 
)
inlinestatic

Definition at line 306 of file nsc.c.

Here is the caller graph for this function:

static int nodeSharedCacheRead_Key ( int  socket,
char *  key_buff,
uint32_t  key_len 
)
inlinestatic

Definition at line 336 of file nsc.c.

Here is the caller graph for this function:

static int nodeSharedCacheRead_Payload ( int  socket,
char *  read_buff,
uint32_t  data_len,
uint32_t  max_buffer_size 
)
inlinestatic

Definition at line 357 of file nsc.c.

Here is the caller graph for this function:

int safe_write ( int  fd,
void *  src,
size_t  size 
)

Definition at line 163 of file nsc.c.

Here is the caller graph for this function:

void socket_flag_timeouts ( int  socket,
int *  socket_flagged_read,
int *  socket_flagged_write 
)

Definition at line 125 of file nsc.c.