vty: Make vty_event dispatch signals and use it in the testcase
The testcase didn't work on Ubuntu 12.04 because vty_create will
directly call vty_event (e.g. not through the plt). This means
that the approach to override vty_event in the testcase failed.
Use the signal interface of libosmocore and make the testcase
use it. The signals can be generally useful as well.
diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h
index e656abf..ea987bf 100644
--- a/include/osmocom/vty/vty.h
+++ b/include/osmocom/vty/vty.h
@@ -190,6 +190,20 @@
extern struct cmd_element cfg_description_cmd;
extern struct cmd_element cfg_no_description_cmd;
+
+/**
+ * signal handling
+ */
+enum signal_vty {
+ S_VTY_EVENT,
+};
+
+struct vty_signal_data {
+ enum event event;
+ int sock;
+ struct vty *vty;
+};
+
/*! @} */
#endif