ipacess-config: Handle NVATTR NACKs in ipaccess-config
Currently we send the attribute changes in a send and forget fashion. But sometimes the nanoBTS is sending us a NACK, e.g with a invalid unit id. Start handling the NACK and provide an error message to the user. The error message is not yet describing the cause of the error but this is a slight progress to the previous silent failure.
This commit is contained in:
parent
d5651d5ced
commit
a7cd9fc0d1
|
@ -55,6 +55,7 @@ enum signal_nm {
|
|||
S_NM_SW_ACTIV_REP, /* GSM 12.21 software activated report */
|
||||
S_NM_FAIL_REP, /* GSM 12.21 failure event report */
|
||||
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 */
|
||||
};
|
||||
|
||||
/* SS_LCHAN signals */
|
||||
|
|
|
@ -2309,6 +2309,18 @@ static int abis_nm_rx_ipacc(struct msgb *msg)
|
|||
DEBUGPC(DNM, "unknown\n");
|
||||
break;
|
||||
}
|
||||
|
||||
/* signal handling */
|
||||
switch (foh->msg_type) {
|
||||
case NM_MT_IPACC_RSL_CONNECT_NACK:
|
||||
case NM_MT_IPACC_SET_NVATTR_NACK:
|
||||
case NM_MT_IPACC_GET_NVATTR_NACK:
|
||||
dispatch_signal(SS_NM, S_NM_IPACC_NACK, (void*) ((long)foh->msg_type));
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -37,6 +37,7 @@
|
|||
#include <openbsc/gsm_data.h>
|
||||
#include <openbsc/e1_input.h>
|
||||
#include <openbsc/abis_nm.h>
|
||||
#include <openbsc/signal.h>
|
||||
|
||||
static struct gsm_network *gsmnet;
|
||||
|
||||
|
@ -51,6 +52,33 @@ static u_int8_t prim_oml_attr[] = { 0x95, 0x00, 7, 0x88, 192, 168, 100, 11, 0x00
|
|||
static u_int8_t unit_id_attr[] = { 0x91, 0x00, 9, '2', '3', '4', '2', '/' , '0', '/', '0', 0x00 };
|
||||
*/
|
||||
|
||||
/*
|
||||
* Callback function for NACK on the OML NM
|
||||
*
|
||||
* Currently we send the config requests but don't check the
|
||||
* result. The nanoBTS will send us a NACK when we did something the
|
||||
* BTS didn't like.
|
||||
*/
|
||||
static int ipacc_msg_nack(int mt)
|
||||
{
|
||||
fprintf(stderr, "Failure to set attribute. This seems fatal\n");
|
||||
exit(-1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static int nm_sig_cb(unsigned int subsys, unsigned int signal,
|
||||
void *handler_data, void *signal_data)
|
||||
{
|
||||
switch (signal) {
|
||||
case S_NM_IPACC_NACK:
|
||||
return ipacc_msg_nack((int)signal_data);
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void bootstrap_om(struct gsm_bts *bts)
|
||||
{
|
||||
int len;
|
||||
|
@ -223,6 +251,7 @@ int main(int argc, char **argv)
|
|||
bts = gsm_bts_alloc(gsmnet, GSM_BTS_TYPE_NANOBTS_900, HARDCODED_TSC,
|
||||
HARDCODED_BSIC);
|
||||
|
||||
register_signal_handler(SS_NM, nm_sig_cb, NULL);
|
||||
printf("Trying to connect to ip.access BTS ...\n");
|
||||
|
||||
memset(&sin, 0, sizeof(sin));
|
||||
|
|
Loading…
Reference in New Issue