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


Detailed Description

The XNM (XIAN Neighbouring Manager) module - xnm.c.

The XIAN Neighbouring Module provides functions to access to the madwifi metrics and to update the list of active neighbors by sending xian messages and checking the good reception of xian messages from our active neighbors. Indeed, with MADwifi structure, it was hard and long to detect the disappearance of a node

Authors:
THALES Communications
Attention:
This module must be inserted before the MadWifi modules in order to intercept messages. provide the xian _table a table containing all the active XIAN neighbouring nodes of the considered XIAN node

Definition in file xnm.c.

#include <linux/module.h>
#include <linux/kernel.h>
#include <linux/init.h>
#include <linux/netdevice.h>
#include <linux/time.h>
#include "include/xian_proto.h"
#include "include/ksi.h"

Go to the source code of this file.

Data Structures

struct  neighbour_conf
struct  my_threads
 a structure to store all information we need for our thread More...

Functions

 MODULE_DESCRIPTION ("XIAN - Module XNM : XIAN Neighbouring Manager module")
 MODULE_LICENSE ("GPL")
struct neighbour_tablexian_timeout (struct neighbour_table *list, long timeout)
void xian_broadcast_neighbour (char *dev_name)
 This function allows to get the list of neighbours with their MAC address and constitutes the tab_mac_to_broadcast used when broadcasting the metric message.
 XIAN_EXPORT_SYMBOL (xian_broadcast_neighbour)
void xian_update_neighbour (char *dev_name)
 This function allows to fill in the tab_mac_to_broadcast and to process the XIAN table with the timeout neighbours s.
 XIAN_EXPORT_SYMBOL (xian_update_neighbour)
void xian_get_xian_neighbour (unsigned char *saddr)
 This function allows to fill in the tab_mac_to_broadcast and to process the XIAN table with the timeout neighbours s.
 XIAN_EXPORT_SYMBOL (xian_get_xian_neighbour)
void thread_neighbour (my_threads *thread)
 thread_neighbour is a thread function allowing to fill in the tab_mac_to_broadcast and to get an up to date XIAN table containing only the active neighbours
void treatment_neighbour (unsigned char *saddr, struct metric_msg *metric)
 Function invoked at the reception of a message This treatment allows the constitution of the XIAN_table with the list of active neighbours.In the future, the metric of the neighbors 2 could be stored.
 EXPORT_SYMBOL (treatment_neighbour)
