sim: add osim_file_desc_find_aid()
Change-Id: I80468c8c4f4590c262019f42285e8d8fd3444f7f
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;