Skip to content

Commit

Permalink
add dependencies function in module_exports
Browse files Browse the repository at this point in the history
Add a new function in module_exports that is run to determine what kind
of dependencies (of other modules) a module has. This function is ran
before running the initialization phase of the module.

(cherry picked from commit b29931e)
  • Loading branch information
razvancrainea committed Sep 19, 2019
1 parent f9bc3ce commit 36b37f6
Show file tree
Hide file tree
Showing 159 changed files with 210 additions and 16 deletions.
6 changes: 6 additions & 0 deletions main.c
Expand Up @@ -1415,6 +1415,12 @@ int main(int argc, char** argv)
goto error;
}

/* init modules dependencies */
if (init_modules_deps() != 0) {
LM_ERR("error while initializing modules dependencies\n");
goto error;
}

/* init modules */
if (init_modules() != 0) {
LM_ERR("error while initializing modules\n");
Expand Down
1 change: 1 addition & 0 deletions modules/aaa_radius/aaa_radius.c
Expand Up @@ -142,6 +142,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
acmds, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/acc/acc_mod.c
Expand Up @@ -262,6 +262,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
params, /* exported params */
Expand Down
1 change: 1 addition & 0 deletions modules/alias_db/alias_db.c
Expand Up @@ -111,6 +111,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/auth/auth_mod.c
Expand Up @@ -182,6 +182,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0,
params,
Expand Down
1 change: 1 addition & 0 deletions modules/auth_aaa/authaaa_mod.c
Expand Up @@ -129,6 +129,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down
3 changes: 2 additions & 1 deletion modules/auth_db/authdb_mod.c
Expand Up @@ -190,6 +190,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down Expand Up @@ -312,4 +313,4 @@ static int fixup_check_outvar(void **param)
}

return 0;
}
}
1 change: 1 addition & 0 deletions modules/avpops/avpops.c
Expand Up @@ -250,6 +250,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
acmds, /* Exported async functions */
params, /* Exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/b2b_entities/b2b_entities.c
Expand Up @@ -129,6 +129,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
NULL, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/b2b_logic/b2b_logic.c
Expand Up @@ -212,6 +212,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/b2b_sca/b2b_sca.c
Expand Up @@ -190,6 +190,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/benchmark/benchmark.c
Expand Up @@ -181,6 +181,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS,
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/cachedb_cassandra/cachedb_cassandra.c
Expand Up @@ -73,6 +73,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
NULL, /* exported functions */
0, /* exported async functions */
params, /* param exports */
Expand Down
1 change: 1 addition & 0 deletions modules/cachedb_couchbase/cachedb_couchbase.c
Expand Up @@ -73,6 +73,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
0, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/cachedb_local/cachedb_local.c
Expand Up @@ -117,6 +117,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load functionpen flags */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/cachedb_memcached/cachedb_memcached.c
Expand Up @@ -87,6 +87,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
0, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/cachedb_mongodb/cachedb_mongodb.c
Expand Up @@ -81,6 +81,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
0, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/cachedb_redis/cachedb_redis.c
Expand Up @@ -69,6 +69,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
0, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/cachedb_sql/cachedb_sql.c
Expand Up @@ -100,6 +100,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
0, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/call_center/call_center.c
Expand Up @@ -187,6 +187,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
mod_params, /* param exports */
Expand Down
1 change: 1 addition & 0 deletions modules/call_control/call_control.c
Expand Up @@ -203,6 +203,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, // dlopen flags
NULL, // load function
&deps, // OpenSIPS module dependencies
0, // OpenSIPS dependencies function
commands, // exported functions
NULL, // exported async functions
parameters, // exported parameters
Expand Down
1 change: 1 addition & 0 deletions modules/carrierroute/carrierroute.c
Expand Up @@ -262,6 +262,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Export parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/cfgutils/cfgutils.c
Expand Up @@ -277,6 +277,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
acmds, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/cgrates/cgrates.c
Expand Up @@ -150,6 +150,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
acmds,
params,
Expand Down
1 change: 1 addition & 0 deletions modules/clusterer/clusterer_mod.c
Expand Up @@ -242,6 +242,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/compression/compression.c
Expand Up @@ -183,6 +183,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
mod_params, /* param exports */
Expand Down
1 change: 1 addition & 0 deletions modules/cpl_c/cpl.c
Expand Up @@ -201,6 +201,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down
3 changes: 2 additions & 1 deletion modules/db_berkeley/db_berkeley.c
Expand Up @@ -98,7 +98,8 @@ struct module_exports exports = {
MODULE_VERSION,
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_cachedb/db_cachedb.c
Expand Up @@ -77,6 +77,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
NULL,
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_flatstore/flatstore_mod.c
Expand Up @@ -117,6 +117,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0,
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_http/db_http.c
Expand Up @@ -85,6 +85,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0,
params, /* module parameters */
Expand Down
3 changes: 2 additions & 1 deletion modules/db_mysql/db_mysql.c
Expand Up @@ -97,7 +97,8 @@ struct module_exports exports = {
MODULE_VERSION,
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0, /* exported async functions */
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_oracle/db_oracle.c
Expand Up @@ -63,6 +63,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0,
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_perlvdb/perlvdb.c
Expand Up @@ -74,6 +74,7 @@ struct module_exports exports = {
RTLD_NOW | RTLD_GLOBAL, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0,
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_postgres/db_postgres.c
Expand Up @@ -78,6 +78,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* module functions */
0, /* module async functions */
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_sqlite/db_sqlite.c
Expand Up @@ -71,6 +71,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0, /* exported async functions */
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_text/dbtext.c
Expand Up @@ -95,6 +95,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
NULL, /* Exported async functions */
params, /* Exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_unixodbc/db_unixodbc.c
Expand Up @@ -63,6 +63,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0,
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/db_virtual/db_virtual.c
Expand Up @@ -133,6 +133,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0,
params, /* module parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/dialog/dialog.c
Expand Up @@ -471,6 +471,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
mod_params, /* param exports */
Expand Down
1 change: 1 addition & 0 deletions modules/dialplan/dialplan.c
Expand Up @@ -154,6 +154,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
mod_params, /* param exports */
Expand Down
1 change: 1 addition & 0 deletions modules/dispatcher/dispatcher.c
Expand Up @@ -333,6 +333,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds,
0,
params,
Expand Down
1 change: 1 addition & 0 deletions modules/diversion/diversion.c
Expand Up @@ -90,6 +90,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/dns_cache/dns_cache.c
Expand Up @@ -78,6 +78,7 @@ struct module_exports exports= {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
0, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/domain/domain_mod.c
Expand Up @@ -150,6 +150,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
NULL, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/domainpolicy/domainpolicy_mod.c
Expand Up @@ -142,6 +142,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* exported functions */
0, /* exported async functions */
params, /* exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/drouting/drouting.c
Expand Up @@ -529,6 +529,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
0, /* Exported async functions */
params, /* Exported parameters */
Expand Down
1 change: 1 addition & 0 deletions modules/emergency/emergency_methods.c
Expand Up @@ -109,6 +109,7 @@ struct module_exports exports = {
DEFAULT_DLFLAGS, /* dlopen flags */
0, /* load function */
&deps, /* OpenSIPS module dependencies */
0, /* OpenSIPS dependencies function */
cmds, /* Exported functions */
NULL, /* Exported async functions */
params, /* Exported parameters */
Expand Down

0 comments on commit 36b37f6

Please sign in to comment.