laforge has submitted this change. ( https://gerrit.osmocom.org/c/libosmocore/+/17554 )
Change subject: sim: add osim_file_desc_find_aid() ...................................................................... sim: add osim_file_desc_find_aid() Change-Id: I80468c8c4f4590c262019f42285e8d8fd3444f7f --- M TODO-RELEASE M include/osmocom/sim/sim.h M src/sim/core.c 3 files changed, 21 insertions(+), 1 deletion(-) Approvals: Jenkins Builder: Verified laforge: Looks good to me, approved diff --git a/TODO-RELEASE b/TODO-RELEASE index 329e217..4145300 100644 --- a/TODO-RELEASE +++ b/TODO-RELEASE @@ -7,4 +7,5 @@ # If any interfaces have been added since the last public release: c:r:a + 1. # If any interfaces have been removed or changed since the last public release: c:r:0. #library what description / commit summary line -gsm API/ABI change l1sap.h, added struct members to ph_data_param and ph_tch_param \ No newline at end of file +gsm API/ABI change l1sap.h, added struct members to ph_data_param and ph_tch_param +sim API/ABI change new osim_file_desc_find_aid() diff --git a/include/osmocom/sim/sim.h b/include/osmocom/sim/sim.h index 8eb3f11..5440d85 100644 --- a/include/osmocom/sim/sim.h +++ b/include/osmocom/sim/sim.h @@ -243,6 +243,9 @@ osim_file_desc_find_name(struct osim_file_desc *parent, const char *name); struct osim_file_desc * +osim_file_desc_find_aid(struct osim_file_desc *parent, const uint8_t *aid, uint8_t aid_len); + +struct osim_file_desc * osim_file_desc_find_fid(struct osim_file_desc *parent, uint16_t fid); struct osim_file_desc * diff --git a/src/sim/core.c b/src/sim/core.c index b93633c..4360ff1 100644 --- a/src/sim/core.c +++ b/src/sim/core.c @@ -187,6 +187,22 @@ } struct osim_file_desc * +osim_file_desc_find_aid(struct osim_file_desc *parent, const uint8_t *aid, uint8_t aid_len) +{ + struct osim_file_desc *ofd; + llist_for_each_entry(ofd, &parent->child_list, list) { + if (ofd->type != TYPE_ADF) + continue; + if (aid_len > ofd->df_name_len) + continue; + if (!memcmp(ofd->df_name, aid, aid_len)) { + return ofd; + } + } + return NULL; +} + +struct osim_file_desc * osim_file_desc_find_fid(struct osim_file_desc *parent, uint16_t fid) { struct osim_file_desc *ofd; -- To view, visit https://gerrit.osmocom.org/c/libosmocore/+/17554 To unsubscribe, or for help writing mail filters, visit https://gerrit.osmocom.org/settings Gerrit-Project: libosmocore Gerrit-Branch: master Gerrit-Change-Id: I80468c8c4f4590c262019f42285e8d8fd3444f7f Gerrit-Change-Number: 17554 Gerrit-PatchSet: 3 Gerrit-Owner: laforge <lafo...@osmocom.org> Gerrit-Reviewer: Jenkins Builder Gerrit-Reviewer: laforge <lafo...@osmocom.org> Gerrit-MessageType: merged