Introduce src, obj, build, docs & modify Makefile

This commit is contained in:
2018-02-16 15:30:36 +02:00
parent 3a0ccd3b31
commit bd9ebee627
29 changed files with 15 additions and 21 deletions

41
src/protocol.h Normal file
View File

@@ -0,0 +1,41 @@
#ifndef PROTOCOL_H
#define PROTOCOL_H
#define CHUNKSIZE 2048
enum msg_types {
UNIX,
POWERSHELL,
INSTALL_PKG,
QUERY_PKG,
DELETE_PKG,
LIST_PKGS,
UPDATE_PKG,
UPDATE_PKGS,
GET_OS,
GET_KERNEL,
GET_UPTIME,
GET_MEMORY
};
struct msg_meta_t {
unsigned short id; /* Agent job ID */
unsigned short type; /* Data type */
unsigned int len; /* Data size to expect in buffer */
unsigned int chunks;
short is_recv;
short locking;
short isjob;
};
struct msg_chunk_t {
int id;
unsigned char data[CHUNKSIZE];
};
struct msg_t {
struct msg_meta_t meta;
struct msg_chunk_t chunk;
};
#endif /* PROTOCOL_H */