EDGESEC  0.1.0-alpha.0+sha.ca29a8277b72f80785649ea9ef9cd7edf642d939
Secure router - reference implementation
Macros | Functions
subscriber_events.c File Reference

File containing the implementation of the subscriber events structure. More...

#include <stdbool.h>
#include <inttypes.h>
#include <sys/un.h>
#include <utarray.h>
#include "subscriber_events.h"
#include "supervisor_config.h"
#include "../utils/log.h"
#include "../utils/sockctl.h"
Include dependency graph for subscriber_events.c:

Macros

#define MAX_SEND_EVENTS_BUF_SIZE   4096
 

Functions

int compare_client_addresses (const struct client_address *a, const struct client_address *b)
 
int sort_subscribers_array (const void *a, const void *b)
 
int add_events_subscriber (struct supervisor_context *context, const struct client_address *addr)
 Add a subscriber to the subscriber events array. More...
 
int send_events (struct supervisor_context *context, const char *name, const char *format, va_list args)
 
int send_events_subscriber (struct supervisor_context *context, enum SUBSCRIBER_EVENT type, const char *format,...)
 Send an event to the subscribers array. More...
 

Detailed Description

File containing the implementation of the subscriber events structure.

Author
Alexandru Mereacre
Date
2021

Macro Definition Documentation

◆ MAX_SEND_EVENTS_BUF_SIZE

#define MAX_SEND_EVENTS_BUF_SIZE   4096

Function Documentation

◆ add_events_subscriber()

int add_events_subscriber ( struct supervisor_context context,
const struct client_address addr 
)

Add a subscriber to the subscriber events array.

Parameters
contextThe supervisor context
addrThe subscriber address
Returns
0 on success, -1 on failure

◆ compare_client_addresses()

int compare_client_addresses ( const struct client_address a,
const struct client_address b 
)

◆ send_events()

int send_events ( struct supervisor_context context,
const char *  name,
const char *  format,
va_list  args 
)

◆ send_events_subscriber()

int send_events_subscriber ( struct supervisor_context context,
enum SUBSCRIBER_EVENT  type,
const char *  format,
  ... 
)

Send an event to the subscribers array.

Parameters
contextThe supervisor context
typeThe event type
formatThe event format text, passed to vsnprintf()
...The event format variables, passed to vsnprintf()
Returns
0 on success, -1 on failure

◆ sort_subscribers_array()

int sort_subscribers_array ( const void *  a,
const void *  b 
)