diff options
author | Harald Welte <laforge@netfilter.org> | 2009-10-19 22:11:11 +0200 |
---|---|---|
committer | Harald Welte <laforge@netfilter.org> | 2009-10-19 22:11:11 +0200 |
commit | 746d6091d921b066f000debb2f0a844e1c5c258c (patch) | |
tree | 7ddeae249866794ab851617b59426b7e87fdc58c /openbsc/src/abis_nm.c | |
parent | d004a6462a839372554021108c3ae77343f6c1d0 (diff) |
[abis_nm] introduce and use abis_nm_ipaccess_rsl_connect()
Diffstat (limited to 'openbsc/src/abis_nm.c')
-rwxr-xr-x | openbsc/src/abis_nm.c | 30 |
1 files changed, 29 insertions, 1 deletions
diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c index ff122dc8d..58dd2b86d 100755 --- a/openbsc/src/abis_nm.c +++ b/openbsc/src/abis_nm.c @@ -2479,7 +2479,7 @@ static int abis_nm_rx_ipacc(struct msgb *msg) foh->obj_inst.bts_nr, foh->obj_inst.trx_nr, foh->obj_inst.ts_nr); - DEBUGP(DNM, "IPACCESS(0x%02x): ", foh->msg_type); + DEBUGPC(DNM, "IPACCESS(0x%02x): ", foh->msg_type); switch (foh->msg_type) { case NM_MT_IPACC_RSL_CONNECT_ACK: @@ -2602,6 +2602,34 @@ int abis_nm_ipaccess_set_nvattr(struct gsm_bts *bts, u_int8_t *attr, attr_len); } +int abis_nm_ipaccess_rsl_connect(struct gsm_bts_trx *trx, + u_int32_t ip, u_int16_t port, u_int8_t stream) +{ + struct in_addr ia; + u_int8_t attr[] = { NM_ATT_IPACC_STREAM_ID, 0, + NM_ATT_IPACC_DST_IP_PORT, 0, 0, + NM_ATT_IPACC_DST_IP, 0, 0, 0, 0 }; + + int attr_len = sizeof(attr); + + ia.s_addr = htonl(ip); + attr[1] = stream; + attr[3] = port >> 8; + attr[4] = port & 0xff; + *(u_int32_t *)(attr+6) = ia.s_addr; + + /* if ip == 0, we use the default IP */ + if (ip == 0) + attr_len -= 5; + + DEBUGP(DNM, "ip.access RSL CONNECT IP=%s PORT=%u STREAM=0x%02x\n", + inet_ntoa(ia), htons(port), stream); + + return abis_nm_ipaccess_msg(trx->bts, NM_MT_IPACC_RSL_CONNECT, + NM_OC_BASEB_TRANSC, trx->bts->bts_nr, + trx->nr, 0xff, attr, attr_len); +} + /* restart / reboot an ip.access nanoBTS */ int abis_nm_ipaccess_restart(struct gsm_bts *bts) { |