void config (unsigned int metric)
 Function launch the registration of the metric with the call to the register_id function of the XMM with a given configuration (frequency of the metric reports,the nodes involved in the calculation, the formula or treatment function to calculate the metric unsigned int metric.
int xian_neighbour_init (void)
void xian_neighbour_exit (void)
 module_init (xian_neighbour_init)
 module_exit (xian_neighbour_exit)

Variables

char dev_name [IFNAMESIZ+1]
char macadd [IEEE80211_MAC_ADDR_LEN+1]
unsigned char my_mac [IEEE80211_MAC_ADDR_LEN+1]
struct neighbour_tablexian_table
struct neighbour_confparam
unsigned int metric = NODE_RSSI
my_threads neighbour_kthread


Function Documentation

MODULE_DESCRIPTION ( "XIAN - Module XNM : XIAN Neighbouring Manager module"   ) 

MODULE_LICENSE ( "GPL"   ) 

struct neighbour_table* xian_timeout ( struct neighbour_table list,
long  timeout 
) [read]

Definition at line 65 of file xnm.c.

References neighbour_table::macaddr, neighbour_table::next, and neighbour_table::timestamp.

Referenced by xian_update_neighbour().

void xian_broadcast_neighbour ( char *  dev_name  ) 

This function allows to get the list of neighbours with their MAC address and constitutes the tab_mac_to_broadcast used when broadcasting the metric message.

Parameters:
dev_name name of the network interface .
Returns:
void

Definition at line 96 of file xnm.c.

References free_mac_to_broadcast(), IEEE80211_MAC_ADDR_LEN, insert_mac_to_broadcast(), and TAILQ_FOREACH.

Referenced by xian_neighbour_init(), and xian_update_neighbour().

XIAN_EXPORT_SYMBOL ( xian_broadcast_neighbour   ) 

void xian_update_neighbour ( char *  dev_name  ) 

This function allows to fill in the tab_mac_to_broadcast and to process the XIAN table with the timeout neighbours s.

Parameters:
dev_name name of the network interface
Returns:
void

Definition at line 129 of file xnm.c.

References xian_broadcast_neighbour(), and xian_timeout().

Referenced by thread_neighbour().

XIAN_EXPORT_SYMBOL ( xian_update_neighbour   ) 

void xian_get_xian_neighbour ( unsigned char *  saddr  ) 

This function allows to fill in the tab_mac_to_broadcast and to process the XIAN table with the timeout neighbours s.

Parameters:
*saddr MAC address of the node sending the metric message
Returns:
void

Definition at line 142 of file xnm.c.

References IEEE80211_MAC_ADDR_LEN, neighbour_table::macaddr, neighbour_table::next, and neighbour_table::timestamp.

Referenced by treatment_neighbour().

XIAN_EXPORT_SYMBOL ( xian_get_xian_neighbour   ) 

void thread_neighbour ( my_threads thread  ) 

thread_neighbour is a thread function allowing to fill in the tab_mac_to_broadcast and to get an up to date XIAN table containing only the active neighbours

Definition at line 305 of file xnm.c.

References my_threads::data, neighbour_conf::freq_update, my_threads::terminate, and xian_update_neighbour().

Referenced by xian_neighbour_init().

void treatment_neighbour ( unsigned char *  saddr,
struct metric_msg metric 
)

Function invoked at the reception of a message This treatment allows the constitution of the XIAN_table with the list of active neighbours.In the future, the metric of the neighbors 2 could be stored.

.. You can also compute new metrics and store them in the XMR module.

Parameters:
*saddr MAC address of the node sending the metric message
*metric pointeur vers la structure metric_msg

Definition at line 343 of file xnm.c.

References xian_get_xian_neighbour().

Referenced by config().

EXPORT_SYMBOL ( treatment_neighbour   ) 

void config ( unsigned int  metric  ) 

Function launch the registration of the metric with the call to the register_id function of the XMM with a given configuration (frequency of the metric reports,the nodes involved in the calculation, the formula or treatment function to calculate the metric unsigned int metric.

Definition at line 356 of file xnm.c.

References my_mac, register_id(), and treatment_neighbour().

Referenced by xian_neighbour_init().

int xian_neighbour_init ( void   ) 

Definition at line 370 of file xnm.c.

References config(), metric, thread_neighbour(), and xian_broadcast_neighbour().

void xian_neighbour_exit ( void   ) 

Definition at line 390 of file xnm.c.

References metric, and unregister_id().

module_init ( xian_neighbour_init   ) 

module_exit ( xian_neighbour_exit   ) 


Variable Documentation

char dev_name[IFNAMESIZ+1]

Definition at line 40 of file xnm.c.

Referenced by get_metric(), get_qos_metric(), get_xian_stat_xian_float(), and register_id().

char macadd[IEEE80211_MAC_ADDR_LEN+1]

Definition at line 41 of file xnm.c.

Referenced by get_xian_stat(), and register_id().

unsigned char my_mac[IEEE80211_MAC_ADDR_LEN+1]

Definition at line 43 of file xnm.c.

Referenced by config().

struct neighbour_table* xian_table

Definition at line 45 of file xnm.c.

struct neighbour_conf* param

Definition at line 50 of file xnm.c.

unsigned int metric = NODE_RSSI

Definition at line 51 of file xnm.c.

Referenced by get_ast_ant_defswitch(), get_ast_ant_txswitch(), get_ast_be_nobuf(), get_ast_be_xmit(), get_ast_bmiss(), get_ast_bstuck(), get_ast_hardware(), get_ast_intrcoal(), get_ast_mib(), get_ast_per_cal(), get_ast_per_calfail(), get_ast_per_rfgain(), get_ast_rate_calls(), get_ast_rate_drop(), get_ast_rate_raise(), get_ast_rx_badcrypt(), get_ast_rx_badmic(), get_ast_rx_busdma(), get_ast_rx_crcerr(), get_ast_rx_ctl(), get_ast_rx_fifoerr(), get_ast_rx_mgt(), get_ast_rx_nobuf(), get_ast_rx_orn(), get_ast_rx_packets(), get_ast_rx_phyerr(), get_ast_rx_rssi(), get_ast_rx_toobig(), get_ast_rx_tooshort(), get_ast_rxeol(), get_ast_rxorn(), get_ast_tx_altrate(), get_ast_tx_badrate(), get_ast_tx_busdma(), get_ast_tx_cts(), get_ast_tx_ctsburst(), get_ast_tx_ctsext(), get_ast_tx_discard(), get_ast_tx_encap(), get_ast_tx_fifoerr(), get_ast_tx_filtered(), get_ast_tx_invalid(), get_ast_tx_linear(), get_ast_tx_longretry(), get_ast_tx_mgmt(), get_ast_tx_noack(), get_ast_tx_nobuf(), get_ast_tx_nobufmgt(), get_ast_tx_nodata(), get_ast_tx_nonode(), get_ast_tx_packets(), get_ast_tx_protect(), get_ast_tx_qstop(), get_ast_tx_rssi(), get_ast_tx_rts(), get_ast_tx_shortpre(), get_ast_tx_shortretry(), get_ast_tx_xretries(), get_ast_txurn(), get_ast_watchdog(), get_is_crypto_attachfail(), get_is_crypto_badcipher(), get_is_crypto_ccmp(), get_is_crypto_delkey(), get_is_crypto_enmicfail(), get_is_crypto_keyfail(), get_is_crypto_nocipher(), get_is_crypto_nomem(), get_is_crypto_setkey_cipher(), get_is_crypto_setkey_nokey(), get_is_crypto_swfallback(), get_is_crypto_tkip(), get_is_crypto_tkipcm(), get_is_crypto_tkipdemic(), get_is_crypto_tkipenmic(), get_is_crypto_wep(), get_is_ibss_capmismatch(), get_is_ibss_norate(), get_is_node_timeout(), get_is_ps_badaid(), get_is_ps_qempty(), get_is_ps_unassoc(), get_is_rx_acl(), get_is_rx_ahdemo_mgt(), get_is_rx_assoc_badwpaie(), get_is_rx_assoc_bss(), get_is_rx_assoc_capmismatch(), get_is_rx_assoc_norate(), get_is_rx_assoc_notauth(), get_is_rx_auth_countermeasures(), get_is_rx_auth_fail(), get_is_rx_auth_unsupported(), get_is_rx_bad_auth(), get_is_rx_badchan(), get_is_rx_badcipher(), get_is_rx_badkeyid(), get_is_rx_badsubtype(), get_is_rx_badversion(), get_is_rx_beacon(), get_is_rx_ccmpformat(), get_is_rx_ccmpmic(), get_is_rx_ccmpreplay(), get_is_rx_chanmismatch(), get_is_rx_ctl(), get_is_rx_deauth(), get_is_rx_decap(), get_is_rx_decryptcrc(), get_is_rx_disassoc(), get_is_rx_dup(), get_is_rx_elem_missing(), get_is_rx_elem_toobig(), get_is_rx_elem_toosmall(), get_is_rx_elem_unknown(), get_is_rx_mcastecho(), get_is_rx_mgtdiscard(), get_is_rx_nobuf(), get_is_rx_nocipherctx(), get_is_rx_nodealloc(), get_is_rx_noprivacy(), get_is_rx_notassoc(), get_is_rx_rstoobig(), get_is_rx_ssidmismatch(), get_is_rx_tkipformat(), get_is_rx_tkipicv(), get_is_rx_tkipmic(), get_is_rx_tkipreplay(), get_is_rx_tooshort(), get_is_rx_unauth(), get_is_rx_unencrypted(), get_is_rx_wepfail(), get_is_rx_wrongbss(), get_is_rx_wrongdir(), get_is_scan_active(), get_is_scan_passive(), get_is_tx_badcipher(), get_is_tx_nobuf(), get_is_tx_nodefkey(), get_is_tx_noheadroom(), get_is_tx_nonode(), get_is_tx_unknownmgt(), get_metric(), get_node_negotiated_rate(), get_node_on_tx_err(), get_node_on_tx_ok(), get_node_on_tx_retr(), get_node_rssi(), get_node_txpower(), xian_neighbour_exit(), and xian_neighbour_init().

my_threads neighbour_kthread

Definition at line 211 of file xnm.c.


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