diff options
author | Neels Hofmeyr <neels@hofmeyr.de> | 2020-06-26 15:20:51 +0200 |
---|---|---|
committer | Neels Hofmeyr <neels@hofmeyr.de> | 2020-07-01 23:33:16 +0200 |
commit | b697274daabed2bf7454cc05d3e3689e91665e36 (patch) | |
tree | 56cde4f9d6e6c1932328facbbbe5d9508bf061ba /include/osmocom/msc | |
parent | 1139ca352b314b796649f014d8bdbb145fdcf4ea (diff) |
refactor: move RESET Osmux TLV parsing to ran_msg_a.c
ran_peer.c is not the proper place to parse messages, because it should be RAN
agnostic. All parsing and encoding belongs in ran_msg_a.c and ran_msg_iu.c.
Move the Osmux TLV parsing into the is_reset_msg op: add supports_osmux
out-parameter (and add a logging fi pointer). To be able to modify msg->l3h,
also make the msgb arg non-const.
In ranap_is_reset_msg(), always return non-support for Osmux.
In bssmap_is_reset_msg(), return 0 if no TLVs were parsed, 1/-1 if an Osmux TLV
was present/not present.
Update the osmux support flag directly where the ConnectionLess message is
received, so that there is only one place responsible for that.
Related: OS#4595
Change-Id: I1ad4a3f9356216dd4bf8c48fba29fd23438810a7
Diffstat (limited to 'include/osmocom/msc')
-rw-r--r-- | include/osmocom/msc/ran_msg_a.h | 3 | ||||
-rw-r--r-- | include/osmocom/msc/ran_msg_iu.h | 3 | ||||
-rw-r--r-- | include/osmocom/msc/sccp_ran.h | 7 |
3 files changed, 9 insertions, 4 deletions
diff --git a/include/osmocom/msc/ran_msg_a.h b/include/osmocom/msc/ran_msg_a.h index 3ba081de2..2d045b96e 100644 --- a/include/osmocom/msc/ran_msg_a.h +++ b/include/osmocom/msc/ran_msg_a.h @@ -35,7 +35,8 @@ struct gsm_mncc_bearer_cap; int ran_a_decode_l2(struct ran_dec *ran_a, struct msgb *bssap); struct msgb *ran_a_encode(struct osmo_fsm_inst *caller_fi, const struct ran_msg *ran_enc_msg); -enum reset_msg_type bssmap_is_reset_msg(const struct sccp_ran_inst *sri, const struct msgb *l2); +enum reset_msg_type bssmap_is_reset_msg(const struct sccp_ran_inst *sri, struct osmo_fsm_inst *log_fi, + struct msgb *l2, int *supports_osmux); struct msgb *bssmap_make_reset_msg(const struct sccp_ran_inst *sri, enum reset_msg_type type); struct msgb *bssmap_make_paging_msg(const struct sccp_ran_inst *sri, const struct gsm0808_cell_id *page_cell_id, const char *imsi, uint32_t tmsi, enum paging_cause cause); diff --git a/include/osmocom/msc/ran_msg_iu.h b/include/osmocom/msc/ran_msg_iu.h index 316a91cdb..3f3d61e4a 100644 --- a/include/osmocom/msc/ran_msg_iu.h +++ b/include/osmocom/msc/ran_msg_iu.h @@ -28,7 +28,8 @@ int ran_iu_decode_l2(struct ran_dec *ran_dec_iu, struct msgb *ranap); struct msgb *ran_iu_encode(struct osmo_fsm_inst *caller_fi, const struct ran_msg *ran_enc_msg); -enum reset_msg_type ranap_is_reset_msg(const struct sccp_ran_inst *sri, const struct msgb *l2); +enum reset_msg_type ranap_is_reset_msg(const struct sccp_ran_inst *sri, struct osmo_fsm_inst *log_fi, + struct msgb *l2, int *supports_osmux); struct msgb *ranap_make_reset_msg(const struct sccp_ran_inst *sri, enum reset_msg_type type); struct msgb *ranap_make_paging_msg(const struct sccp_ran_inst *sri, const struct gsm0808_cell_id *page_cell_id, const char *imsi, uint32_t tmsi, enum paging_cause cause); diff --git a/include/osmocom/msc/sccp_ran.h b/include/osmocom/msc/sccp_ran.h index f84bf614e..a4bd4ca61 100644 --- a/include/osmocom/msc/sccp_ran.h +++ b/include/osmocom/msc/sccp_ran.h @@ -233,8 +233,11 @@ struct sccp_ran_ops { /* Return whether the given l2_cl message is a RESET, RESET ACKNOWLEDGE, or RESET-unrelated message. * This callback is stored in struct sccp_ran_inst to provide RESET handling to the caller (ran_peer), - * it is not used in sccp_ran.c. */ - enum reset_msg_type (* is_reset_msg )(const struct sccp_ran_inst *sri, const struct msgb *l2_cl); + * it is not used in sccp_ran.c. + * In supports_osmux, return 0 for no information, 1 for support detected, -1 for non-support detected. + */ + enum reset_msg_type (* is_reset_msg )(const struct sccp_ran_inst *sri, struct osmo_fsm_inst *log_fi, + struct msgb *l2_cl, int *supports_osmux); /* Return a RESET or RESET ACK message for this RAN type. * This callback is stored in struct sccp_ran_inst to provide RESET handling to the caller (ran_peer), |