SimGrid: Links

SimGrid 3.10 Versatile Simulation of Distributed Systems

- Home page
- Online documentation
- Dev's Corner

All Data Structures Functions Variables Typedefs Enumerations Enumerator Groups Pages
Functions
Links
SimDag

Functions for managing the network links. More...

## Functions
const SD_link_t * | SD_link_get_list (void)
| Returns the link list.
int | SD_link_get_number (void)
| Returns the number of links.
void * | SD_link_get_data (SD_link_t link)
| Returns the user data of a link.
void | SD_link_set_data (SD_link_t link, void *data)
| Sets the user data of a link.
const char * | SD_link_get_name (SD_link_t link)
| Returns the name of a link.
double | SD_link_get_current_bandwidth (SD_link_t link)
| Returns the current bandwidth of a link.
double | SD_link_get_current_latency (SD_link_t link)
| Returns the current latency of a link.
e_SD_link_sharing_policy_t | SD_link_get_sharing_policy (SD_link_t link)
| Returns the sharing policy of this workstation.

## Detailed Description

Functions for managing the network links.

This section describes the functions for managing the network links.

A link is a network node represented as a name, a current bandwidth and a current latency. The links are created when you call the function SD_create_environment.

See Also
  SD_link_t

## Function Documentation

const SD_link_t* SD_link_get_list | ( | void |  | ) |

Returns the link list.

Use SD_link_get_number() to know the array size.

Returns
  an array of SD_link_t containing all links

See Also
  SD_link_get_number()

int SD_link_get_number | ( | void |  | ) |

Returns the number of links.

Returns
  the number of existing links

See Also
  SD_link_get_list()

void* SD_link_get_data | ( | SD_link_t | link | ) |

Returns the user data of a link.

Parameters

  link | a link

Returns
  the user data associated with this link (can be `NULL`)

See Also
  SD_link_set_data()

void SD_link_set_data | ( | SD_link_t | link,
|  | void * | 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`.

Parameters

  link | a link
  data | the new data you want to associate with this link

See Also
  SD_link_get_data()

const char* SD_link_get_name | ( | SD_link_t | link | ) |

Returns the name of a link.

Parameters

  link | a link

Returns
  the name of this link (cannot be `NULL`)

double SD_link_get_current_bandwidth | ( | SD_link_t | link | ) |

Returns the current bandwidth of a link.

Parameters

  link | a link

Returns
  the current bandwidth of this link, in bytes per second

double SD_link_get_current_latency | ( | SD_link_t | link | ) |

Returns the current latency of a link.

Parameters

  link | a link

Returns
  the current latency of this link, in seconds

e_SD_link_sharing_policy_t SD_link_get_sharing_policy | ( | SD_link_t | link | ) |

Returns the sharing policy of this workstation.

Parameters

  link | a link

Returns
  the sharing policyfor the flows going through this link: SD_LINK_SHARED or SD_LINK_FATPIPE