MCPcopy Create free account
hub / github.com/OpenSIPS/opensips / find_mod_export

Function find_mod_export

sr_module.c:577–598  ·  view source on GitHub ↗

* searches the module list and returns pointer to "name" function in module * "mod" or 0 if not found * flags parameter is OR value of all flags that must match */

Source from the content-addressed store, hash-verified

575 * flags parameter is OR value of all flags that must match
576 */
577cmd_function find_mod_export(const char* mod, const char* name, int flags)
578{
579 struct sr_module* t;
580 const cmd_export_t* cmd;
581
582 for (t = modules; t; t = t->next) {
583 if (strcmp(t->exports->name, mod) == 0) {
584 for (cmd = t->exports->cmds; cmd && cmd->name; cmd++) {
585 if ((strcmp(name, cmd->name) == 0) &&
586 ((cmd->flags & flags) == flags)
587 ){
588 LM_DBG("found <%s> in module %s [%s]\n",
589 name, t->exports->name, t->path);
590 return cmd->function;
591 }
592 }
593 }
594 }
595
596 LM_DBG("<%s> in module %s not found\n", name, mod);
597 return 0;
598}
599
600
601

Callers 3

trace_prot_bindFunction · 0.85
aaa_prot_bindFunction · 0.85
db_bind_modFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected