diff options
author | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-12-30 09:00:01 +0100 |
---|---|---|
committer | Holger Hans Peter Freyther <zecke@selfish.org> | 2009-12-30 09:00:01 +0100 |
commit | 1356c08cc8f22b4b75a845ebd96651577c984744 (patch) | |
tree | ab21be85e781d3e03eabcb069bfde7ae2df731b7 | |
parent | 2e83782b1c185bd63544bdd74de2e5e4d965f981 (diff) |
[abis] Dispatch a IPAC restart ACK/NACK signal
* Add the NACK version to the list
* Dispatch the signal when we receive the message
* Handle it in ipaccess-config by exiting the application
-rw-r--r-- | openbsc/include/openbsc/abis_nm.h | 1 | ||||
-rw-r--r-- | openbsc/include/openbsc/signal.h | 2 | ||||
-rw-r--r-- | openbsc/src/abis_nm.c | 6 | ||||
-rw-r--r-- | openbsc/src/ipaccess/ipaccess-config.c | 8 |
4 files changed, 17 insertions, 0 deletions
diff --git a/openbsc/include/openbsc/abis_nm.h b/openbsc/include/openbsc/abis_nm.h index c237613c8..a122342f2 100644 --- a/openbsc/include/openbsc/abis_nm.h +++ b/openbsc/include/openbsc/abis_nm.h @@ -211,6 +211,7 @@ enum abis_nm_msgtype_bs11 { enum abis_nm_msgtype_ipacc { NM_MT_IPACC_RESTART = 0x87, NM_MT_IPACC_RESTART_ACK, + NM_MT_IPACC_RESTART_NACK, NM_MT_IPACC_RSL_CONNECT = 0xe0, NM_MT_IPACC_RSL_CONNECT_ACK, NM_MT_IPACC_RSL_CONNECT_NACK, diff --git a/openbsc/include/openbsc/signal.h b/openbsc/include/openbsc/signal.h index 8b6b4a628..23551f743 100644 --- a/openbsc/include/openbsc/signal.h +++ b/openbsc/include/openbsc/signal.h @@ -70,6 +70,8 @@ enum signal_nm { S_NM_NACK, /* GSM 12.21 various NM_MT_*_NACK happened */ S_NM_IPACC_NACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_NACK happened */ S_NM_IPACC_ACK, /* GSM 12.21 nanoBTS extensions NM_MT_IPACC_*_*_ACK happened */ + S_NM_IPACC_RESTART_ACK, /* nanoBTS has send a restart ack */ + S_NM_IPACC_RESTART_NACK,/* nanoBTS has send a restart ack */ S_NM_TEST_REP, /* GSM 12.21 Test Report */ }; diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c index 8a9670477..bb2455d37 100644 --- a/openbsc/src/abis_nm.c +++ b/openbsc/src/abis_nm.c @@ -1070,6 +1070,12 @@ static int abis_nm_rcvmsg_fom(struct msgb *mb) case NM_MT_CONN_MDROP_LINK_ACK: DEBUGP(DNM, "CONN MDROP LINK ACK\n"); break; + case NM_MT_IPACC_RESTART_ACK: + dispatch_signal(SS_NM, S_NM_IPACC_RESTART_ACK, NULL); + break; + case NM_MT_IPACC_RESTART_NACK: + dispatch_signal(SS_NM, S_NM_IPACC_RESTART_NACK, NULL); + break; } return 0; diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index 29b9a9bf7..432179eb5 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -202,6 +202,14 @@ static int nm_sig_cb(unsigned int subsys, unsigned int signal, return ipacc_msg_ack(ipacc_data->msg_type, ipacc_data->bts); case S_NM_TEST_REP: return test_rep(signal_data); + case S_NM_IPACC_RESTART_ACK: + printf("The BTS has acked the restart. Exiting.\n"); + exit(0); + break; + case S_NM_IPACC_RESTART_NACK: + printf("The BTS has nacked the restart. Exiting.\n"); + exit(0); + break; default: break; } |