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


Detailed Description

The XIAN USEI - User Space XIAN Extended API.

Copyright (C) 2006 THALES Communications

This file is part of XIAN software.

XIAN is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation.

XIAN software is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with XIAN software; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

Definition in file usei-functions.c.

#include <stdlib.h>
#include <stdio.h>
#include "include/usi.h"
#include "include/usei.h"
#include "include/usei-functions.h"

Go to the source code of this file.

Functions

void print_error (unsigned int error_type)
 This function allows to print an error message matching a code error.
struct
qos_metric_measurement 
get_qos_metric (unsigned int type, char *macaddr, char *dev_name, unsigned int *code_err)
 This function allows to get a QOS Link Metric.
unsigned int metrics_operation (struct qos_metric_measurement qos_metric_1, struct qos_metric_measurement qos_metric_2, struct qos_metric_measurement *qos_metric_result)
 This function allows to do an operation between 2 QOS Link Metrics of the same type.
unsigned int is_relevant_metric (struct qos_metric_measurement qos_metric_new, struct qos_metric_measurement qos_metric_old)
 This function allows to identify if a new QOS Metric Link is revelant or not.


Function Documentation

void print_error ( unsigned int  error_type  ) 

This function allows to print an error message matching a code error.

Parameters:
error_type code error
Returns:
-

Definition at line 42 of file usei-functions.c.

References COULD_NOT_OPEN_UNIX_DEV, COULD_NOT_READ_UNIX_DEV, DEV_NAME_NOT_DEFINED, DEV_NOT_FOUND, INVALID_MAC_ADDR, MAC_ADDR_NOT_DEFINED, NEIGHBOR_NOT_FOUND, NO_ERRORS, NOT_A_QUERY_MSG, UNKNOW_METRIC, and UNKNOW_QUERY.

struct qos_metric_measurement get_qos_metric ( unsigned int  type,
char *  macaddr,
char *  dev_name,
unsigned int *  code_err 
) [read]

This function allows to get a QOS Link Metric.

Parameters:
type (a number) of the metric
macaddr MAC Address of a specified node formatted as follow XX:XX:XX:XX:XX:XX
dev_name name of the network interface
code_err output a code error if an error occurs.
Returns:
qos_metric_measurement the metric formated in qos_metric_measurement structure

Definition at line 97 of file usei-functions.c.

References dev_name, get_node_avg_delta_occupancy(), get_node_avg_rssi(), get_node_avg_tx_failure_rate(), get_node_rssi(), LINK_AVG_DELTA_OCCUPANCY_ADD, LINK_AVG_DELTA_OCCUPANCY_MAX, LINK_AVG_RSSI, LINK_FAILURE_RATE_MAX, LINK_FAILURE_RATE_MUL, LINK_RSSI_ADD, qos_metric_measurement::metric_sub_unit, qos_metric_measurement::metric_unit, and qos_metric_measurement::type.

unsigned int metrics_operation ( struct qos_metric_measurement  qos_metric_1,
struct qos_metric_measurement  qos_metric_2,
struct qos_metric_measurement qos_metric_result 
)

This function allows to do an operation between 2 QOS Link Metrics of the same type.

Parameters:
qos_metric_1 
qos_metric_2 
qos_metric_result result of the operation
Returns:
int 0 if an error occured (metrics aren't in same type), 1 otherwise

Definition at line 175 of file usei-functions.c.

References LINK_AVG_DELTA_OCCUPANCY_ADD, LINK_AVG_DELTA_OCCUPANCY_MAX, LINK_AVG_RSSI, LINK_FAILURE_RATE_MAX, LINK_FAILURE_RATE_MUL, LINK_RSSI_ADD, qos_metric_measurement::metric_sub_unit, qos_metric_measurement::metric_unit, and qos_metric_measurement::type.

unsigned int is_relevant_metric ( struct qos_metric_measurement  qos_metric_new,
struct qos_metric_measurement  qos_metric_old 
)

This function allows to identify if a new QOS Metric Link is revelant or not.

Parameters:
qos_metric_new new QOS Metric Link
qos_metric_old old QOS Metric Link
Returns:
-

int 1 if the new QOS Metric Link is revelant, 0 otherwise

Definition at line 253 of file usei-functions.c.

References LINK_AVG_DELTA_OCCUPANCY_ADD, LINK_AVG_DELTA_OCCUPANCY_MAX, LINK_AVG_RSSI, LINK_FAILURE_RATE_MAX, LINK_FAILURE_RATE_MUL, LINK_RSSI_ADD, qos_metric_measurement::metric_unit, and qos_metric_measurement::type.


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