diff options
author | Harald Welte <laforge@gnumonks.org> | 2009-02-17 14:35:45 +0000 |
---|---|---|
committer | Harald Welte <laforge@gnumonks.org> | 2009-02-17 14:35:45 +0000 |
commit | 167df88aaec83055d585a2aff8b88aaed1be1c0c (patch) | |
tree | 10f3419f1bd0bf3e9fecfc475ff11a979b7fdff9 /src/abis_rsl.c | |
parent | 4b45815b9daed29ac27965d0eec76238dc2258b3 (diff) |
* increased debug verbosity for ip.access BIDND_ACK processing
* emit a signel when the BIND is acknowledged
Diffstat (limited to 'src/abis_rsl.c')
-rw-r--r-- | src/abis_rsl.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/src/abis_rsl.c b/src/abis_rsl.c index 034fbb53c..7061604ed 100644 --- a/src/abis_rsl.c +++ b/src/abis_rsl.c @@ -26,6 +26,7 @@ #include <errno.h> #include <sys/types.h> #include <netinet/in.h> +#include <arpa/inet.h> #include <openbsc/gsm_data.h> #include <openbsc/gsm_04_08.h> @@ -34,6 +35,7 @@ #include <openbsc/debug.h> #include <openbsc/tlv.h> #include <openbsc/paging.h> +#include <openbsc/signal.h> #define RSL_ALLOC_SIZE 1024 #define RSL_ALLOC_HEADROOM 128 @@ -923,7 +925,7 @@ static int abis_rsl_rx_ipacc_bindack(struct msgb *msg) struct abis_rsl_dchan_hdr *dh = msgb_l2(msg); struct tlv_parsed tv; struct gsm_bts_trx_ts *ts = msg->lchan->ts; - u_int32_t ip; + struct in_addr ip; u_int16_t port, attr_f8; /* the BTS has acknowledged a local bind, it now tells us the IP @@ -938,16 +940,22 @@ static int abis_rsl_rx_ipacc_bindack(struct msgb *msg) DEBUGP(DRSL, "mandatory IE missing\n"); return -EINVAL; } - ip = *((u_int32_t *) TLVP_VAL(&tv, RSL_IE_IPAC_LOCAL_IP)); + ip.s_addr = *((u_int32_t *) TLVP_VAL(&tv, RSL_IE_IPAC_LOCAL_IP)); port = *((u_int16_t *) TLVP_VAL(&tv, RSL_IE_IPAC_LOCAL_PORT)); attr_f8 = *((u_int16_t *) TLVP_VAL(&tv, 0xf8)); + DEBUGP(DRSL, "IPAC_BIND_ACK chan_nr=0x%02x IP=%s PORT=%d FC=%d F8=%d\n", + dh->chan_nr, inet_ntoa(ip), ntohs(port), *TLVP_VAL(&tv, 0xfc), + ntohs(attr_f8)); + /* update our local information about this TS */ - ts->abis_ip.bound_ip = ntohl(ip); - ts->abis_ip.bound_port = ntohl(port); + ts->abis_ip.bound_ip = ntohl(ip.s_addr); + ts->abis_ip.bound_port = ntohs(port); ts->abis_ip.attr_f8 = ntohs(attr_f8); ts->abis_ip.attr_fc = *TLVP_VAL(&tv, 0xfc); + dispatch_signal(SS_ABISIP, S_ABISIP_BIND_ACK, msg->lchan); + return 0; } @@ -976,7 +984,6 @@ static int abis_rsl_rx_ipacc(struct msgb *msg) switch (rllh->c.msg_type) { case RSL_MT_IPAC_BIND_ACK: - DEBUGP(DRSL, "IPAC_BIND_ACK\n"); rc = abis_rsl_rx_ipacc_bindack(msg); break; case RSL_MT_IPAC_BIND_NACK: |