pmc: support getting the current data set.

Signed-off-by: Richard Cochran <richardcochran@gmail.com>
master
Richard Cochran 2012-08-22 07:18:59 +02:00
parent 4240203655
commit b2e8555ffd
1 changed files with 10 additions and 1 deletions

11
pmc.c
View File

@ -43,6 +43,7 @@ static struct PortIdentity port_identity;
static struct transport *transport; static struct transport *transport;
static struct fdarray fdarray; static struct fdarray fdarray;
static void do_get_action(int action, int index);
static void not_supported(int action, int index); static void not_supported(int action, int index);
static void null_management(int action, int index); static void null_management(int action, int index);
@ -61,7 +62,7 @@ struct management_id idtab[] = {
{ "FAULT_LOG", FAULT_LOG, not_supported }, { "FAULT_LOG", FAULT_LOG, not_supported },
{ "FAULT_LOG_RESET", FAULT_LOG_RESET, not_supported }, { "FAULT_LOG_RESET", FAULT_LOG_RESET, not_supported },
{ "DEFAULT_DATA_SET", DEFAULT_DATA_SET, not_supported }, { "DEFAULT_DATA_SET", DEFAULT_DATA_SET, not_supported },
{ "CURRENT_DATA_SET", CURRENT_DATA_SET, not_supported }, { "CURRENT_DATA_SET", CURRENT_DATA_SET, do_get_action },
{ "PARENT_DATA_SET", PARENT_DATA_SET, not_supported }, { "PARENT_DATA_SET", PARENT_DATA_SET, not_supported },
{ "TIME_PROPERTIES_DATA_SET", TIME_PROPERTIES_DATA_SET, not_supported }, { "TIME_PROPERTIES_DATA_SET", TIME_PROPERTIES_DATA_SET, not_supported },
{ "PRIORITY1", PRIORITY1, not_supported }, { "PRIORITY1", PRIORITY1, not_supported },
@ -208,6 +209,14 @@ static void get_action(int id)
msg_put(msg); msg_put(msg);
} }
static void do_get_action(int action, int index)
{
if (action == GET)
get_action(idtab[index].code);
else
fprintf(stderr, "%s only allows GET\n", idtab[index].name);
}
static void not_supported(int action, int index) static void not_supported(int action, int index)
{ {
fprintf(stdout, "sorry, %s not supported yet\n", idtab[index].name); fprintf(stdout, "sorry, %s not supported yet\n", idtab[index].name);