diff options
author | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-08 23:25:31 +0200 |
---|---|---|
committer | Neels Hofmeyr <nhofmeyr@sysmocom.de> | 2016-05-09 00:26:01 +0200 |
commit | 6950d14c5bf301fbb3061f5a4fe67f5f57b76040 (patch) | |
tree | 1ae01412e3f15a6a7358ea5ad2a63cd6862a45f8 /openbsc/src/gprs/oap_messages.c | |
parent | cf2ca648e9f8b9ed753b4ffb588305b0a3430208 (diff) | |
parent | cd5e52605cdb77bdc6f36fce81a6a1bac7fbda48 (diff) |
Merge branch 'master' into sysmocom/iu, with tweakssysmocom/iu_orig_history
Numerous manual adjustments are included to make sense on the sysmocom/iu branch:
* gsm_04_08_gprs.h has moved to libosmocore on the master branch, but
sysmocom/iu has added some entries. Until it is clear whether to move the
additions to libosmocore as well, keep gsm_04_08_gprs.h on sysmocom/iu with
merely the additions.
* Thus, keep using the old gsm_04_08_gprs.[hc] from openbsc in the Makefiles,
but only where the sysmocom/iu additions are needed.
* In openbsc's gsm_04_08_gprs.h,
* include the libosmocore gsm_04_08_gprs.h,
* use '#pragma once' instead of #ifndef and
* add a TODO comment about moving the rest to libosmocore.
* Apply the addition of an osmo_auth_vector to gsm_auth_tuple: in the Iu auth
vector hacks, use the gsm_auth_tuple.vec instead of a local struct.
See iu_hack__get_hardcoded_auth_tuple() and gsm48_rx_gmm_att_req().
* In the si2q tests, pass NULL as ctx to gsm_network_init().
* In cscn_main.c, add a debug log that was originally added to osmo-nitb.
* openbsc/.gitignore: keep only one addition of 'writtenconfig'
Conflicts:
openbsc/include/openbsc/gprs_sgsn.h
openbsc/include/openbsc/gsm_04_08_gprs.h
openbsc/src/gprs/gsm_04_08_gprs.c
openbsc/src/libmsc/gsm_04_08.c
openbsc/src/osmo-cscn/cscn_main.c
openbsc/tests/gsm0408/Makefile.am
Diffstat (limited to 'openbsc/src/gprs/oap_messages.c')
-rw-r--r-- | openbsc/src/gprs/oap_messages.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/openbsc/src/gprs/oap_messages.c b/openbsc/src/gprs/oap_messages.c index eb520532a..d81723fd6 100644 --- a/openbsc/src/gprs/oap_messages.c +++ b/openbsc/src/gprs/oap_messages.c @@ -20,11 +20,10 @@ * */ +#include <osmocom/core/utils.h> #include <openbsc/oap_messages.h> #include <openbsc/debug.h> -#include <openbsc/gprs_utils.h> -#include <openbsc/utils.h> #include <osmocom/gsm/tlv.h> #include <osmocom/core/msgb.h> @@ -32,8 +31,8 @@ #include <stdint.h> -int oap_decode(const uint8_t *const_data, size_t data_len, - struct oap_message *oap_msg) +int osmo_oap_decode(struct osmo_oap_message *oap_msg, + const uint8_t *const_data, size_t data_len) { int rc; uint8_t tag; @@ -48,16 +47,16 @@ int oap_decode(const uint8_t *const_data, size_t data_len, memset(oap_msg, 0, sizeof(*oap_msg)); /* message type */ - rc = gprs_shift_v_fixed(&data, &data_len, 1, &value); + rc = osmo_shift_v_fixed(&data, &data_len, 1, &value); if (rc < 0) return -GMM_CAUSE_INV_MAND_INFO; - oap_msg->message_type = decode_big_endian(value, 1); + oap_msg->message_type = osmo_decode_big_endian(value, 1); /* specific parts */ while (data_len > 0) { enum oap_iei iei; - rc = gprs_shift_tlv(&data, &data_len, &tag, &value, &value_len); + rc = osmo_shift_tlv(&data, &data_len, &tag, &value, &value_len); if (rc < 0) return -GMM_CAUSE_PROTO_ERR_UNSPEC; @@ -72,7 +71,7 @@ int oap_decode(const uint8_t *const_data, size_t data_len, return -GMM_CAUSE_PROTO_ERR_UNSPEC; } - oap_msg->client_id = decode_big_endian(value, value_len); + oap_msg->client_id = osmo_decode_big_endian(value, value_len); if (oap_msg->client_id == 0) { LOGP(DGPRS, LOGL_NOTICE, @@ -145,7 +144,7 @@ int oap_decode(const uint8_t *const_data, size_t data_len, return 0; } -void oap_encode(struct msgb *msg, const struct oap_message *oap_msg) +void osmo_oap_encode(struct msgb *msg, const struct osmo_oap_message *oap_msg) { uint8_t u8; @@ -159,7 +158,8 @@ void oap_encode(struct msgb *msg, const struct oap_message *oap_msg) if (oap_msg->client_id > 0) msgb_tlv_put(msg, OAP_CLIENT_ID_IE, sizeof(oap_msg->client_id), - encode_big_endian(oap_msg->client_id, sizeof(oap_msg->client_id))); + osmo_encode_big_endian(oap_msg->client_id, + sizeof(oap_msg->client_id))); if (oap_msg->rand_present) msgb_tlv_put(msg, OAP_RAND_IE, sizeof(oap_msg->rand), oap_msg->rand); |