From 70c7d4160dfb9b710e4bf93d3d6265dce8b0392f Mon Sep 17 00:00:00 2001 From: Max Date: Fri, 24 Feb 2017 13:59:14 +0100 Subject: Use value_string for ctrl_type Use value_string for enum ctrl_type instead of custom code. Add corresponding unit tests. Related: OS#1615 Change-Id: Icd4e96dd9f00876cb70b43cfcf42ab4f10311b28 --- include/osmocom/ctrl/control_cmd.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'include') diff --git a/include/osmocom/ctrl/control_cmd.h b/include/osmocom/ctrl/control_cmd.h index a63557d7..d82c9af1 100644 --- a/include/osmocom/ctrl/control_cmd.h +++ b/include/osmocom/ctrl/control_cmd.h @@ -4,7 +4,7 @@ #include #include #include - +#include #include #define CTRL_CMD_ERROR -1 @@ -22,7 +22,7 @@ enum ctrl_node_type { }; enum ctrl_type { - CTRL_TYPE_UNKNOWN, + CTRL_TYPE_UNKNOWN = 0, CTRL_TYPE_GET, CTRL_TYPE_SET, CTRL_TYPE_GET_REPLY, @@ -31,6 +31,8 @@ enum ctrl_type { CTRL_TYPE_ERROR }; +extern const struct value_string ctrl_type_vals[]; + struct ctrl_connection { struct llist_head list_entry; -- cgit v1.2.3