26 Commits

Author SHA1 Message Date
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Markus Mäkelä
5a2a69b7be Make enum parameter values unsigned 64bit integers
Making the enum value relatively large removes the need to expand it if a
module requires a significant amount of enumeration values.
2017-01-19 16:03:05 +02:00
Markus Mäkelä
0b6b9c3d81 Format core source code and headers
Formatted core source code and headers with Astyle.
2017-01-17 14:47:50 +02:00
Johan Wikman
e7b951c434 Rename FILTER_OBJECT to MXS_FILTER_OBJECT
Other clarifications to follow.
2017-01-13 10:03:23 +02:00
Markus Mäkelä
a1293fbd79 Add unique constraint to enumeration parameters
Enum parameters can now be declared unique. This prevents multiple values
for enumerations which only accept one value.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
b352458870 Add size type to module parameters
The type represents byte sizes used for configuring buffers and file
sizes. The supported suffixes for binary units are k, m, g and t in both
upper and lower case.
2017-01-10 16:52:29 +02:00
Markus Mäkelä
b507976414 Use a constant instead of a hard-coded parameter limit
Limits are better defined with constants that can be reused elsewhere.
2017-01-09 14:17:34 +02:00
Markus Mäkelä
c500ddc768 Use module parameters in namedserverfilter
The namedserverfilter module now uses the module parameters.

Added new server type parameter which is validated both at startup and
runtime.
2017-01-09 14:17:33 +02:00
Markus Mäkelä
f156b1e4ee Add minimum and maximum values for integer parameters
The defined integer values can be used to give a default value the maximum
for its type.
2017-01-09 14:17:33 +02:00
MassimilianoPinto
7c13b56e74 Fix compilation error on CentOS6
Fix compilation error on CentOS6
2017-01-09 12:07:18 +01:00
Markus Mäkelä
6a64de649b Increate parameter limit to 64
Modules can now declare up to 64 parameters.
2017-01-05 19:51:22 +02:00
Markus Mäkelä
9fa2de29d9 Return enum values as integers instead of strings
If the enums are converted to the acutual enum values before they are
returned, this removes the need for the modules to process the enum
strings to enum values. This allows modules to use enumerations with
minimal effort.
2017-01-05 19:51:22 +02:00
Johan Wikman
03391748ee Call [process|thread] [init|finish] functions of modules
The process initialization function was also renamed from init to
process_init.
2017-01-05 16:17:50 +02:00
Johan Wikman
a2a38f952a Add [process|thread] [init|finish] functions to modules
The MXS_MODULDE object now contains optinal pointers for functions
to be called att process and thread startup and shutdown. Since the
functions were added to the end, strictly speaking, all structures
would not have needed to have been modified, but better to be
explicit. In a subsequent change, these will be called.

C++ does not support flexible arrays, so for the time being C++
modules are restricted to 10 parameters. Better approach is to
factor out the parameters to a separate array and then just store
a pointer to that array in MXS_MODULE.
2017-01-05 14:44:02 +02:00
Markus Mäkelä
257cb5c209 Add path and service module parameter types
The path type is validated if the module requested path
validation. Service checks can be done both on startup and at
runtime. This allows dynamic changes to module parameters to be validated
without a configuration context.
2017-01-05 10:48:58 +02:00
Markus Mäkelä
e0ad6188ad Add module parameter options
The options allow the modules to impose type specific restrictions on the
parameters. This can be used to offload file permission and mandatory
parameter checks to the core.
2017-01-05 10:48:58 +02:00
Markus Mäkelä
241dbb464a Add framework for declaration of module parameters
The MXS_MODULE structure now contains a member for parameters. This can be
used by the modules to declare accepted parameters, their types and the
default values. Currently only count, integer, boolean, string and enum
values are supported.
2017-01-05 09:58:10 +02:00
Markus Mäkelä
f78db1aab9 Fix modinfo.h comments
The comments referred to a non-existent type.
2017-01-03 20:19:22 +02:00
Markus Mäkelä
c96bd64aa8 Rename MODULE_INFO to MXS_MODULE
The MODULE_INFO is now the main object which is used by modules to convey
information to the MaxScale core. The MXS_MODULE name is more apt as it
now contains the actual module definition.

The old MODULES structure was moved into load_utils.c as an internal
implementation and was renamed so that it is not confused with the new
MODULE structure.
2017-01-03 18:01:14 +02:00
Markus Mäkelä
b00e0328d5 Create a macro for module declarations
The modules are now declared with a common macro. This allows future
additions to the module loading process while also making the loaded
symbol name a constant.
2017-01-03 18:01:13 +02:00
Markus Mäkelä
ae0577c695 Move module object inside MODULE_INFO
This allows modules to only expose one entry point with a consistent
signature. In the future, this could be used to implement declarations of
module parameters.
2017-01-03 18:01:13 +02:00
Markus Mäkelä
7df29aa1ec Move version entry point into MODULE_INFO
The MODULE_INFO can easily hold the version information of the
module. This removes the need for a explicit version entry point.
2017-01-03 18:01:13 +02:00
Johan Wikman
04753bbb76 Make MODULE_INFO const correct 2016-11-24 13:11:03 +02:00
Johan Wikman
d7ce3ad75b Replace include guards with #pragma once 2016-10-26 08:23:15 +03:00
Johan Wikman
1a978be6b6 Cleanup header files
- All now include maxscale/cdefs.h as the very first file.
- MXS_[BEGIN|END]_DECLS added to all C-headers.
  Strictly speaking not necessary for private headers, but
  does not hurt either.
- Include guards moved to the very top of the file.
- #pragma once added.
2016-10-14 11:54:37 +03:00
Johan Wikman
e41589be10 Move headers from server/include to include/maxscale
- Headers now to be included as <maxscale/xyz.h>
- First step, no cleanup of headers has been made. Only moving
  from one place to another + necessary modifications.
2016-10-13 16:19:20 +03:00