summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-12-28 10:04:26 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-12-28 10:04:26 +0100
commit71bc11e757c49e67ca7c5fbc25ca89ba8a1a757e (patch)
tree3521d46240ae2c0b1a505ec8c6f44264444fc31c
parent64d9ddde5d53ce69c8b469c3dc11e0c70c097d23 (diff)
[ipaccess] Implement the Load Segment messages...
-rw-r--r--openbsc/src/abis_nm.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/openbsc/src/abis_nm.c b/openbsc/src/abis_nm.c
index 2be71f5ed..64c409388 100644
--- a/openbsc/src/abis_nm.c
+++ b/openbsc/src/abis_nm.c
@@ -47,6 +47,7 @@
#define OM_ALLOC_SIZE 1024
#define OM_HEADROOM_SIZE 128
+#define IPACC_SEGMENT_SIZE 245
/* unidirectional messages from BTS to BSC */
static const enum abis_nm_msgtype reports[] = {
@@ -1295,6 +1296,21 @@ static int sw_load_segment(struct abis_nm_sw *sw)
/* we only now know the exact length for the OM hdr */
len = strlen(line_buf)+2;
break;
+ case GSM_BTS_TYPE_NANOBTS: {
+ static_assert(sizeof(seg_buf) >= IPACC_SEGMENT_SIZE, buffer_big_enough);
+ len = read(sw->fd, &seg_buf, IPACC_SEGMENT_SIZE);
+ if (len < 0) {
+ perror("read failed");
+ return -EINVAL;
+ }
+
+ if (len != IPACC_SEGMENT_SIZE)
+ sw->last_seg = 1;
+
+ msgb_tl16v_put(msg, NM_ATT_IPACC_FILE_DATA, len, (const u_int8_t *) seg_buf);
+ len += 3;
+ break;
+ }
default:
LOGP(DNM, LOGL_ERROR, "sw_load_segment needs implementation for the BTS.\n");
/* FIXME: Other BTS types */