2022-01-24 03:28:16 +00:00
|
|
|
#ifndef LAIKA_CNC_H
|
|
|
|
#define LAIKA_CNC_H
|
|
|
|
|
|
|
|
#include "laika.h"
|
2022-01-24 15:51:29 +00:00
|
|
|
#include "lpacket.h"
|
2022-01-24 03:28:16 +00:00
|
|
|
#include "lsocket.h"
|
|
|
|
#include "lpolllist.h"
|
2022-01-24 16:34:30 +00:00
|
|
|
#include "lpeer.h"
|
2022-01-24 03:28:16 +00:00
|
|
|
|
2022-01-24 16:34:30 +00:00
|
|
|
struct sLaika_cnc {
|
2022-02-03 22:25:49 +00:00
|
|
|
uint8_t priv[crypto_kx_SECRETKEYBYTES], pub[crypto_kx_PUBLICKEYBYTES];
|
2022-01-24 03:28:16 +00:00
|
|
|
struct sLaika_socket sock;
|
2022-01-24 16:34:30 +00:00
|
|
|
struct sLaika_pollList pList;
|
2022-02-13 00:21:59 +00:00
|
|
|
struct sLaika_peer **panels; /* holds connected panel peers */
|
|
|
|
int panelCount;
|
|
|
|
int panelCap;
|
2022-01-24 16:34:30 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sLaika_cnc *laikaC_newCNC(uint16_t port);
|
|
|
|
void laikaC_freeCNC(struct sLaika_cnc *cnc);
|
|
|
|
|
2022-02-13 00:21:59 +00:00
|
|
|
void laikaC_onAddPeer(struct sLaika_cnc *cnc, struct sLaika_peer *peer);
|
|
|
|
void laikaC_onRmvPeer(struct sLaika_cnc *cnc, struct sLaika_peer *peer);
|
|
|
|
|
|
|
|
void laikaC_addPanel(struct sLaika_cnc *cnc, struct sLaika_peer *panel);
|
|
|
|
void laikaC_rmvPanel(struct sLaika_cnc *cnc, struct sLaika_peer *panel);
|
|
|
|
|
2022-01-24 16:34:30 +00:00
|
|
|
void laikaC_killPeer(struct sLaika_cnc *cnc, struct sLaika_peer *peer);
|
|
|
|
bool laikaC_pollPeers(struct sLaika_cnc *cnc, int timeout);
|
2022-01-24 03:28:16 +00:00
|
|
|
|
|
|
|
#endif
|