-#include "simdag/simdag.h"
-#include "xbt/sysdep.h" /* xbt_new0 */
-
-/* Creates a link.
- */
-SG_link_t SG_link_create(void *data, const char *name,/* double capacity,*/ double bandwidth, double latency) {
- /* xbt_assert0(capacity >= 0, "Invalid parameter");*/ /* or capacity > 0 ? */
-
- SG_link_t link = xbt_new0(s_SG_link_t, 1);
-
- link->data = data;
- link->name = xbt_strdup(name);
- /*link->capacity = capacity;*/
- /* link->current_bandwidth = bandwidth;
- link->current_latency = latency;*/
-
- return link;
+/* Copyright (c) 2006-2015. The SimGrid Team.
+ * All rights reserved. */
+
+/* This program is free software; you can redistribute it and/or modify it
+ * under the terms of the license (GNU LGPL) which comes with this package. */
+
+#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;