Lines Matching full:node

663 pldm_entity pldm_entity_extract(pldm_entity_node *node)  in pldm_entity_extract()  argument
665 assert(node != NULL); in pldm_entity_extract()
667 return node->entity; in pldm_entity_extract()
697 /* Insert after the the last node that matches the input entity type, or in find_insertion_at()
737 pldm_entity node; in pldm_entity_association_tree_add_entity() local
738 node.entity_type = entity->entity_type; in pldm_entity_association_tree_add_entity()
739 node.entity_instance_num = entity_instance_number; in pldm_entity_association_tree_add_entity()
740 if (pldm_is_current_parent_child(parent, &node)) { in pldm_entity_association_tree_add_entity()
748 pldm_entity_node *node = malloc(sizeof(pldm_entity_node)); in pldm_entity_association_tree_add_entity() local
749 if (!node) { in pldm_entity_association_tree_add_entity()
752 node->first_child = NULL; in pldm_entity_association_tree_add_entity()
753 node->next_sibling = NULL; in pldm_entity_association_tree_add_entity()
754 node->parent.entity_type = 0; in pldm_entity_association_tree_add_entity()
755 node->parent.entity_instance_num = 0; in pldm_entity_association_tree_add_entity()
756 node->parent.entity_container_id = 0; in pldm_entity_association_tree_add_entity()
757 node->entity.entity_type = entity->entity_type; in pldm_entity_association_tree_add_entity()
758 node->entity.entity_instance_num = in pldm_entity_association_tree_add_entity()
760 node->association_type = association_type; in pldm_entity_association_tree_add_entity()
761 node->remote_container_id = 0; in pldm_entity_association_tree_add_entity()
764 free(node); in pldm_entity_association_tree_add_entity()
767 tree->root = node; in pldm_entity_association_tree_add_entity()
769 node->entity.entity_container_id = 0; in pldm_entity_association_tree_add_entity()
770 node->remote_container_id = node->entity.entity_container_id; in pldm_entity_association_tree_add_entity()
774 free(node); in pldm_entity_association_tree_add_entity()
778 parent->first_child = node; in pldm_entity_association_tree_add_entity()
779 node->parent = parent->entity; in pldm_entity_association_tree_add_entity()
782 node->remote_container_id = entity->entity_container_id; in pldm_entity_association_tree_add_entity()
786 node->entity.entity_container_id = container_id; in pldm_entity_association_tree_add_entity()
791 node->entity.entity_container_id = in pldm_entity_association_tree_add_entity()
795 node->entity.entity_container_id = in pldm_entity_association_tree_add_entity()
800 node->remote_container_id = in pldm_entity_association_tree_add_entity()
801 node->entity.entity_container_id; in pldm_entity_association_tree_add_entity()
809 free(node); in pldm_entity_association_tree_add_entity()
815 free(node); in pldm_entity_association_tree_add_entity()
818 node->entity.entity_instance_num = in pldm_entity_association_tree_add_entity()
823 prev->next_sibling = node; in pldm_entity_association_tree_add_entity()
824 node->parent = prev->parent; in pldm_entity_association_tree_add_entity()
825 node->next_sibling = next; in pldm_entity_association_tree_add_entity()
826 node->entity.entity_container_id = in pldm_entity_association_tree_add_entity()
828 node->remote_container_id = entity->entity_container_id; in pldm_entity_association_tree_add_entity()
830 entity->entity_instance_num = node->entity.entity_instance_num; in pldm_entity_association_tree_add_entity()
832 entity->entity_container_id = node->entity.entity_container_id; in pldm_entity_association_tree_add_entity()
834 return node; in pldm_entity_association_tree_add_entity()
837 static void get_num_nodes(pldm_entity_node *node, size_t *num) in get_num_nodes() argument
839 if (node == NULL) { in get_num_nodes()
844 get_num_nodes(node->next_sibling, num); in get_num_nodes()
845 get_num_nodes(node->first_child, num); in get_num_nodes()
848 static void entity_association_tree_visit(pldm_entity_node *node, in entity_association_tree_visit() argument
851 if (node == NULL) { in entity_association_tree_visit()
857 entity->entity_type = node->entity.entity_type; in entity_association_tree_visit()
858 entity->entity_instance_num = node->entity.entity_instance_num; in entity_association_tree_visit()
859 entity->entity_container_id = node->entity.entity_container_id; in entity_association_tree_visit()
861 entity_association_tree_visit(node->next_sibling, entities, index); in entity_association_tree_visit()
862 entity_association_tree_visit(node->first_child, entities, index); in entity_association_tree_visit()
887 static void entity_association_tree_destroy(pldm_entity_node *node) in entity_association_tree_destroy() argument
889 if (node == NULL) { in entity_association_tree_destroy()
893 entity_association_tree_destroy(node->next_sibling); in entity_association_tree_destroy()
894 entity_association_tree_destroy(node->first_child); in entity_association_tree_destroy()
895 free(node); in entity_association_tree_destroy()
910 bool pldm_entity_is_node_parent(pldm_entity_node *node) in pldm_entity_is_node_parent() argument
912 assert(node != NULL); in pldm_entity_is_node_parent()
914 return node->first_child != NULL; in pldm_entity_is_node_parent()
918 pldm_entity pldm_entity_get_parent(pldm_entity_node *node) in pldm_entity_get_parent() argument
920 assert(node != NULL); in pldm_entity_get_parent()
922 return node->parent; in pldm_entity_get_parent()
926 bool pldm_entity_is_exist_parent(pldm_entity_node *node) in pldm_entity_is_exist_parent() argument
928 if (!node) { in pldm_entity_is_exist_parent()
932 if (node->parent.entity_type == 0 && in pldm_entity_is_exist_parent()
933 node->parent.entity_instance_num == 0 && in pldm_entity_is_exist_parent()
934 node->parent.entity_container_id == 0) { in pldm_entity_is_exist_parent()
942 uint8_t pldm_entity_get_num_children(pldm_entity_node *node, in pldm_entity_get_num_children() argument
945 if (!node) { in pldm_entity_get_num_children()
955 pldm_entity_node *curr = node->first_child; in pldm_entity_get_num_children()
968 bool pldm_is_current_parent_child(pldm_entity_node *parent, pldm_entity *node) in pldm_is_current_parent_child() argument
970 if (!parent || !node) { in pldm_is_current_parent_child()
976 if (node->entity_type == curr->entity.entity_type && in pldm_is_current_parent_child()
977 node->entity_instance_num == in pldm_is_current_parent_child()
1026 pldm_entity_node *node = curr->first_child; in entity_association_pdr_add_children() local
1027 while (node != NULL) { in entity_association_pdr_add_children()
1028 if (node->association_type == association_type) { in entity_association_pdr_add_children()
1030 entity->entity_type = htole16(node->entity.entity_type); in entity_association_pdr_add_children()
1032 htole16(node->entity.entity_instance_num); in entity_association_pdr_add_children()
1034 htole16(node->entity.entity_container_id); in entity_association_pdr_add_children()
1037 node = node->next_sibling; in entity_association_pdr_add_children()
1132 // entity. This causes NULL current entity node, and the in entity_association_pdr_add()
1188 pldm_entity_node *node, pldm_pdr *repo, pldm_entity **entities, in pldm_entity_association_pdr_add_from_node() argument
1192 node, repo, entities, num_entities, is_remote, terminus_handle, in pldm_entity_association_pdr_add_from_node()
1198 pldm_entity_node *node, pldm_pdr *repo, pldm_entity **entities, in pldm_entity_association_pdr_add_from_node_with_record_handle() argument
1202 if (!node || !repo || !entities) { in pldm_entity_association_pdr_add_from_node_with_record_handle()
1206 int64_t rc = entity_association_pdr_add(node, repo, entities, in pldm_entity_association_pdr_add_from_node_with_record_handle()
1215 pldm_entity entity, pldm_entity_node **node) in find_entity_ref_in_tree() argument
1232 *node = tree_node; in find_entity_ref_in_tree()
1236 find_entity_ref_in_tree(tree_node->first_child, entity, node); in find_entity_ref_in_tree()
1237 find_entity_ref_in_tree(tree_node->next_sibling, entity, node); in find_entity_ref_in_tree()
1242 pldm_entity entity, pldm_entity_node **node) in pldm_find_entity_ref_in_tree() argument
1244 if (!tree || !node) { in pldm_find_entity_ref_in_tree()
1248 find_entity_ref_in_tree(tree->root, entity, node); in pldm_find_entity_ref_in_tree()
1376 static void entity_association_tree_find_if_remote(pldm_entity_node *node, in entity_association_tree_find_if_remote() argument
1381 if (node == NULL) { in entity_association_tree_find_if_remote()
1387 is_entity_type = node->entity.entity_type == entity->entity_type; in entity_association_tree_find_if_remote()
1388 is_entity_instance_num = node->entity.entity_instance_num == in entity_association_tree_find_if_remote()
1392 node->remote_container_id == entity->entity_container_id) { in entity_association_tree_find_if_remote()
1395 node->entity.entity_container_id; in entity_association_tree_find_if_remote()
1396 *out = node; in entity_association_tree_find_if_remote()
1400 entity_association_tree_find_if_remote(node->next_sibling, entity, out, in entity_association_tree_find_if_remote()
1402 entity_association_tree_find_if_remote(node->first_child, entity, out, in entity_association_tree_find_if_remote()
1413 pldm_entity_node *node = NULL; in pldm_entity_association_tree_find_with_locality() local
1414 entity_association_tree_find_if_remote(tree->root, entity, &node, in pldm_entity_association_tree_find_with_locality()
1416 return node; in pldm_entity_association_tree_find_with_locality()
1419 static void entity_association_tree_find(pldm_entity_node *node, in entity_association_tree_find() argument
1423 if (node == NULL) { in entity_association_tree_find()
1427 if (node->entity.entity_type == entity->entity_type && in entity_association_tree_find()
1428 node->entity.entity_instance_num == entity->entity_instance_num) { in entity_association_tree_find()
1429 entity->entity_container_id = node->entity.entity_container_id; in entity_association_tree_find()
1430 *out = node; in entity_association_tree_find()
1433 entity_association_tree_find(node->next_sibling, entity, out); in entity_association_tree_find()
1434 entity_association_tree_find(node->first_child, entity, out); in entity_association_tree_find()
1446 pldm_entity_node *node = NULL; in pldm_entity_association_tree_find() local
1447 entity_association_tree_find(tree->root, entity, &node); in pldm_entity_association_tree_find()
1448 return node; in pldm_entity_association_tree_find()
2359 pldm_entity_node *node = NULL; in pldm_entity_association_tree_delete_node() local
2360 pldm_find_entity_ref_in_tree(tree, *entity, &node); in pldm_entity_association_tree_delete_node()
2361 if (!node) { in pldm_entity_association_tree_delete_node()
2366 pldm_find_entity_ref_in_tree(tree, node->parent, &parent); in pldm_entity_association_tree_delete_node()
2384 entity_association_tree_destroy(node); in pldm_entity_association_tree_delete_node()