Initial commit. It's far from finished.
This commit is contained in:
40
protocol.h
Normal file
40
protocol.h
Normal file
@@ -0,0 +1,40 @@
|
||||
#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 {
|
||||
unsigned short id; /* Agent job ID */
|
||||
unsigned short type; /* Data type */
|
||||
unsigned len; /* Data size to expect in buffer */
|
||||
unsigned chunks;
|
||||
short is_recv;
|
||||
short locking;
|
||||
};
|
||||
|
||||
struct msg_chunk {
|
||||
int id;
|
||||
unsigned char data[CHUNKSIZE];
|
||||
};
|
||||
|
||||
struct msg {
|
||||
struct msg_meta meta;
|
||||
struct msg_chunk chunk;
|
||||
};
|
||||
|
||||
#endif /* PROTOCOL_H */
|
||||
Reference in New Issue
Block a user