summaryrefslogtreecommitdiffstats
path: root/src/server/globals.h
diff options
context:
space:
mode:
authorSimon Rettberg2017-11-08 15:34:03 +0100
committerSimon Rettberg2017-11-08 15:34:03 +0100
commit5440febba42d0f46572d0617f0fdd5d2d38922de (patch)
tree6032fdf2bd19bda0c7504b445dcf96b3514ccddc /src/server/globals.h
parent[SERVER] altservers: Tweak, cleanup, refactor, rename (diff)
downloaddnbd3-5440febba42d0f46572d0617f0fdd5d2d38922de.tar.gz
dnbd3-5440febba42d0f46572d0617f0fdd5d2d38922de.tar.xz
dnbd3-5440febba42d0f46572d0617f0fdd5d2d38922de.zip
[SERVER] Add multiple config options for limiting stuff
maxClients, maxImages, maxPayload, maxReplicationSize Refs #3231
Diffstat (limited to 'src/server/globals.h')
-rw-r--r--src/server/globals.h29
1 files changed, 29 insertions, 0 deletions
diff --git a/src/server/globals.h b/src/server/globals.h
index 1475981..c1d5d78 100644
--- a/src/server/globals.h
+++ b/src/server/globals.h
@@ -219,8 +219,37 @@ extern bool _lookupMissingForProxy;
extern int _listenPort;
/**
+ * Max number of DNBD3 clients we accept
+ */
+extern int _maxClients;
+
+/**
+ * Max number of Images we support (in baseDir)
+ */
+extern int _maxImages;
+
+/**
+ * Maximum payload length we accept on uplinks and thus indirectly
+ * from clients in case the requested range is not cached locally.
+ * Usually this isn't even a megabyte for "real" clients (blockdev
+ * or fuse).
+ */
+extern int _maxPayload;
+
+/**
+ * If in proxy mode, don't replicate images that are
+ * larger than this according to the uplink server.
+ */
+extern uint64_t _maxReplicationSize;
+
+/**
* Load the server configuration.
*/
void globals_loadConfig();
+/**
+ * Dump the effective configuration in use to given buffer.
+ */
+size_t globals_dumpConfig(char *buffer, size_t size);
+
#endif /* GLOBALS_H_ */