| 33 | trace_proto_t* global_trace_api=NULL; |
| 34 | |
| 35 | int trace_prot_bind(char* module_name, trace_proto_t* prot) |
| 36 | { |
| 37 | trace_bind_api_f bind_f; |
| 38 | |
| 39 | if (!module_name || !prot) { |
| 40 | LM_ERR("null argument\n"); |
| 41 | return -1; |
| 42 | } |
| 43 | |
| 44 | bind_f = (trace_bind_api_f) find_mod_export(module_name, |
| 45 | "trace_bind_api", 0); |
| 46 | |
| 47 | if (bind_f) { |
| 48 | LM_DBG("using trace bind api for %s\n", module_name); |
| 49 | |
| 50 | if (bind_f(prot)) { |
| 51 | LM_ERR("failed to bind proto for module %s\n", module_name); |
| 52 | return -1; |
| 53 | } |
| 54 | } else { |
| 55 | LM_DBG("<%s> has no bind api function\n", module_name); |
| 56 | return -1; |
| 57 | } |
| 58 | |
| 59 | return 0; |
| 60 | } |
no test coverage detected