diff --git a/include/osmocom/gprs/gprs_bssgp_rim.h b/include/osmocom/gprs/gprs_bssgp_rim.h index 5f397c98a..4c0a57b4a 100644 --- a/include/osmocom/gprs/gprs_bssgp_rim.h +++ b/include/osmocom/gprs/gprs_bssgp_rim.h @@ -270,3 +270,4 @@ int bssgp_parse_rim_pdu(struct bssgp_ran_information_pdu *pdu, const struct msgb struct msgb *bssgp_encode_rim_pdu(const struct bssgp_ran_information_pdu *pdu); int bssgp_tx_rim(const struct bssgp_ran_information_pdu *pdu, uint16_t nsei); +int bssgp_tx_rim_encoded(struct msgb *msg, uint16_t nsei); diff --git a/src/gb/gprs_bssgp_rim.c b/src/gb/gprs_bssgp_rim.c index 55609edba..d7b19e7f9 100644 --- a/src/gb/gprs_bssgp_rim.c +++ b/src/gb/gprs_bssgp_rim.c @@ -1179,6 +1179,25 @@ int bssgp_tx_rim(const struct bssgp_ran_information_pdu *pdu, uint16_t nsei) return bssgp_ns_send(bssgp_ns_send_data, msg); } +/*! Send encoded RAN TRANSPARENT CONTAINER via BSSGP (3GPP TS 29.060, section 7.7.43). + * \param[in] msg user provided memory for the encoded RAN TRANSPARENT CONTAINER to be sent. + * (this function will take ownership of msg). + * \param[in] nsei BSSGP network service entity identifier (NSEI). + * \returns 0 on sccess, -EINVAL on error. */ +int bssgp_tx_rim_encoded(struct msgb *msg, uint16_t nsei) +{ + struct bssgp_normal_hdr *bgph; + + msgb_nsei(msg) = nsei; + msgb_bvci(msg) = 0; /* Signalling */ + + bgph = (struct bssgp_normal_hdr *)msgb_bssgph(msg); + DEBUGP(DLBSSGP, "BSSGP BVCI=0 NSEI=%u Tx RIM-PDU:%s\n", + nsei, bssgp_pdu_str(bgph->pdu_type)); + + return bssgp_ns_send(bssgp_ns_send_data, msg); +} + /* For internal use only (called from gprs_bssgp.c) */ int bssgp_rx_rim(struct msgb *msg, struct tlv_parsed *tp, uint16_t bvci) { diff --git a/src/gb/libosmogb.map b/src/gb/libosmogb.map index e02273d91..7dc427b74 100644 --- a/src/gb/libosmogb.map +++ b/src/gb/libosmogb.map @@ -56,6 +56,7 @@ bssgp_tx_resume; bssgp_tx_resume_ack; bssgp_tx_resume_nack; bssgp_tx_rim; +bssgp_tx_rim_encoded; bssgp_tx_simple_bvci; bssgp_tx_status; bssgp_tx_suspend;