cnet v3.1.4

home
FAQ

cmdline options
topology files
attributes

datatypes
data structures
core API
support API

download/install

cnet's Application Programming Interface

NAME
CNET_get_position - get the node's location on the simulation map

SYNOPSIS
#include <cnet.h>

int CNET_get_position(CnetPosition *now, CnetPosition *max);

DESCRIPTION
All simulations run within a rectangular region whose dimensions are set in the toplology file by specifying the attributes of mapwidth and mapheight as two non-negative integer values. Nodes of all types may determine their current location, and the maximum dimensions of the simulation map, by calling CNET_get_position.

If the value NULL is passed for either of the two parameters, the corresponding position is not provided.

Calls to CNET_get_position during simulations not using the graphical interface are still meaningful.

The dimensions of the simulation area are measured in metres, and may be specified by setting the mapwidth and attributes in the toplogy file. Distances, in metres, are used in the default calculations of wireless signal strength and propagation delay of LT_WLAN transmissions.

RETURN VALUE
The value 0 is always returned.

SEE ALSO
CNET_set_position.

cnet was written and is maintained by Chris McDonald (chris@csse.uwa.edu.au).

cnet development has been supported by an ACM-SIGCSE Special Project Grant, and an Australian Apple University Consortium Scholarship.