+struct tlvdb *tlvdb_find_next(struct tlvdb *tlvdb, tlv_tag_t tag) {
+ if (!tlvdb)
+ return NULL;
+
+ return tlvdb_find(tlvdb->next, tag);
+}
+
+struct tlvdb *tlvdb_find(struct tlvdb *tlvdb, tlv_tag_t tag) {
+ if (!tlvdb)
+ return NULL;
+
+ for (; tlvdb; tlvdb = tlvdb->next) {
+ if (tlvdb->tag.tag == tag)
+ return tlvdb;
+ }
+
+ return NULL;
+}
+
+struct tlvdb *tlvdb_find_path(struct tlvdb *tlvdb, tlv_tag_t tag[]) {
+ int i = 0;
+ struct tlvdb *tnext = tlvdb;
+
+ while (tnext && tag[i]) {
+ tnext = tlvdb_find(tnext, tag[i]);
+ i++;
+ if (tag[i] && tnext) {
+ tnext = tnext->children;
+ }
+ }
+
+ return tnext;
+}
+