From 2c9168cf34d370b4ea2b21177402d01a7cfffea8 Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Thu, 10 Oct 2013 20:21:33 +0200 Subject: 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. --- include/osmocom/core/signal.h | 1 + include/osmocom/vty/vty.h | 14 ++++++++++++++ 2 files changed, 15 insertions(+) (limited to 'include') diff --git a/include/osmocom/core/signal.h b/include/osmocom/core/signal.h index b3a5aaee..19a2688f 100644 --- a/include/osmocom/core/signal.h +++ b/include/osmocom/core/signal.h @@ -19,6 +19,7 @@ enum { SS_L_GLOBAL = OSMO_SIGNAL_SS_RESERVED, SS_L_INPUT, SS_L_NS, + SS_L_VTY, }; /* application-defined signal types. */ diff --git a/include/osmocom/vty/vty.h b/include/osmocom/vty/vty.h index e656abf6..ea987bf3 100644 --- a/include/osmocom/vty/vty.h +++ b/include/osmocom/vty/vty.h @@ -190,6 +190,20 @@ extern void *tall_vty_ctx; 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 -- cgit v1.2.3