- return link;
-}
-
-/* Returns the user data of a link. The user data can be NULL.
- */
-void* SD_link_get_data(SD_link_t link) {
- xbt_assert0(link, "Invalid parameter");
- return link->data;
-}
-
-/* Sets the user data of a link. The new data can be NULL. The old data should have been freed first if it was not NULL.
- */
-void SD_link_set_data(SD_link_t link, void *data) {
- xbt_assert0(link, "Invalid parameter");
- link->data = data;
-}
-
-/* Returns the name of a link. The name can be NULL.
- */
-const char* SD_link_get_name(SD_link_t link) {
- xbt_assert0(link, "Invalid parameter");
- return link->name;
-}
-
-/* Returns the capacity of a link.
- */
-/*
-double SD_link_get_capacity(SD_link_t link) {
- xbt_assert0(link, "Invalid parameter");
- return link->capacity;
-}*/
-
-/* Return the current bandwidth of a link.
- */
-double SD_link_get_current_bandwidth(SD_link_t link) {
- xbt_assert0(link, "Invalid parameter");
-
- /* TODO */
- return 0;
- /* return link->current_bandwidth;*/
+#include "private.h"
+#include "simgrid/simdag.h"
+#include "xbt/dict.h"
+#include "xbt/sysdep.h"
+#include "surf/surf.h"
+#include "simgrid/link.h"
+
+/**
+ * \brief Returns the link list
+ *
+ * Use SD_link_get_number() to know the array size.
+ *
+ * \return an array of \ref SD_link_t containing all links
+ * \see SD_link_get_number()
+ */
+const SD_link_t *SD_link_get_list(void)
+{
+ if (sd_global->link_list == NULL) /* this is the first time the function is called */
+ sd_global->link_list = sg_link_list();
+
+ return sd_global->link_list;