laforge has posted comments on this change. ( https://gerrit.osmocom.org/c/osmo-hnbgw/+/26792 )
Change subject: ranap_rab_ass: add decoder and rewrite functions for RAB-AssignmentRequest/Response ...................................................................... Patch Set 11: (1 comment) https://gerrit.osmocom.org/c/osmo-hnbgw/+/26792/11/src/osmo-hnbgw/ranap_rab_ass.c File src/osmo-hnbgw/ranap_rab_ass.c: https://gerrit.osmocom.org/c/osmo-hnbgw/+/26792/11/src/osmo-hnbgw/ranap_rab_ass.c@34 PS11, Line 34: int ranap_rab_ass_req_decode(RANAP_RAB_AssignmentRequestIEs_t *rab_assignment_request_ies, const uint8_t *data, I'm a bit surprised that we pass the binary PDU in here and then deocde it, but only return a very small subset of the message. Isn't the normal approach to do this in a generic fashion? Shouldn't the caller already have done a aper_decode of the ranap_pdu before the caller can know us? If so, then the input data to this function would not be the 'const uitn8_t *data' but already the 'const RANAP_RANAP_PDU_t *' ? Or even more generic: shouldn't all of the code operate on the 'typedef struct ranap_message_s ... ranap_message'? Something like ranap_common_cn.c (but this one only handles the messages received in the uplink direction)? Then there would be one decoder function to call, which recursively decodes all information elements. The result is stored in a ranap_message. Then there is a functio nthat handles this decoded message. That's how we implement the entire handling of the MSC and SGSN code. I'm wondering why you're not doing the same here? -- To view, visit https://gerrit.osmocom.org/c/osmo-hnbgw/+/26792 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: osmo-hnbgw Gerrit-Branch: master Gerrit-Change-Id: I58b542bf23ff5e1db2ccf6833fec91d9ba332837 Gerrit-Change-Number: 26792 Gerrit-PatchSet: 11 Gerrit-Owner: dexter <pma...@sysmocom.de> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: daniel <dwillm...@sysmocom.de> Gerrit-Reviewer: osmith <osm...@sysmocom.de> Gerrit-Reviewer: pespin <pes...@sysmocom.de> Gerrit-CC: laforge <lafo...@osmocom.org> Gerrit-Comment-Date: Wed, 12 Jan 2022 15:13:47 +0000 Gerrit-HasComments: Yes Gerrit-Has-Labels: No Gerrit-MessageType: comment