The XMR - XIAN Metric Repository Module has the functionnalities of a database. It is responsible of recording the calculated values of the new cross-layer metrics introduced withinthe XIAN framework. It enables to update, to delete a value of a metric and to give accessible the metrics to the other system components
Definition in file xmr.c.
#include <linux/init.h>
#include <linux/module.h>
#include "include/xian_proto.h"
Go to the source code of this file.
Functions | |
MODULE_DESCRIPTION ("XMR - XIAN Metric Repository Module") | |
MODULE_LICENSE ("GPL") | |
struct xian_float | xian_float_add (struct xian_float a, struct xian_float b) |
This function returns the addition between a and b. | |
XIAN_EXPORT_SYMBOL (xian_float_add) | |
struct xian_float | xian_float_mult (struct xian_float a, struct xian_float b) |
This function returns the multiplication between a and b. | |
XIAN_EXPORT_SYMBOL (xian_float_mult) | |
struct xian_float | xian_float_div (struct xian_float a, struct xian_float b) |
This function returns the division of a by b. | |
XIAN_EXPORT_SYMBOL (xian_float_div) | |
int | xian_float_cmp (struct xian_float a, struct xian_float b) |
This function compare a and b. | |
XIAN_EXPORT_SYMBOL (xian_float_cmp) | |
struct xian_float | int2xian_float (unsigned int x) |
This function converts an int x to a xian_float(x/1). | |
XIAN_EXPORT_SYMBOL (int2xian_float) | |
void | print_stats (void) |
This function print the statisctics in the module. | |
struct xian_float | get_xian_stat (unsigned char macadd[IEEE80211_MAC_ADDR_LEN+1], unsigned char dev_name[IFNAMESIZ+1], unsigned int id_conf, unsigned int *code_err) |
This function returns the value of a metric. | |
XIAN_EXPORT_SYMBOL (get_xian_stat) | |
void | update_xian_stat (unsigned char saddr[IEEE80211_MAC_ADDR_LEN+1], unsigned char dev_name[IFNAMESIZ+1], unsigned int id_conf, struct xian_float value) |
This function updates the value of a metric. | |
XIAN_EXPORT_SYMBOL (update_xian_stat) | |
void | del_xian_stat (unsigned char dev_name[IFNAMESIZ+1], unsigned int id_conf) |
This function deletes the value of a metric. | |
XIAN_EXPORT_SYMBOL (del_xian_stat) | |
int | xian_stats_init (void) |
void | xian_stats_exit (void) |
module_init (xian_stats_init) | |
module_exit (xian_stats_exit) | |
Variables | |
struct xian_stats * | stats |
MODULE_DESCRIPTION | ( | "XMR - XIAN Metric Repository Module" | ) |
MODULE_LICENSE | ( | "GPL" | ) |
struct xian_float xian_float_add | ( | struct xian_float | a, | |
struct xian_float | b | |||
) | [read] |
This function returns the addition between a and b.
a | a struct xian_float | |
b | a struct xian_float |
Definition at line 48 of file xmr.c.
References xian_float::denominator, and xian_float::numerator.
XIAN_EXPORT_SYMBOL | ( | xian_float_add | ) |
struct xian_float xian_float_mult | ( | struct xian_float | a, | |
struct xian_float | b | |||
) | [read] |
This function returns the multiplication between a and b.
a | a struct xian_float | |
b | a struct xian_float |
Definition at line 72 of file xmr.c.
References xian_float::denominator, and xian_float::numerator.
XIAN_EXPORT_SYMBOL | ( | xian_float_mult | ) |
struct xian_float xian_float_div | ( | struct xian_float | a, | |
struct xian_float | b | |||
) | [read] |
This function returns the division of a by b.
a | a struct xian_float | |
b | a struct xian_float |
Definition at line 86 of file xmr.c.
References xian_float::denominator, xian_float::numerator, and xian_float_mult().
XIAN_EXPORT_SYMBOL | ( | xian_float_div | ) |
int xian_float_cmp | ( | struct xian_float | a, | |
struct xian_float | b | |||
) |
This function compare a and b.
a | a struct xian_float | |
b | a struct xian_float |
Definition at line 104 of file xmr.c.
References xian_float::denominator, and xian_float::numerator.
XIAN_EXPORT_SYMBOL | ( | xian_float_cmp | ) |
struct xian_float int2xian_float | ( | unsigned int | x | ) | [read] |
This function converts an int x to a xian_float(x/1).
x | an int |
Definition at line 125 of file xmr.c.
References xian_float::denominator, and xian_float::numerator.
XIAN_EXPORT_SYMBOL | ( | int2xian_float | ) |
void print_stats | ( | void | ) |
This function print the statisctics in the module.
Definition at line 136 of file xmr.c.
References xian_float::denominator, xian_stats::id_conf, xian_stat::next_stat, xian_stats::next_stats, xian_float::numerator, xian_stat::saddr, xian_stats::stat, and xian_stat::value.
struct xian_float get_xian_stat | ( | unsigned char | macadd[IEEE80211_MAC_ADDR_LEN+1], | |
unsigned char | dev_name[IFNAMESIZ+1], | |||
unsigned int | id_conf, | |||
unsigned int * | code_err | |||
) | [read] |
This function returns the value of a metric.
macadd | MAC Address of a specified node formatted as follow XX:XX:XX:XX:XX:XX | |
dev_name | name of the network interface | |
id_conf | unsigned int representing the metric | |
code_err | output a code error if an error occurs. |
Definition at line 166 of file xmr.c.
References convert_mac_addr(), xian_float::denominator, ETH_ALEN, xian_stats::id_conf, macadd, xian_stat::next_stat, xian_stats::next_stats, xian_float::numerator, xian_stat::saddr, xian_stats::stat, strcmp_mac(), UNKNOW_METRIC, and xian_stat::value.
XIAN_EXPORT_SYMBOL | ( | get_xian_stat | ) |
void update_xian_stat | ( | unsigned char | saddr[IEEE80211_MAC_ADDR_LEN+1], | |
unsigned char | dev_name[IFNAMESIZ+1], | |||
unsigned int | id_conf, | |||
struct xian_float | value | |||
) |
This function updates the value of a metric.
saddr | MAC Address of a specified node formatted as follow XX:XX:XX:XX:XX:XX | |
dev_name | name of the network interface | |
id_conf | unsigned int representing the metric | |
value | the value of the metric to record |
Definition at line 207 of file xmr.c.
References convert_mac_addr(), ETH_ALEN, xian_stats::id_conf, INVALID_MAC_ADDR, xian_stat::next_stat, xian_stats::next_stats, NO_ERRORS, xian_stat::saddr, xian_stats::stat, strcmp_mac(), and xian_stat::value.
XIAN_EXPORT_SYMBOL | ( | update_xian_stat | ) |
void del_xian_stat | ( | unsigned char | dev_name[IFNAMESIZ+1], | |
unsigned int | id_conf | |||
) |
This function deletes the value of a metric.
dev_name | name of the network interface | |
id_conf | unsigned int representing the metric |
Definition at line 279 of file xmr.c.
References xian_stats::id_conf, xian_stat::next_stat, xian_stats::next_stats, and xian_stats::stat.
XIAN_EXPORT_SYMBOL | ( | del_xian_stat | ) |
module_init | ( | xian_stats_init | ) |
module_exit | ( | xian_stats_exit | ) |
struct xian_stats* stats |