aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorHarald Welte <laforge@osmocom.org>2020-03-20 12:11:03 +0100
committerHarald Welte <laforge@osmocom.org>2020-03-21 16:31:17 +0100
commitbf90d747ad678fd301831b299c12f9de332341f9 (patch)
treec4a7fe8a538b7cf9f3c75ab28a910c12ecbc3c1e /src
parent870f94d0ccc0c64cda1631e7da0bffbe302097a6 (diff)
sim: add osim_file_desc_find_aid()
Diffstat (limited to 'src')
-rw-r--r--src/sim/core.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/src/sim/core.c b/src/sim/core.c
index b93633c1..4360ff11 100644
--- a/src/sim/core.c
+++ b/src/sim/core.c
@@ -187,6 +187,22 @@ 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 *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;