/*! \brief * MI function to print trusted entries from current hash table */ struct mi_root* mi_trusted_dump(struct mi_root *cmd_tree, void *param) { struct mi_root* rpl_tree; if (hash_table==NULL) return init_mi_tree( 500, MI_SSTR("Trusted-module not in use")); rpl_tree = init_mi_tree( 200, MI_SSTR(MI_OK)); if (rpl_tree==NULL) return 0; if(hash_table_mi_print(*hash_table, &rpl_tree->node)< 0) { LM_ERR("failed to add a node\n"); free_mi_tree(rpl_tree); return 0; } return rpl_tree; }
/* * MI function to print domains from current hash table */ struct mi_root* mi_domain_dump(struct mi_root *cmd_tree, void *param) { struct mi_root* rpl_tree; if(db_mode==0) return init_mi_tree( 500, "command not activated", 21); rpl_tree = init_mi_tree( 200, MI_OK_S, MI_OK_LEN); if (rpl_tree==NULL) return 0; if(hash_table_mi_print(*hash_table, &rpl_tree->node)< 0) { LM_ERR("Error while adding node\n"); free_mi_tree(rpl_tree); return 0; } return rpl_tree; }