alertik/env_events.h

27 lines
806 B
C
Raw Normal View History

2024-07-16 03:16:27 +02:00
/*
* Alertik: a tiny 'syslog' server & notification tool for Mikrotik routers.
* This is free and unencumbered software released into the public domain.
*/
#ifndef ENV_EVENTS_H
#define ENV_EVENTS_H
2024-07-24 03:25:24 +02:00
#include <regex.h>
2024-07-16 03:16:27 +02:00
#define MAX_ENV_EVENTS 16
struct log_event;
2024-07-16 03:16:27 +02:00
struct env_event {
int ev_match_type; /* whether regex or str. */
int ev_notifier_idx; /* Telegram, Discord... */
const char *ev_match_str; /* regex str or substr here. */
const char *ev_mask_msg; /* Mask message to be sent. */
2024-07-24 03:25:24 +02:00
regex_t regex; /* Compiled regex. */
2024-07-16 03:16:27 +02:00
};
extern struct env_event env_events[MAX_ENV_EVENTS];
extern int init_environment_events(void);
extern int process_environment_event(struct log_event *ev);
2024-07-16 03:16:27 +02:00
#endif /* ENV_EVENTS_H */