summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorMax <msuraev@sysmocom.de>2017-02-24 13:59:14 +0100
committerMax <msuraev@sysmocom.de>2017-03-01 16:37:59 +0000
commit70c7d4160dfb9b710e4bf93d3d6265dce8b0392f (patch)
treec2791ce6eeb6dafa55f79d851e2f21cb0bd4358e /include
parent9756c4691d576c5bfe175245a82d00b2d03ed70e (diff)
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
Diffstat (limited to 'include')
-rw-r--r--include/osmocom/ctrl/control_cmd.h6
1 files changed, 4 insertions, 2 deletions
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 <osmocom/core/talloc.h>
#include <osmocom/core/write_queue.h>
#include <osmocom/core/logging.h>
-
+#include <osmocom/core/utils.h>
#include <osmocom/vty/vector.h>
#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;