aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_gsup_messages.c
AgeCommit message (Collapse)AuthorFilesLines
2015-11-02libcommon: soak up three static functions.Neels Hofmeyr1-29/+1
Add new kitchen sink openbsc/utils.h and libcommon/utils.c to make three so far static functions public (so I can use them in the upcoming OAP code). A place to put them could have been the gprs_utils.h, but all general functions in there have a gprs_ prefix, and todo markings to move them away. All other libcommon headers are too specific, so I opened up this kitchen sink header. Replace the implementation of encode_big_endian() with a call to osmo_store64be_ext(). See comments. Apply the change in Makefiles and C files.
2015-05-24gsup: Decode/Encode the hlr-Number in the GSUP messageHolger Hans Peter Freyther1-0/+8
Implement it similar to the msisdn_enc/msisdn_enc_len and extend the testcase to include it as well.
2015-05-05gsup: Extract the QoS fieldHolger Hans Peter Freyther1-0/+10
Add roundtrip test for the new QoS IE. It will be consumed in later commits.
2015-05-05gsup: Extract the new MSISDN stringHolger Hans Peter Freyther1-0/+11
Extract the new MSISDN IE from the GSUP message and verify that it is read/written to the message.
2015-04-23misc: Fix warnings about size of size_t in printfHolger Hans Peter Freyther1-1/+1
Fixes warnings like: warning: format '%d' expects argument of type 'int', but argument 3 has type 'long int' [-Wformat]
2015-01-18gprs: Implement PURGE_MS GSUP messagesJacob Erlbeck1-0/+7
This commit implements the encoding and decoding of the messages - Purge MS Request - Purge MS Error - Purge MS Result and adds corresponding tests. Sponsored-by: On-Waves ehf
2015-01-18gprs: Let GSUP parser functions return GMM causes on errorsJacob Erlbeck1-2/+2
Currently the GSUP message handling function in gprs_subscriber.c and the functions in gprs_gsup_messages.c are not consistent with respect to the return codes if an error happens. Albeit all error return codes are negative, the semantics of the absolute value are not clearly defined. In addition, some return codes are not passed to the calling function. This path changes these functions to always return a negated GMM cause value in case of errors. Return values of called parser functions are not longer ignored. Sponsored-by: On-Waves ehf
2015-01-18gprs: Clear GSUP message structures before decodingJacob Erlbeck1-5/+5
Currently the message structure is not cleared before the message is parsed which can cause information leaking between messages if the same gprs_gsup_message object is used. Especially list elements (auth tuples and pdp info) are not replaced by an IE, but the IE is appended. This patch uses the assignment operator to clear gprs_gsup_message, gsm_auth_tuple, and gprs_gsup_pdp_info before using them. This also replaces the use of memcpy of the latter. Sponsored-by: On-Waves ehf
2015-01-18gprs: Always reset auth tuples/pdp infos in gprs_gsup_decodeJacob Erlbeck1-0/+3
Currently auth tuples are always appended to the lists when gprs_gsup_decode is called with a gsup_msg structure. This makes a test case fail, where the same gsup_msg is used again and again without clearing it after each use. Sponsored-by: On-Waves ehf
2015-01-18gprs: Handle empty GSUP messages correctlyJacob Erlbeck1-1/+4
Currently, the gprs_gsup_decode function doesn't check the return value of gprs_shift_v_fixed before using the value pointer. The function fails, if the GSUP message length (not including IPA headers) is 0. In this case, a segfault can happen, depending on the value of the uninitialized 'value' pointer. The test case doesn't trigger a segfault, but valgrind complains about reading uninitialized data. This patch adds a check for the return value that would return with an error code if the shift function failed. Sponsored-by: On-Waves ehf
2015-01-10gprs: Add encoder/decoder for the Subscriber Update ProtocolJacob Erlbeck1-0/+405
This patch adds functions to encode and decode GSUP messages. This does not include the layer 1 framing (IPA). The messages so far supported are: send_auth_info_*, update_location_*, location_cancellation_*. Sponsored-by: On-Waves ehf