zebra_pbr_ipset_entry_free);
hash_clean_and_free(&zrouter.ipset_hash, zebra_pbr_ipset_free);
hash_clean_and_free(&zrouter.iptable_hash, zebra_pbr_iptable_free);
- hash_clean_and_free(&zrouter.filter_hash, NULL);
- hash_clean_and_free(&zrouter.qdisc_hash, NULL);
- hash_clean_and_free(&zrouter.class_hash, NULL);
+ hash_clean_and_free(&zrouter.filter_hash, (void (*)(void *)) zebra_tc_filter_free);
+ hash_clean_and_free(&zrouter.qdisc_hash, (void (*)(void *)) zebra_tc_qdisc_free);
+ hash_clean_and_free(&zrouter.class_hash, (void (*)(void *)) zebra_tc_class_free);
#ifdef HAVE_SCRIPTING
zebra_script_destroy();
return new;
}
+void zebra_tc_qdisc_free(struct zebra_tc_qdisc *qdisc)
+{
+ XFREE(MTYPE_TC_QDISC, qdisc);
+}
+
static struct zebra_tc_qdisc *tc_qdisc_free(struct zebra_tc_qdisc *hash_data,
bool free_data)
{
hash_release(zrouter.qdisc_hash, hash_data);
if (free_data) {
- XFREE(MTYPE_TC_QDISC, hash_data);
+ zebra_tc_qdisc_free(hash_data);
return NULL;
}
new = hash_get(zrouter.qdisc_hash, qdisc,
tc_qdisc_alloc_intern);
(void)dplane_tc_qdisc_install(new);
- XFREE(MTYPE_TC_QDISC, old);
+ zebra_tc_qdisc_free(old);
}
} else {
new = hash_get(zrouter.qdisc_hash, qdisc,
return new;
}
+void zebra_tc_class_free(struct zebra_tc_class *class)
+{
+ XFREE(MTYPE_TC_CLASS, class);
+}
+
static struct zebra_tc_class *tc_class_free(struct zebra_tc_class *hash_data,
bool free_data)
{
hash_release(zrouter.class_hash, hash_data);
if (free_data) {
- XFREE(MTYPE_TC_CLASS, hash_data);
+ zebra_tc_class_free(hash_data);
return NULL;
}
return true;
}
+void zebra_tc_filter_free(struct zebra_tc_filter *filter)
+{
+ XFREE(MTYPE_TC_FILTER, filter);
+}
+
static struct zebra_tc_filter *tc_filter_free(struct zebra_tc_filter *hash_data,
bool free_data)
{
hash_release(zrouter.filter_hash, hash_data);
if (free_data) {
- XFREE(MTYPE_TC_FILTER, hash_data);
+ zebra_tc_filter_free(hash_data);
return NULL;
}
bool zebra_tc_qdisc_hash_equal(const void *arg1, const void *arg2);
void zebra_tc_qdisc_install(struct zebra_tc_qdisc *qdisc);
void zebra_tc_qdisc_uninstall(struct zebra_tc_qdisc *qdisc);
+void zebra_tc_qdisc_free(struct zebra_tc_qdisc *qdisc);
uint32_t zebra_tc_class_hash_key(const void *arg);
bool zebra_tc_class_hash_equal(const void *arg1, const void *arg2);
void zebra_tc_class_add(struct zebra_tc_class *class);
void zebra_tc_class_delete(struct zebra_tc_class *class);
+void zebra_tc_class_free(struct zebra_tc_class *class);
const char *tc_filter_kind2str(uint32_t type);
enum tc_qdisc_kind tc_filter_str2kind(const char *type);
void zebra_tc_filter_add(struct zebra_tc_filter *filter);
void zebra_tc_filter_delete(struct zebra_tc_filter *filter);
+void zebra_tc_filter_free(struct zebra_tc_filter *filter);
void zebra_tc_filters_free(void *arg);
uint32_t zebra_tc_filter_hash_key(const void *arg);