summaryrefslogtreecommitdiffstats
path: root/include/osmocom
diff options
context:
space:
mode:
authorNeels Hofmeyr <nhofmeyr@sysmocom.de>2016-03-15 13:28:10 +0100
committerHolger Hans Peter Freyther <holger@moiji-mobile.com>2016-03-15 14:30:41 +0100
commitbdccc1b1444a8692697bd8a293cc89c90ef2d832 (patch)
tree3078de6f8ef1c7941ef1853b7b4447ce6969f8ce /include/osmocom
parentda7bf4d55a896034320aa4466b9644083093acd1 (diff)
gsm48: factor out MCC+MNC BCD parsing for re-use in UMTS
For 3G, I need a BCD composer/parser similar to gsm48_generate_lai()/ gsm48_decode_lai(). Those functions also handle a trivial extra member (lac) which I don't need in this way for 3G. So create new functions to take on the MCC+MNC BCD handling and call those from gsm48_generate_lai() and gsm48_decode_lai(). In this way, the 3G code in openbsc can use only the BCD functionality without code duplication.
Diffstat (limited to 'include/osmocom')
-rw-r--r--include/osmocom/gsm/gsm48.h3
1 files changed, 3 insertions, 0 deletions
diff --git a/include/osmocom/gsm/gsm48.h b/include/osmocom/gsm/gsm48.h
index 74ac52c7..d6e58c28 100644
--- a/include/osmocom/gsm/gsm48.h
+++ b/include/osmocom/gsm/gsm48.h
@@ -39,3 +39,6 @@ void gsm48_parse_ra(struct gprs_ra_id *raid, const uint8_t *buf);
int gsm48_construct_ra(uint8_t *buf, const struct gprs_ra_id *raid);
int gsm48_number_of_paging_subchannels(struct gsm48_control_channel_descr *chan_desc);
+
+void gsm48_mcc_mnc_to_bcd(uint8_t *bcd_dst, uint16_t mcc, uint16_t mnc);
+void gsm48_mcc_mnc_from_bcd(uint8_t *bcd_src, uint16_t *mcc, uint16_t *mnc);