| 162 | } |
| 163 | |
| 164 | static int |
| 165 | graph_adjacency_list_update(struct graph *graph) |
| 166 | { |
| 167 | struct graph_node *graph_node, *tmp; |
| 168 | struct node *adjacency; |
| 169 | const char *next; |
| 170 | rte_edge_t i; |
| 171 | |
| 172 | STAILQ_FOREACH(graph_node, &graph->node_list, next) { |
| 173 | for (i = 0; i < graph_node->node->nb_edges; i++) { |
| 174 | next = graph_node->node->next_nodes[i]; |
| 175 | adjacency = node_from_name(next); |
| 176 | if (adjacency == NULL) |
| 177 | SET_ERR_JMP(EINVAL, fail, |
| 178 | "Node %s not registered", next); |
| 179 | tmp = node_to_graph_node(graph, adjacency); |
| 180 | if (tmp == NULL) |
| 181 | goto fail; |
| 182 | graph_node->adjacency_list[i] = tmp; |
| 183 | } |
| 184 | } |
| 185 | |
| 186 | return 0; |
| 187 | fail: |
| 188 | return -rte_errno; |
| 189 | } |
| 190 | |
| 191 | static int |
| 192 | expand_pattern_to_node(struct graph *graph, const char *pattern) |
no test coverage detected