/* * initialize module */ static int mod_init(void) { bind_sl_t bind_sl; strl* ptr; DBG("sanity initializing\n"); /* * We will need sl_send_reply from stateless * module for sending replies */ bind_sl = (bind_sl_t)find_export("bind_sl", 0, 0); if (!bind_sl) { ERR("This module requires sl module\n"); return -1; } if (bind_sl(&sl) < 0) return -1; DBG("parsing proxy requires string:\n"); ptr = parse_str_list(&pr_str); proxyrequire_list = ptr; while (ptr != NULL) { DBG("string: '%.*s', next: %p\n", ptr->string.len, ptr->string.s, ptr->next); ptr = ptr->next; } return 0; }
static int mod_init(void) { bind_sl_t bind_sl; DBG("speeddial module - initializing\n"); /* Find a database module */ if (bind_dbmod(db_url, &db_funcs)) { LOG(L_ERR, "sd:mod_init: Unable to bind database module\n"); return -1; } if (!DB_CAPABILITY(db_funcs, DB_CAP_QUERY)) { LOG(L_ERR, "sd:mod_init: Database modules does not " "provide all functions needed by SPEEDDIAL module\n"); return -1; } /** * We will need sl_send_reply from stateless * module for sending replies */ bind_sl = (bind_sl_t)find_export("bind_sl", 0, 0); if (!bind_sl) { ERR("This module requires sl module\n"); return -1; } if (bind_sl(&sl) < 0) return -1; return 0; }
/* * initialize module */ static int mod_init(void) { bind_sl_t bind_sl; DBG("options initializing\n"); bind_sl = (bind_sl_t)find_export("bind_sl", 0, 0); if (!bind_sl) { ERR("This module requires sl module\n"); return -1; } if (bind_sl(&sl) < 0) return -1; return 0; }
/* * Initialize parent */ static int mod_init(void) { bind_sl_t bind_sl; bind_usrloc_t bind_usrloc; DBG("registrar - initializing\n"); /* * We will need sl_send_reply from stateless * module for sending replies */ bind_sl = (bind_sl_t)find_export("bind_sl", 0, 0); if (!bind_sl) { ERR("This module requires sl module\n"); return -1; } if (bind_sl(&sl) < 0) return -1; bind_usrloc = (bind_usrloc_t)find_export("ul_bind_usrloc", 1, 0); if (!bind_usrloc) { ERR("Can't bind usrloc\n"); return -1; } /* Normalize default_q parameter */ if (default_q != Q_UNSPECIFIED) { if (default_q > MAX_Q) { DBG("registrar: default_q = %d, lowering to MAX_Q: %d\n", default_q, MAX_Q); default_q = MAX_Q; } else if (default_q < MIN_Q) { DBG("registrar: default_q = %d, raising to MIN_Q: %d\n", default_q, MIN_Q); default_q = MIN_Q; } } if (parse_attr_params() < 0) return -1; if (bind_usrloc(&ul) < 0) { return -1; } return 0; }