aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/gprs/gprs_gsup_messages.c
AgeCommit message (Collapse)AuthorFilesLines
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