Example #1
0
gdmaps_t* gdmaps_test_init(const char* input_cfgdir) {

    dmn_init1(false, true, true, false, "gdmaps_test");

    const vscf_data_t* cfg_root = conf_load_vscf(input_cfgdir);
    const vscf_data_t* maps_cfg = conf_get_maps(cfg_root);
    gdmaps_t* gdmaps = gdmaps_new(maps_cfg);
    vscf_destroy(cfg_root);

    gdmaps_load_databases(gdmaps);
    gdmaps_setup_watchers(gdmaps);

    return gdmaps;
}
Example #2
0
gdmaps_t* gdmaps_test_init(const char* config_path) {

    dmn_init_log();

    dmn_assert(config_path);

    const vscf_data_t* cfg_root = conf_load(config_path);
    conf_options(cfg_root);
    gdnsd_set_cfdir(config_path);

    const vscf_data_t* maps_cfg = conf_get_maps(cfg_root);
    gdmaps_t* gdmaps = gdmaps_new(maps_cfg);
    vscf_destroy(cfg_root);

    gdmaps_load_geoip_databases(gdmaps);
    gdmaps_setup_geoip_watcher_paths(gdmaps);
    gdmaps_setup_geoip_watchers(gdmaps);

    return gdmaps;
}