pespin has uploaded this change for review. ( https://gerrit.osmocom.org/c/osmo-bsc/+/29375 )
Change subject: ipaccess-config: Exit program with error if OML link is dropped ......................................................................
ipaccess-config: Exit program with error if OML link is dropped
Change-Id: Ic96635f618f2efbe29ca6c59eedd1dc1f90c1a1d --- M src/ipaccess/ipaccess-config.c 1 file changed, 27 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-bsc refs/changes/75/29375/1
diff --git a/src/ipaccess/ipaccess-config.c b/src/ipaccess/ipaccess-config.c index d1fbed7..a22d311 100644 --- a/src/ipaccess/ipaccess-config.c +++ b/src/ipaccess/ipaccess-config.c @@ -403,6 +403,32 @@ return 0; }
+/* Callback function to be called every time we receive a signal from INPUT */ +static int inp_sig_cb(unsigned int subsys, unsigned int signal, + void *handler_data, void *signal_data) +{ + struct input_signal_data *isd = signal_data; + + if (subsys != SS_L_INPUT) + return -EINVAL; + + fprintf(stderr, "%s(): Input signal '%s' received\n", __func__, + get_value_string(e1inp_signal_names, signal)); + + switch (signal) { + case S_L_INP_TEI_UP: + break; + case S_L_INP_TEI_DN: + fprintf(stderr, "Lost E1 %s link\n", e1inp_signtype_name(isd->link_type)); + exit(1); + break; + default: + break; + } + + return 0; +} + /* callback function passed to the ABIS OML code */ static int percent; static int percent_old; @@ -1168,6 +1194,7 @@ bts->oml_tei = stream_id;
osmo_signal_register_handler(SS_NM, nm_sig_cb, NULL); + osmo_signal_register_handler(SS_L_INPUT, inp_sig_cb, NULL); osmo_signal_register_handler(SS_IPAC_NWL, nwl_sig_cb, NULL);
ipac_nwl_init();