/home/tai/chorist/xian-1.2/src/xmr.c File Reference


Detailed Description

The XMR (XIAN Metric Repository) Module - xmr.c.

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

Authors:
THALES Communications

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_statsstats


Function Documentation

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.

Parameters:
a a struct xian_float
b a struct xian_float
Returns:
struct xian_float the result of the addition

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.

Parameters:
a a struct xian_float
b a struct xian_float
Returns:
struct xian_float the result of the multiplication

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.

Parameters:
a a struct xian_float
b a struct xian_float
Returns:
struct xian_float the result of the division

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.

Parameters:
a a struct xian_float
b a struct xian_float
Returns:
int 1 if a>b, -1 if a<b and 0 if a=b

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).

Parameters:
x an int
Returns:
struct xian_float x/1

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.

Parameters:
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.
Returns:
struct xian_float the value of the metric

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.

Parameters:
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
Returns:
-

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.

Parameters:
dev_name name of the network interface
id_conf unsigned int representing the metric
Returns:
-

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   ) 

int xian_stats_init ( void   ) 

Definition at line 311 of file xmr.c.

void xian_stats_exit ( void   ) 

Definition at line 317 of file xmr.c.

module_init ( xian_stats_init   ) 

module_exit ( xian_stats_exit   ) 


Variable Documentation

struct xian_stats* stats

Definition at line 40 of file xmr.c.


Generated on Mon Jan 21 12:31:48 2008 for XIAN by  doxygen 1.5.3