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


Detailed Description

The XIAN USEI LOG - User Space XIAN Extended API.

This file provides mechanisms to log metrics.

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

Authors:
THALES Communications

Definition in file usei-log.c.

#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include "include/usei-log.h"

Go to the source code of this file.

Defines

#define DEF_NET_DEV_LIST

Functions

void set_new_value_metric (unsigned long long value, unsigned long long tab[])
 This function allows to add a new metric value for a given metric type into a Log Values Metrics Array.
void add_metric (struct metrics_log *entry, struct metrics_log **list)
 This function allows to add a new metric type into Metrics Types List.
struct metrics_loglookup_metric (unsigned int id_metric, struct metrics_log *list)
 This function allows to lookup a metric type from Metrics Types List in function of its id.
void print_log_metrics_list (struct metrics_log *list)
 This function allows to print Metrics Types List.
struct metrics_lognew_metric (unsigned int id_metric)
 This function allows to create a new metric type.
void add_node (struct node *entry, struct node **list)
 This function allows to add a new node into Nodes List.
struct nodelookup_node (char *mac_addr, struct node *list)
 This function allows to lookup a node from Nodes List in function of its mac address.
void print_node_list (struct node *list)
 This function allows to print Nodes List.
struct nodenew_node (char *mac_addr)
 This function allows to create a new node.
void add_net_dev (struct net_dev *entry, struct net_dev **list)
 This function allows to add a new local network device into Local Network Devices List.
struct net_devlookup_net_dev (char *dev_name, struct net_dev *list)
 This function allows to lookup a local network device from Local Network Devices List in function of device name.
void print_net_dev_list (struct net_dev *list)
 This function allows to print Local Network Devices List.
struct net_devnew_net_dev (char *dev_name)
 This function allows to create a new local network device.


Define Documentation

#define DEF_NET_DEV_LIST

Definition at line 32 of file usei-log.c.


Function Documentation

void set_new_value_metric ( unsigned long long  value,
unsigned long long  tab[] 
)

This function allows to add a new metric value for a given metric type into a Log Values Metrics Array.

Parameters:
value new metric value to add
tab list Log Values Metrics Array
Returns:
-

Definition at line 43 of file usei-log.c.

References MAX_METRIC_VALUES.

void add_metric ( struct metrics_log entry,
struct metrics_log **  list 
)

This function allows to add a new metric type into Metrics Types List.

Parameters:
entry a pointer to new metric type to add
list Metrics Types List
Returns:
-

Definition at line 64 of file usei-log.c.

References metrics_log::next.

struct metrics_log* lookup_metric ( unsigned int  id_metric,
struct metrics_log list 
) [read]

This function allows to lookup a metric type from Metrics Types List in function of its id.

Parameters:
id_metric metric type id
list Metrics Types List
Returns:
metrics_log a pointer to metric type if found, NULL otherwise

Definition at line 81 of file usei-log.c.

References metrics_log::id_metric, and metrics_log::next.

void print_log_metrics_list ( struct metrics_log list  ) 

This function allows to print Metrics Types List.

Parameters:
list Metrics Types List
Returns:
-

Definition at line 102 of file usei-log.c.

References metrics_log::id_metric, metrics_log::last_values, MAX_METRIC_VALUES, and metrics_log::next.

struct metrics_log* new_metric ( unsigned int  id_metric  )  [read]

This function allows to create a new metric type.

Parameters:
id_metric metric type
Returns:
metric_log a pointer to the new created metric type

Definition at line 125 of file usei-log.c.

References metrics_log::id_metric, metrics_log::last_values, MAX_METRIC_VALUES, and metrics_log::next.

void add_node ( struct node entry,
struct node **  list 
)

This function allows to add a new node into Nodes List.

Parameters:
entry a pointer to new node to add
list Node List
Returns:
-

Definition at line 154 of file usei-log.c.

References node::next.

struct node* lookup_node ( char *  mac_addr,
struct node list 
) [read]

This function allows to lookup a node from Nodes List in function of its mac address.

Parameters:
mac_addr mac address of node to look up, formatted as follow XX:XX:XX:XX:XX:XX
list Nodes List
Returns:
node a pointer to node if found, NULL otherwise

Definition at line 171 of file usei-log.c.

References node::mac_addr, and node::next.

void print_node_list ( struct node list  ) 

This function allows to print Nodes List.

Parameters:
list Nodes List
Returns:
-

Definition at line 191 of file usei-log.c.

References node::list_metric_log, node::mac_addr, node::next, and print_log_metrics_list().

struct node* new_node ( char *  mac_addr  )  [read]

This function allows to create a new node.

Parameters:
mac_addr Remote node Mac address formatted as follow XX:XX:XX:XX:XX:XX
Returns:
node a pointer to the new created node

Definition at line 210 of file usei-log.c.

References node::list_metric_log, node::mac_addr, and node::next.

void add_net_dev ( struct net_dev entry,
struct net_dev **  list 
)

This function allows to add a new local network device into Local Network Devices List.

Parameters:
entry a pointer to new local network device
list Local Network Devices List
Returns:
-

Definition at line 235 of file usei-log.c.

References net_dev::next.

struct net_dev* lookup_net_dev ( char *  dev_name,
struct net_dev list 
) [read]

This function allows to lookup a local network device from Local Network Devices List in function of device name.

Parameters:
dev_name local network device name
list Local Network Devices List
Returns:
net_dev a pointer to local network device name if found, NULL otherwise

Definition at line 252 of file usei-log.c.

References net_dev::dev_name, and net_dev::next.

void print_net_dev_list ( struct net_dev list  ) 

This function allows to print Local Network Devices List.

Parameters:
list Local Network Devices List
Returns:
-

Definition at line 275 of file usei-log.c.

References net_dev::dev_name, net_dev::list_node, net_dev::next, and print_node_list().

struct net_dev* new_net_dev ( char *  dev_name  )  [read]

This function allows to create a new local network device.

Parameters:
dev_name local network device name
Returns:
net_dev a pointer to a new created local network device

Definition at line 294 of file usei-log.c.

References net_dev::dev_name, net_dev::list_node, and net_dev::next.


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