}
}
-/* Vector to store passive-interface name. */
-vector Vripng_passive_interface;
-
/* Utility function for looking up passive interface settings. */
static int ripng_passive_interface_lookup(const char *ifname)
{
unsigned int i;
char *str;
- for (i = 0; i < vector_active(Vripng_passive_interface); i++)
- if ((str = vector_slot(Vripng_passive_interface, i)) != NULL)
+ if (!ripng)
+ return -1;
+
+ for (i = 0; i < vector_active(ripng->passive_interface); i++)
+ if ((str = vector_slot(ripng->passive_interface, i)) != NULL)
if (strcmp(str, ifname) == 0)
return i;
return -1;
if (ripng_passive_interface_lookup(ifname) >= 0)
return NB_ERR_INCONSISTENCY;
- vector_set(Vripng_passive_interface, strdup(ifname));
+ vector_set(ripng->passive_interface, strdup(ifname));
ripng_passive_interface_apply_all();
if (i < 0)
return NB_ERR_INCONSISTENCY;
- str = vector_slot(Vripng_passive_interface, i);
+ str = vector_slot(ripng->passive_interface, i);
free(str);
- vector_unset(Vripng_passive_interface, i);
+ vector_unset(ripng->passive_interface, i);
ripng_passive_interface_apply_all();
unsigned int i;
char *str;
- for (i = 0; i < vector_active(Vripng_passive_interface); i++)
- if ((str = vector_slot(Vripng_passive_interface, i)) != NULL) {
+ for (i = 0; i < vector_active(ripng->passive_interface); i++)
+ if ((str = vector_slot(ripng->passive_interface, i)) != NULL) {
free(str);
- vector_slot(Vripng_passive_interface, i) = NULL;
+ vector_slot(ripng->passive_interface, i) = NULL;
}
ripng_passive_interface_apply_all();
}
hook_register_prio(if_add, 0, ripng_if_new_hook);
hook_register_prio(if_del, 0, ripng_if_delete_hook);
- /* RIPng passive interface. */
- Vripng_passive_interface = vector_init(1);
-
/* Install interface node. */
install_node(&interface_node, interface_config_write);
if_cmd_init();
ripng->table = agg_table_init();
ripng->enable_if = vector_init(1);
ripng->enable_network = agg_table_init();
+ ripng->passive_interface = vector_init(1);
/* Distribute list install. */
ripng->distribute_ctx = distribute_list_ctx_create(
ripng_passive_interface_clean();
vector_free(ripng->enable_if);
agg_table_finish(ripng->enable_network);
+ vector_free(ripng->passive_interface);
ripng_offset_clean();
ripng_interface_clean();
ripng_redistribute_clean();