From 893b125acba6633bf946adf2b9821f6359fc4d3c Mon Sep 17 00:00:00 2001 From: Simon Rettberg Date: Sun, 1 Oct 2017 17:25:47 +0200 Subject: [SERVER] Implement HTTP RPC that supports different queries and ACL - ACL is defined in new file rpc.acl - Queries are still WIP, for now something like /query?q=stats&q=images /query?q=clients works, although the parsing is still ugly - Also supports HTTP keep-alive --- src/server/globals.h | 20 +++++--------------- 1 file changed, 5 insertions(+), 15 deletions(-) (limited to 'src/server/globals.h') diff --git a/src/server/globals.h b/src/server/globals.h index 31b7741..379fb8d 100644 --- a/src/server/globals.h +++ b/src/server/globals.h @@ -64,17 +64,6 @@ struct _dnbd3_connection uint64_t bytesReceived; // Number of bytes received by the connection. }; -typedef struct -{ - uint16_t len; - uint8_t data[65535]; -} dnbd3_binstring_t; -// Do not always allocate as much memory as required to hold the entire binstring struct, -// but only as much as is required to hold the actual data (relevant for kernel module) -#define NEW_BINSTRING(_name, _len) \ - dnbd3_binstring_t *_name = malloc(sizeof(uint16_t) + _len); \ - _name->len = _len - typedef struct { char comment[COMMENT_LENGTH]; @@ -88,10 +77,11 @@ typedef struct typedef struct { - char comment[COMMENT_LENGTH]; - dnbd3_host_t host; - dnbd3_host_t mask; -} dnbd3_acess_rules_t; + uint8_t host[16]; + int bytes; + int bitMask; + int permissions; +} dnbd3_access_rule_t; /** * Image struct. An image path could be something like -- cgit v1.2.3-55-g7522