modules/domain/mi.c
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #include "../../dprint.h"
00031 #include "../../db/db.h"
00032 #include "domain_mod.h"
00033 #include "domain.h"
00034 #include "hash.h"
00035 #include "mi.h"
00036
00037
00038
00039
00040
00041 struct mi_root* mi_domain_reload(struct mi_root *cmd_tree, void *param)
00042 {
00043 if(db_mode==0)
00044 return init_mi_tree( 500, "command not activated", 21);
00045
00046 if (reload_domain_table () == 1) {
00047 return init_mi_tree( 200, MI_OK_S, MI_OK_LEN);
00048 } else {
00049 return init_mi_tree( 500, "Domain table reload failed", 26);
00050 }
00051 }
00052
00053
00054
00055
00056
00057 struct mi_root* mi_domain_dump(struct mi_root *cmd_tree, void *param)
00058 {
00059 struct mi_root* rpl_tree;
00060
00061 if(db_mode==0)
00062 return init_mi_tree( 500, "command not activated", 21);
00063
00064 rpl_tree = init_mi_tree( 200, MI_OK_S, MI_OK_LEN);
00065 if (rpl_tree==NULL)
00066 return 0;
00067
00068 if(hash_table_mi_print(*hash_table, &rpl_tree->node)< 0)
00069 {
00070 LM_ERR("Error while adding node\n");
00071 free_mi_tree(rpl_tree);
00072 return 0;
00073 }
00074
00075 return rpl_tree;
00076 }