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... | |
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.
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.
path | The path into the RIT. |
nom | The name of the tag. |
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.
path | The path into the RIT. |
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.
path | The path into the RIT. |
value | The new value to set. |
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".
path | The path into the RIT. |
name | The name of the tag. |
value | The value of the tag. |
int rit_unset | ( | const char * | path | ) |
#brief Removes the values of the given path.
This function removes all the values of the given path.
path | The path into the RIT. |
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.
path | The path into the RIT. |
name | The name of the tag. |