1
0
mirror of https://github.com/CPunch/Laika.git synced 2025-11-12 07:50:05 +00:00

Shell: minor refactoring, cnc supports mutiple shells per auth clients

- while cnc supports multiple shells per auth client, the LaikaShell still only supports 1 concurrent shell at a time.
	this feature is just preparing boilerplate for future features. shell treats all SHELL_* packets for the same shell, regardless of shellID
This commit is contained in:
2022-05-20 14:10:53 -05:00
parent e3f6b76e35
commit 0fdca35f87
8 changed files with 173 additions and 137 deletions

View File

@@ -58,19 +58,19 @@ enum {
/* layout of LAIKAPKT_PINGPONG:
* NULL (empty packet)
*/
LAIKAPKT_SHELL_OPEN, /* if sent to bot, opens a shell. if sent to cnc, signifies you opened a shell */
LAIKAPKT_SHELL_OPEN,
/* layout of LAIKAPKT_SHELL_OPEN:
* uint32_t id; // this field is absent from the panel/auth client
* uint32_t id;
* uint16_t cols;
* uint16_t rows;
*/
LAIKAPKT_SHELL_CLOSE, /* if sent to bot, closes a shell. if sent to cnc, signifies a shell was closed */
LAIKAPKT_SHELL_CLOSE,
/* layout of LAIKAPKT_SHELL_CLOSE:
* uint32_t id; // this field is absent from the panel/auth client
* uint32_t id;
*/
LAIKAPKT_SHELL_DATA, /* if sent to bot, writes data to stdin of shell. if sent to cnc, writes to 'stdout' of shell */
LAIKAPKT_SHELL_DATA,
/* layout of LAIKAPKT_SHELL_DATA
* uint32_t id; // this field is absent from the panel/auth client
* uint32_t id;
* char buf[VAR_PACKET_LENGTH-sizeof(uint32_t)];
*/
LAIKAPKT_CONTENT_NEW,