blob: 0924da22d7b97816ce27d5e5a3df2a31a7b457e2 [file] [log] [blame]
MG Mud User88f12472016-06-24 23:31:02 +02001SYNOPSIS
2 #include <configuration.h>
3
4 void configure_driver(int what, mixed data)
5
6DESCRIPTION
7 This efun configures runtime adjustable bahviour of the driver.
8
9 Sets the option <what> to the value <data>.
10
11 This function always causes the privilege_violation
12 ("configure_driver", this_object(), what, data).
13
14 <what> == DC_MEMORY_LIMIT
15 Set new soft and hard memory limits for the driver.
16 <data> is expected to be an array with two elements, which have to
17 be integers giving the amount of memory in bytes.
18 ({<soft memory limit>, <hard memory limit>})
19
20 <what> == DC_ENABLE_HEART_BEATS
21 Globally enable the calling of Heartbeats, if <data> is 1,
22 globally disable them if <data> is 0.
23 If called during heartbeat processing, the change comes into effect
24 at the next backend cycle.
25
26 <what> == DC_LONG_EXEC_TIME
27 Set the time considered as (too) long for top-level executions. If
28 an execution exceeds this time, a stack trace will be written to
29 the debug log. The execution will continue at that point.
30 <data> is an integer and measured in microseconds.
31 A time of 0 disables the detection of long executions.
32
33 <what> == DC_DATA_CLEAN_TIME
34 Sets the average time between clean-ups of an objects data
35 structures. This is not to be confused with the standard cleanup
36 time which determines when H_CLEAN_UP is called. A long time for
37 data cleanup may lead to larger memory consumption and prevents
38 destructed objects being cleaned up. A too short time may lead to
39 high loads and lag on the machine. The actual time delay will be a
40 time between 0.9*DC_DATA_CLEAN_TIME and 1.1*DC_DATA_CLEAN_TIME.
41 Default at driver startup are 3600s.
42 <data> is an integer and measured in seconds.
43
44 <what> == DC_TLS_CERTIFICATE
45 Sets the current certificate used for new TLS sessions.
46 It can be one of the certificates in the key directory
47 (command line option --tls-keydirectory) or the main
48 certificate (given with --tls-certfile).
49 Default is the main certificate or else the first
50 certificate found in the directory. The chosen certificate at the
51 time of the tls_init_connection() call is used for that connection.
52 <data> is a string containing the SHA1 fingerprint
53 of the certificate with hexadecimal numbers,
54 it may contain colons or whitespaces (for example
55 "5A:FE:CA:57:1E:50:5E:1E:C7:ED:BA:11:AD:50:10:75:0F:7A:1E:50").
56 When loading certificates their fingerprints are printed
57 on stdout and into the logfile.
58
59 <what> == DC_TLS_DHE_PARAMETER
60 Sets new parameters for the Diffie-Hellman keyexchange for new TLS
61 sessions. The paramters must be given as a PEM encoded string
62 (e.g. the output of 'openssl dhparam -5 2048').
63 If <data> is 0, the built-in defaults will be restored.
64 If importing the new parameters fails (e.g. due to an incorrect
65 format), the driver tries to keep the old parameters
66
67 <what> == DC_TLS_CIPHERLIST
68 Sets a new list of ciphers (OpenSSL) or priorities (GnuTLS) to use.
69 For the correct format, please refer to the help of 'openssl
70 ciphers' or documentation of priority strings in GnuTLS.
71 With GnuTLS a syntax error in the list causes an error.
72 With OpenSSL an error is only raised of none of the given ciphers
73 could be selected.
74 By default, the preferred ciphers of the driver take precedence
75 This can be changed in the priority strings for GnuTLS, but
76 currently not for OpenSSL.
77
78 <what> == DC_EXTRA_WIZINFO_SIZE
79 Indicate that the wizlist should contain an array of the given size
80 with extra info for each wizard. A negative value indicates
81 a non-array value.
82
83 The value is only used to allocate a proper empty 'extra' value
84 for newly created wizlist entries.
85
86 <what> == DC_DEFAULT_RUNTIME_LIMITS
87 Sets the default runtime limits, that will be used for each thread.
88 They will be in effect as the initial limits with the next thread.
89 The limits must be given as an array with the following entries:
90
91 int[LIMIT_EVAL]: the max number of eval costs
92 int[LIMIT_ARRAY]: the max number of array entries
93 int[LIMIT_MAPPING_SIZE]: the max number of mapping values
94 int[LIMIT_MAPPING_KEYS]: the max number of mapping entries
95 int[LIMIT_BYTE]: the max number of bytes handled with
96 one read_bytes()/write_bytes() call.
97 int[LIMIT_FILE]: the max number of bytes handled with
98 one read_file()/write_file() call.
99 int[LIMIT_CALLOUTS]: the number of callouts at one time.
100 int[LIMIT_COST]: how to account the current cost.
101 int[LIMIT_MEMROY]: the max. number of bytes which can be
102 _additionally_ allocated/used
103 _per top-level execution thread_.
104
105 The limit settings recognize three special values:
106
107 LIMIT_UNLIMITED: the limit is deactivated
108 LIMIT_KEEP: the former setting is kept
109 LIMIT_DEFAULT: the 'global' default setting is used.
110
111 For LIMIT_COST, the special values have these meaning:
112 LIMIT_UNLIMITED: at maximum 1 tick is accounted
113 LIMIT_KEEP: LIMIT_COST is set to 0
114 LIMIT_DEFAULT: LIMIT_COST is set to -100
115
116 <what> == DC_SWAP_COMPACT_MODE
117 Sets free swap space shall be reused immediately to keep
118 the swap file as small as possible.
119 (Same as the --swap-compact command line switch.)
120
Zesstra715ec202025-07-09 22:18:31 +0200121 <what> == DC_SWAP_TIME
122 Sets the time until the program of an unused object is swapped out
123 (if possible). Setting the interval to 0 disables swapping of
124 programs.
125 <data> is an integer and measured in seconds.
126 (Same as the --swap-time command line switch.)
127
128 <what> == DC_SWAP_VAR_TIME
129 Sets the time until the variables of an unused object are swapped
130 out. Setting the interval to 0 disables swapping of variables.
131 <data> is an integer and measured in seconds.
132 (Same as the --swap-variables command line switch.)
133
134 <what> == DC_CLEANUP_TIME
135 Sets the time until the cleanup hook is called in unused objects.
136 <data> is an integer and measured in seconds.
137 (Same as the --cleanup-time command line switch.)
138
139 <what> == DC_RESET_TIME
140 Sets the default time until the reset hook is called in objects.
141 The change will take effect for each object after its next reset.
142 <data> is an integer and measured in seconds.
143 (Same as the --reset-time command line switch.)
144
145 <what> == DC_DEBUG_FILE
146 Sets the debug log file.
147 The filename can be given relative to the mudlib directory
148 or absolute with regard to the operating system.
149 Settings this option will force closing and reopening
150 the log file (even if the name didn't change).
151
152 <what> == DC_FILESYSTEM_ENCODING
153 Sets the character encoding used in the filesystem.
154 If not set, the default encoding is derived from the LC_CTYPE
155 environment setting. If LC_CTYPE is not defined, or it is set to
156 the "C" locale, then "UTF-8" is used as a default.
157
158 <what> == DC_SIGACTION_SIGHUP
159 <what> == DC_SIGACTION_SIGINT
160 <what> == DC_SIGACTION_SIGUSR1
161 <what> == DC_SIGACTION_SIGUSR2
162 Sets the default action when the driver encounters those
163 POSIX signals. It can be set to one of the following options:
164
165 DCS_DEFAULT:
166 This is the default action: Call handle_external_signal()
167 in the master and act upon its result.
168
169 DCS_IGNORE:
170 Ignore the signal.
171
172 DCS_TERMINATE:
173 Terminate the process immediately.
174
175 DCS_SHUTDOWN:
176 Do a graceful shutdown.
177
178 DCS_INFORM_MASTER:
179 Call handle_external_signal(), but ignore its result.
180
181 DCS_RELOAD_MASTER:
182 Reload the master object.
183
184 DCS_THROW_EXCEPTION:
185 Cause an error in the currently running LPC or Python
186 function.
187
MG Mud User88f12472016-06-24 23:31:02 +0200188HISTORY
189 Introduced in LDMud 3.3.719.
190 DC_ENABLE_HEART_BEATS was added in 3.5.0.
191 DC_LONG_EXEC_TIME was added in 3.5.0.
192 DC_DATA_CLEAN_TIME was added in 3.5.0.
193 DC_EXTRA_WIZINFO_SIZE was added in 3.5.0.
194 DC_TLS_CERTIFICATE was added in 3.5.0.
195 DC_TLS_DHE_PARAMETER was added in 3.5.0.
196 DC_TLS_CIPHERLIST was added in 3.5.0.
197 DC_SWAP_COMPACT_MODE was added in 3.5.0.
Zesstra715ec202025-07-09 22:18:31 +0200198 DC_SWAP_TIME was added in 3.5.2
199 DC_SWAP_VAR_TIME was added in 3.5.2
200 DC_CLEANUP_TIME was added in 3.5.2
201 DC_RESET_TIME was added in 3.5.2
202 DC_DEBUG_FILE was added in 3.5.2.
203 DC_SIGACTION_* were added in 3.5.2.
MG Mud User88f12472016-06-24 23:31:02 +0200204
205SEE ALSO
206 configure_interactive(E)