From 61f814de3c3bdb754b50addda20456212974b12b Mon Sep 17 00:00:00 2001 From: Holger Hans Peter Freyther Date: Mon, 28 Dec 2009 12:23:02 +0100 Subject: [PATCH] [ipaccess] Handle LoadAbort coming from the BTS. * Be bale to abort the load when the BTS is rejecting the file.. --- openbsc/src/abis_nm.c | 6 ++++++ openbsc/src/ipaccess/ipaccess-config.c | 4 ++++ 2 files changed, 10 insertions(+) diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c index 8b3ac9c6..211f70ee 100644 --- a/openbsc/src/abis_nm.c +++ b/openbsc/src/abis_nm.c @@ -1568,6 +1568,12 @@ static int abis_nm_rcvmsg_sw(struct msgb *mb) rc = sw_load_end(sw); } break; + case NM_MT_LOAD_ABORT: + if (sw->cbfn) + sw->cbfn(GSM_HOOK_NM_SWLOAD, + NM_MT_LOAD_ABORT, mb, + sw->cb_data, NULL); + break; } break; case SW_STATE_WAIT_ENDACK: diff --git a/openbsc/src/ipaccess/ipaccess-config.c b/openbsc/src/ipaccess/ipaccess-config.c index c7d22343..e96b1aba 100644 --- a/openbsc/src/ipaccess/ipaccess-config.c +++ b/openbsc/src/ipaccess/ipaccess-config.c @@ -215,6 +215,10 @@ static int swload_cbfn(unsigned int hook, unsigned int event, struct msgb *msg, printf("Software Download Progress: %d%%\n", percent); percent_old = percent; break; + case NM_MT_LOAD_ABORT: + fprintf(stderr, "ERROR: Load aborted by the BTS.\n"); + exit(6); + break; } return 0; }