14 Commits

Author SHA1 Message Date
Johan Wikman
5648f708af Update license to BSL 1.1 2017-02-14 21:42:28 +02:00
Esa Korhonen
53c5b475ad More cleanup of monitor.h
Move some more functions into core header + miscellaneous cleanup
2017-01-19 15:32:40 +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
c13a2eeb33 Hide definition of MXS_FILTER_DEF
MXS_FILTER_DEF is now private the MaxScale core.
2017-01-16 10:47:00 +02:00
Markus Mäkelä
60d4e17996 Allow restriction of module command arguments
The module commands now support an optional flag for arguments that when
enabled checks that the argument module name matches the registered domain
name. This can be used to enforce argument type validity for arguments
that are given to modules that expect objects of a certain type.

For example, this is used by the cache and dbfwfilter to prevent valid
filters but of the wrong type being given as arguments.
2017-01-13 15:28:36 +02:00
Johan Wikman
265e5c0593 Rename FILTER_DEF to MXS_FILTER_DEF
Provide functions that allows the actual definition of MXS_FILTER_DEF
to be made private.
2017-01-13 14:30:11 +02:00
Markus Makela
a4bc575353 Remove direct freeing of sessions
Sessions are now always freed by releasing the last reference to it.
2016-12-02 15:19:44 +02:00
Markus Makela
adbd666991 Change module command parameter types
This commit introduces safe session references that can be handled without
holding locks. This allows the safe searching of sessions with the unique
ID of the session.

Remove the use of raw pointers passed as strings. Change the comments of
the argument types and add more details to the parsing function
documentation.
2016-12-02 14:26:56 +02:00
Markus Makela
c01430e3fc Fix module commands with no arguments
Passing zero as the argument count would lead to a malloc for zero
bytes which would always cause a failure.
2016-11-29 14:19:08 +02:00
Markus Makela
3b5b616edf MXS-929: Add descriptions to module command arguments
Each argument now has a description describing what it does and what it's
used for.
2016-11-22 10:46:34 +02:00
Markus Makela
4137d58dd5 MXS-929: Implement DCB and SESSION pointer handling
DCBs and SESSIONs can be passed either as raw pointers or as the string
representations of them.

The preferred way to pass them is to use the raw pointer types. This
removes the need to convert the pointer to string form and back.
2016-11-22 10:46:34 +02:00
Markus Makela
d68172260d MXS-929: Add mapping function for module commands
The modulecmd_foreach function allows commands to be iterated without having
to manage the locking of the system. This allows the commands to be easily
iterated and gathered into filtered lists without having to build it into
the module command system itself.
2016-11-22 10:46:34 +02:00
Markus Makela
4a142b1ca9 MXS-929: Add errors to the modulecmd system
The modules can now return human-readable error messages to the caller of
the function. The internals of the modulecmd system also use this to
return errors to the users.

The error messages can be retrieved with a common error function which
should make it easy to use in various clients.
2016-11-22 10:46:34 +02:00
Markus Makela
4603e71987 MXS-929: Add domain function registration
A module can register a function to a domain. These function can then be
called by external actors enabling the modules to expand their
functionality beyond the module API. Each module should use its own domain
e.g the library name.

Currently, the functions do not return results. The possible next step
would be to alter the function entry point to return a result set of
sorts. This would allow the modules to convey structured information to
the client information which would handle the formatting of the result.

Although this sounds good, it is not required for the implementation of
MXS-929.
2016-11-22 10:46:34 +02:00