aDTN lib  0.2
 All Data Structures Files Functions Variables
Functions
rit.h File Reference

Functions

int rit_set (const char *path, const char *value)
 Sets a path with the given value. More...
 
int rit_unset (const char *path)
 
int rit_tag (const char *path, const char *name, const char *value)
 This function adds a tag to the given path with the given value. More...
 
int rit_untag (const char *path, const char *name)
 This function removes a tag. More...
 
char * rit_getValue (const char *path)
 This functions gets the value of the given path. More...
 
char * rit_getTag (const char *path, const char *nom)
 This functions gets the value of the tag into the given path. More...
 

Detailed Description

This are some functions to interact with the RIT.

Some of this functions are necessary for different types of applications:

If you want to use multicast, you will need to subscribe into a group, to do this you will need to add the groups as values in the path <nodeId>/subscribed

The same goes if you want to announce something with the RIT.

To announce anything, you must add it into the RIT, then you need to add the TAG "announceable" with a value of "1", with this your path with it's values is going to be announced with beacons to the neighbours.

To update the new values, it's needed to activate the signal SIGUSR2 to the information_exchange process. This can be done of differents forms, one of them using the kill function as follows:

kill -s SIGUSR2 <pid>

Definition in file rit.h.

Function Documentation

char * rit_getTag ( const char *  path,
const char *  nom 
)

This functions gets the value of the tag into the given path.

This is a usefull function, it can be used into the forwarding, life and priority codes, letting the option of change the result based on values of the tags given by the neighbour beacons.

Parameters
pathThe path into the RIT.
nomThe name of the tag.
Returns
This functions returns 1 on error, other value otherwise.
char * rit_getValue ( const char *  path)

This functions gets the value of the given path.

This is a usefull function, it can be used into the forwarding, life and priority codes, letting the option of change the result based on values given by the neighbour beacons.

Parameters
pathThe path into the RIT.
Returns
This functions returns 1 on error, other value otherwise.
int rit_set ( const char *  path,
const char *  value 
)

Sets a path with the given value.

This function lets to add a new path into the RIT, and at the same time add one value into it.

This function it's also usefull to add a value to an existing path.

Parameters
pathThe path into the RIT.
valueThe new value to set.
Returns
This functions returns 1 on error, other value otherwise.
int rit_tag ( const char *  path,
const char *  name,
const char *  value 
)

This function adds a tag to the given path with the given value.

This function adds the given tag, to the given path, with the given value.

This is usefull to announce something of your RIT to the world.

To do this the "announceable" tag must be add to the path with a value of "1".

Parameters
pathThe path into the RIT.
nameThe name of the tag.
valueThe value of the tag.
Returns
This functions returns 1 on error, other value otherwise.
int rit_unset ( const char *  path)

#brief Removes the values of the given path.

This function removes all the values of the given path.

Parameters
pathThe path into the RIT.
Returns
This functions returns 1 on error, other value otherwise.
int rit_untag ( const char *  path,
const char *  name 
)

This function removes a tag.

Given a path into the RIT this function removes the tags, if any, that could have.

Parameters
pathThe path into the RIT.
nameThe name of the tag.
Returns
This functions returns 1 on error, other value otherwise.