}
static void
+_cb_protocol_rule(const Eldbus_Message *msg)
+{
+ const char *name = NULL, *text = NULL;
+ Eina_Bool res;
+ const char *reply;
+
+ res = eldbus_message_error_get(msg, &name, &text);
+ EINA_SAFETY_ON_TRUE_GOTO(res, finish);
+
+ res = eldbus_message_arguments_get(msg, "s", &reply);
+ EINA_SAFETY_ON_FALSE_GOTO(res, finish);
+ printf("%s\n", reply);
+
+finish:
+ if ((name) || (text ))
+ {
+ printf("errname:%s errmsg:%s\n", name, text);
+ }
+}
+
+static void
_e_info_client_proc_protocol_rule(int argc, char **argv)
{
char *new_argv[3];
return;
}
- if (!_e_info_client_eldbus_message_with_args("protocol_rule", NULL, "sss", new_argv[0], new_argv[1], new_argv[2]))
+ if (!_e_info_client_eldbus_message_with_args("protocol_rule", _cb_protocol_rule, "sss", new_argv[0], new_argv[1], new_argv[2]))
return;
}
E_Info_Reply_Buffer buffer = {&reply, len};
int i;
- REPLY(" ---------------- Protocol Filter Rules ----------------\n");
+ REPLY(" --------------------------[ Protocol Filter Rules ]--------------------------\n");
+ REPLY(" No Policy Rule\n");
+ REPLY(" -----------------------------------------------------------------------------\n");
for (i = 0; i < rc->count; i++)
{
- REPLY(" [Rule %d] [%s] \"", i, rc->rules[i].policy == E_INFO_POLICY_TYPE_ALLOW ? "ALLOW" : "DENY");
+ REPLY(" %3d %10s \"", i, rc->rules[i].policy == E_INFO_POLICY_TYPE_ALLOW ? "ALLOW" : "DENY");
_e_info_bintree_inorder_traverse(rc->rules[i].tree, _rule_print_func, (void*)&buffer);
REPLY("\"\n");
}
return EINA_FALSE;
}
- REPLY("The rule was successfully added.\n\n");
+ REPLY("The rule was successfully added.\n");
_e_info_rulechecker_rule_print(rc, reply, len);
return EINA_TRUE;
argc = 1;
e_info_protocol_rule_set(argc, (const char**)&(argv[0]), reply, &len);
- INF("\n%s", reply);
+
+ eldbus_message_arguments_append(reply_msg, "s", reply);
return reply_msg;
}
{ "get_res_lists", ELDBUS_ARGS({VALUE_TYPE_REQUEST_RESLIST, "client resource"}), ELDBUS_ARGS({"a("VALUE_TYPE_REPLY_RESLIST")", "array of client resources"}), _e_info_server_cb_res_lists_get, 0 },
{ "get_input_devices", NULL, ELDBUS_ARGS({"a("VALUE_TYPE_FOR_INPUTDEV")", "array of input"}), _e_info_server_cb_input_device_info_get, 0},
{ "protocol_trace", ELDBUS_ARGS({"s", "protocol_trace"}), NULL, _e_info_server_cb_protocol_trace, 0},
- { "protocol_rule", ELDBUS_ARGS({"sss", "protocol_rule"}), NULL, _e_info_server_cb_protocol_rule, 0},
+ { "protocol_rule", ELDBUS_ARGS({"sss", "protocol_rule"}), ELDBUS_ARGS({"s", "rule request"}), _e_info_server_cb_protocol_rule, 0},
{ "get_fps_info", NULL, ELDBUS_ARGS({"s", "fps request"}), _e_info_server_cb_fps_info_get, 0},
{ "transform_message", ELDBUS_ARGS({"siiiiiiii", "transform_message"}), NULL, e_info_server_cb_transform_message, 0},
{ "dump_buffers", ELDBUS_ARGS({"i", "start"}), NULL, _e_info_server_cb_buffer_dump, 0 },