[sr-dev] git:master:92e72ab4: core: exposed module version control function

Daniel-Constantin Mierla miconda at gmail.com
Tue Feb 16 16:29:44 CET 2021


Module: kamailio
Branch: master
Commit: 92e72ab4de7e7a9d1dee57e9bac61cf513367a42
URL: https://github.com/kamailio/kamailio/commit/92e72ab4de7e7a9d1dee57e9bac61cf513367a42

Author: Daniel-Constantin Mierla <miconda at gmail.com>
Committer: Daniel-Constantin Mierla <miconda at gmail.com>
Date: 2021-02-16T16:22:45+01:00

core: exposed module version control function

---

Modified: src/core/sr_module.c
Modified: src/core/sr_module.h

---

Diff:  https://github.com/kamailio/kamailio/commit/92e72ab4de7e7a9d1dee57e9bac61cf513367a42.diff
Patch: https://github.com/kamailio/kamailio/commit/92e72ab4de7e7a9d1dee57e9bac61cf513367a42.patch

---

diff --git a/src/core/sr_module.c b/src/core/sr_module.c
index c37e1ab680..03f8feef81 100644
--- a/src/core/sr_module.c
+++ b/src/core/sr_module.c
@@ -335,7 +335,10 @@ static int register_module(module_exports_t* e, char* path, void* handle)
 	return ret;
 }
 
-static inline int version_control(void *handle, char *path)
+/**
+ * check the version of loaded module
+ */
+int ksr_version_control(void *handle, char *path)
 {
 	char **m_ver;
 	char **m_flags;
@@ -572,7 +575,7 @@ int load_module(char* mod_path)
 		}
 	}
 	/* version control */
-	if (!version_control(handle, path)) {
+	if (!ksr_version_control(handle, path)) {
 		ksr_exit(-1);
 	}
 	/* launch register */
diff --git a/src/core/sr_module.h b/src/core/sr_module.h
index 8de9026c2a..99c1dc1de1 100644
--- a/src/core/sr_module.h
+++ b/src/core/sr_module.h
@@ -551,4 +551,6 @@ int ksr_shutdown_phase(void);
 
 int ksr_locate_module(char *mod_path, char **new_path);
 
+int ksr_version_control(void *handle, char *path);
+
 #endif /* sr_module_h */




More information about the sr-dev mailing list