-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
server rework and full tcp communication
- Loading branch information
Showing
32 changed files
with
916 additions
and
309 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,28 @@ | ||
#pragma once | ||
#include "agent.h" | ||
#include <stdbool.h> | ||
#include <stdint.h> | ||
|
||
#include "agent.h" | ||
|
||
typedef enum { | ||
CMD_SUCCESS = 0, | ||
CMD_REGISTER = 1, | ||
CMD_KILL = 2, | ||
CMD_RUN = 3, | ||
CMD_FAILURE = 0, | ||
CMD_SUCCESS = 1, | ||
CMD_REGISTER = 2, | ||
CMD_KILL = 3, | ||
CMD_RUN = 4, | ||
CMD_ASK = 5, | ||
CMD_INFO = 6, | ||
CMD_NONE = 7, | ||
CMD_AUTH = 8, | ||
} cmd_t; | ||
|
||
bool cmd_handle(agent_t *agent); | ||
bool cmd_register(agent_t *agent); | ||
bool cmd_send(agent_t *agent, cmd_t cmd); | ||
bool cmd_handle(agent_t *agent); | ||
|
||
// command helpers | ||
bool cmd_success(agent_t *agent, char *data, uint8_t data_size); | ||
bool cmd_failure(agent_t *agent, char *data, uint8_t data_size); | ||
|
||
// command handlers | ||
bool cmd_info_handler(agent_t *agent, packet_t *packet); | ||
bool cmd_run_handler(agent_t *agent, packet_t *packet); |
Oops, something went wrong.