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
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_log * | lookup_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_log * | new_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 node * | lookup_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 node * | new_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_dev * | lookup_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_dev * | new_net_dev (char *dev_name) |
This function allows to create a new local network device. |
#define DEF_NET_DEV_LIST |
Definition at line 32 of file usei-log.c.
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.
value | new metric value to add | |
tab | list Log Values Metrics Array |
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.
entry | a pointer to new metric type to add | |
list | Metrics Types List |
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.
id_metric | metric type id | |
list | Metrics Types List |
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.
list | Metrics Types List |
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.
id_metric | 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.
This function allows to add a new node into Nodes List.
entry | a pointer to new node to add | |
list | Node List |
Definition at line 154 of file usei-log.c.
References node::next.
This function allows to lookup a node from Nodes List in function of its mac address.
mac_addr | mac address of node to look up, formatted as follow XX:XX:XX:XX:XX:XX | |
list | Nodes List |
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.
list | Nodes List |
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.
mac_addr | Remote node Mac address formatted as follow XX:XX:XX:XX:XX:XX |
Definition at line 210 of file usei-log.c.
References node::list_metric_log, node::mac_addr, and node::next.
This function allows to add a new local network device into Local Network Devices List.
entry | a pointer to new local network device | |
list | Local Network Devices List |
Definition at line 235 of file usei-log.c.
References net_dev::next.
This function allows to lookup a local network device from Local Network Devices List in function of device name.
dev_name | local network device name | |
list | Local Network Devices List |
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.
list | Local Network Devices List |
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.
dev_name | local network device name |
Definition at line 294 of file usei-log.c.
References net_dev::dev_name, net_dev::list_node, and net_dev::next.