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

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

#include <stdbool.h>
#include <inttypes.h>
#include <sys/un.h>
#include "supervisor_config.h"
#include "../utils/sockctl.h"
Include dependency graph for subscriber_events.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Macros

#define EVENT_IP_TEXT   "IP"
 
#define EVENT_AP_TEXT   "AP"
 

Enumerations

enum  SUBSCRIBER_EVENT { SUBSCRIBER_EVENT_NONE = 0 , SUBSCRIBER_EVENT_IP , SUBSCRIBER_EVENT_AP }
 

Functions

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_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 definition of the subscriber events structure.

Author
Alexandru Mereacre
Date
2021

Macro Definition Documentation

◆ EVENT_AP_TEXT

#define EVENT_AP_TEXT   "AP"

◆ EVENT_IP_TEXT

#define EVENT_IP_TEXT   "IP"

Enumeration Type Documentation

◆ SUBSCRIBER_EVENT

Enumerator
SUBSCRIBER_EVENT_NONE 
SUBSCRIBER_EVENT_IP 
SUBSCRIBER_EVENT_AP 

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

◆ 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