From bb30c4f0488d5d444fd316d716f59c824a01540f Mon Sep 17 00:00:00 2001 From: Sander Vrijders Date: Thu, 23 Mar 2017 15:51:42 +0100 Subject: ipcpd: normal: Add routing table calculation This adds routing table calculation to the graph component. The routing instances can then periodically ask the graph component for the routing table, and update their PFFs accordingly. --- src/ipcpd/normal/graph.h | 23 +++++++---------------- 1 file changed, 7 insertions(+), 16 deletions(-) (limited to 'src/ipcpd/normal/graph.h') diff --git a/src/ipcpd/normal/graph.h b/src/ipcpd/normal/graph.h index 9653efd7..226092c7 100644 --- a/src/ipcpd/normal/graph.h +++ b/src/ipcpd/normal/graph.h @@ -28,22 +28,9 @@ #include -struct edge { - struct list_head next; - uint64_t dst_addr; - qosspec_t qs; -}; - -struct vertex { - struct list_head next; - uint64_t addr; - struct list_head edges; -}; - -struct graph { - size_t nr_vertices; - struct list_head vertices; - pthread_mutex_t lock; +struct routing_table { + uint64_t dst; + uint64_t nhop; }; struct graph * graph_create(void); @@ -64,4 +51,8 @@ int graph_del_edge(struct graph * graph, uint64_t s_addr, uint64_t d_addr); +ssize_t graph_routing_table(struct graph * graph, + uint64_t s_addr, + struct routing_table *** table); + #endif /* OUROBOROS_IPCPD_NORMAL_GRAPH_H */ -- cgit v1.2.3