aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-06-26 15:13:19 +0200
committerlaforge <laforge@osmocom.org>2020-06-26 16:07:15 +0000
commit2d3465fd1c0c2d59a852d2203b87d575e8cf9b0c (patch)
treeec514cd14d9053481521c1e76118016f3a3b75e9
parent4247c94abf533d743a0c5c8831862ff24e61ca15 (diff)
gprs_bssgp: Add bssgp_tx_bvc_reset2()
If a BVC-RESET is sent from SGSN, there must not be a cell ID IE included. See "Note 1" of TS 48.018 Section 10.4.12. Change-Id: I11d4e70d510265b9c09dffccdab10b3f0816715a
-rw-r--r--TODO-RELEASE1
-rw-r--r--include/osmocom/gprs/gprs_bssgp_bss.h1
-rw-r--r--src/gb/gprs_bssgp_bss.c8
-rw-r--r--src/gb/libosmogb.map1
4 files changed, 9 insertions, 2 deletions
diff --git a/TODO-RELEASE b/TODO-RELEASE
index 8aa23673..e2fd8306 100644
--- a/TODO-RELEASE
+++ b/TODO-RELEASE
@@ -14,3 +14,4 @@ gsm new API new osmo_bts_unset_feature()
gb API/ABI change deprecate gprs_nsvc_crate(); export gprs_nsvc_create2()
gsm API/ABI change add new member to lapd_datalink
gsm new API new gsm0808_create_common_id()
+gb new API new bssgp_tx_bvc_reset2()
diff --git a/include/osmocom/gprs/gprs_bssgp_bss.h b/include/osmocom/gprs/gprs_bssgp_bss.h
index f07ab526..ab62b669 100644
--- a/include/osmocom/gprs/gprs_bssgp_bss.h
+++ b/include/osmocom/gprs/gprs_bssgp_bss.h
@@ -57,6 +57,7 @@ int bssgp_tx_bvc_block(struct bssgp_bvc_ctx *bctx, uint8_t cause);
int bssgp_tx_bvc_unblock(struct bssgp_bvc_ctx *bctx);
int bssgp_tx_bvc_reset(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause);
+int bssgp_tx_bvc_reset2(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause, bool add_cell_id);
int bssgp_tx_ul_ud(struct bssgp_bvc_ctx *bctx, uint32_t tlli,
const uint8_t *qos_profile, struct msgb *llc_pdu);
diff --git a/src/gb/gprs_bssgp_bss.c b/src/gb/gprs_bssgp_bss.c
index 5c9d11cc..5a1ffb92 100644
--- a/src/gb/gprs_bssgp_bss.c
+++ b/src/gb/gprs_bssgp_bss.c
@@ -290,7 +290,7 @@ int bssgp_tx_bvc_unblock(struct bssgp_bvc_ctx *bctx)
}
/*! Transmit a BVC-RESET message (Chapter 10.4.12) */
-int bssgp_tx_bvc_reset(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause)
+int bssgp_tx_bvc_reset2(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause, bool add_cell_id)
{
struct msgb *msg = bssgp_msgb_alloc();
struct bssgp_normal_hdr *bgph =
@@ -306,7 +306,7 @@ int bssgp_tx_bvc_reset(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause)
msgb_tvlv_put(msg, BSSGP_IE_BVCI, 2, (uint8_t *) &_bvci);
msgb_tvlv_put(msg, BSSGP_IE_CAUSE, 1, &cause);
- if (bvci != BVCI_PTM) {
+ if (add_cell_id) {
uint8_t bssgp_cid[8];
bssgp_create_cell_id(bssgp_cid, &bctx->ra_id, bctx->cell_id);
msgb_tvlv_put(msg, BSSGP_IE_CELL_ID, sizeof(bssgp_cid), bssgp_cid);
@@ -315,6 +315,10 @@ int bssgp_tx_bvc_reset(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause)
return gprs_ns_sendmsg(bssgp_nsi, msg);
}
+int bssgp_tx_bvc_reset(struct bssgp_bvc_ctx *bctx, uint16_t bvci, uint8_t cause)
+{
+ return bssgp_tx_bvc_reset2(bctx, bvci, cause, bvci != BVCI_PTM);
+}
/*! Transmit a FLOW_CONTROL-BVC (Chapter 10.4.4)
* \param[in] bctx BVC Context
diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map
index b29ecb97..7a231db5 100644
--- a/src/gb/libosmogb.map
+++ b/src/gb/libosmogb.map
@@ -15,6 +15,7 @@ bssgp_msgb_ra_put;
bssgp_parse_cell_id;
bssgp_tx_bvc_block;
bssgp_tx_bvc_reset;
+bssgp_tx_bvc_reset2;
bssgp_tx_bvc_unblock;
bssgp_tx_fc_bvc;
bssgp_tx_fc_ms;