/home/tai/chorist/xian-1.2/src/include/itm.h

Go to the documentation of this file.
00001 /*
00002  *  XIAN ITM - Information Transport Module
00003  *  Copyright (C) 2006 THALES Communications
00004  *
00005  *  This file is part of XIAN software.
00006  *
00007  *  XIAN is free software; you can redistribute it and/or modify it
00008  *  under the terms of the GNU General Public License as published by
00009  *  the Free Software Foundation.
00010  *
00011  *  XIAN software is distributed in the hope that it will be useful,
00012  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  *  GNU General Public License for more details.
00015  *
00016  *  You should have received a copy of the GNU General Public License
00017  *  along with XIAN software; if not, write to the Free Software
00018  *  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
00019  *
00020  *  */
00021 
00022 #ifndef _ITM_H
00023 #define _ITM_H
00024 
00025 #define NB_METRICS 10 //xian_proto.h
00026 
00027 /**************************************************************************************************
00028  * Define respectively the interface name size and the IEEE 802.11 Mac address length    
00029  *************************************************************************************************/
00030 
00031 #define IFNAMESIZ 16
00032 #define IEEE80211_MAC_ADDR_LEN 17
00033 #define ETH_ALEN 6
00034 
00035 /**************************************************************************************************
00036  * Define some params of the Cross-Layer communication through a unix device   
00037  *************************************************************************************************/
00038 
00039 #define CROSS_LAYER_DEV_NAME "xian_itm"
00040 #define CROSS_LAYER_DEV_NAME_PATH "/dev/xian_itm"
00041 #define BUF_LEN 150
00042 
00043 #define CROSS_LAYER_DEV_MAJOR 24
00044 
00045 /*************************************************************************************************
00046  * Define the type name for "struct_id" field in Cross-Layer Message structures   
00047  *************************************************************************************************/
00048 
00049 #define T_QOS_GENERIC_MSG          0
00050 #define T_QOS_METRIC_NODE_MSG      1
00051 #define T_QOS_METRIC_ATH_MSG       2 
00052 #define T_QOS_METRIC_NET80211_MSG  3
00053 #define T_QOS_METRIC_PROTO_MSG     4
00054 #define T_QOS_METRIC_STAT_MSG      5
00055 /**************************************************************************************************
00056  * Define the status name for "type_msg" field in Cross-Layer Message structures   
00057  **************************************************************************************************/
00058 
00059 #define T_QUERY_MSG 0
00060 #define T_RESPONSE_MSG 1
00061 #define T_ERROR_MSG 2
00062 #define T_SEND_MSG 3
00063 
00064 /**************************************************************************************************
00065  * Define the metric name defined for "metric_name" field in Cross-Layer Message structures 
00066  **************************************************************************************************/
00067 
00068 // PER NODE STATS
00069 
00070 #define NODE_RX_DATA                          0
00071 #define NODE_RX_MGMT                          1
00072 #define NODE_RX_CTRL                          2
00073 #define NODE_RX_UCAST                         3
00074 #define NODE_RX_MCAST                         4
00075 #define NODE_RX_BYTES                         5
00076 #define NODE_RX_BEACONS                       6
00077 #define NODE_RX_PROBERESP                     7
00078 #define NODE_RX_DUP                           8
00079 #define NODE_RX_NOPRIVACY                     9
00080 #define NODE_RX_WEPFAIL                       10
00081 #define NODE_RX_DEMICFAIL                     11
00082 #define NODE_RX_DECAP                         12
00083 #define NODE_RX_DEFRAG                        13
00084 #define NODE_RX_DISASSOC                      14
00085 #define NODE_RX_DEAUTH                        15
00086 #define NODE_RX_DECRYPTCRC                    16
00087 #define NODE_RX_UNAUTH                        17
00088 #define NODE_RX_UNENCRYPTED                   18
00089 
00090 #define NODE_TX_DATA                          19
00091 #define NODE_TX_MGMT                          20
00092 #define NODE_TX_UCAST                         21
00093 #define NODE_TX_MCAST                         22
00094 #define NODE_TX_BYTES                         23
00095 #define NODE_TX_PROBEREQ                      24
00096 #define NODE_TX_NOVLANTAG                     25
00097 #define NODE_TX_VLANMISMATCH                  26
00098 #define NODE_PS_DISCARD                       27
00099 #define NODE_TX_ASSOC                         28
00100 #define NODE_TX_ASSOC_FAIL                    29
00101 #define NODE_TX_AUTH                          30
00102 #define NODE_TX_AUTH_FAIL                     31
00103 #define NODE_TX_DEAUTH                        32
00104 #define NODE_TX_DEAUTH_CODE                   33
00105 #define NODE_TX_DISASSOC                      34
00106 #define NODE_TX_DISASSOC_CODE                 35
00107 
00108 #define NODE_TXPOWER                          36
00109 #define NODE_NEGOTIATED_RATE                  37
00110 #define NODE_RSSI                             38
00111 
00112 // ATH STATS
00113 
00114 #define AST_WATCHDOG                          39
00115 #define AST_HARDWARE                          40
00116 #define AST_BMISS                             41
00117 #define AST_BSTUCK                            42
00118 #define AST_RXORN                             43
00119 #define AST_RXEOL                             44
00120 #define AST_TXURN                             45
00121 #define AST_MIB                               46
00122 #define AST_INTRCOAL                          47
00123 #define AST_TX_PACKETS                        48
00124 #define AST_TX_MGMT                           49
00125 #define AST_TX_DISCARD                        50
00126 #define AST_TX_INVALID                        51
00127 #define AST_TX_QSTOP                          52
00128 #define AST_TX_ENCAP                          53
00129 #define AST_TX_NONODE                         54
00130 #define AST_TX_NOBUF                          55
00131 #define AST_TX_NOBUFMGT                       56
00132 #define AST_TX_LINEAR                         57
00133 #define AST_TX_NODATA                         58
00134 #define AST_TX_BUSDMA                         59
00135 #define AST_TX_XRETRIES                       60
00136 
00137 #define AST_TX_FIFOERR                        61
00138 #define AST_TX_FILTERED                       62
00139 #define AST_TX_SHORTRETRY                     63
00140 #define AST_TX_LONGRETRY                      64
00141 #define AST_TX_BADRATE                        65
00142 #define AST_TX_NOACK                          66
00143 #define AST_TX_RTS                            67
00144 #define AST_TX_CTS                            68
00145 #define AST_TX_SHORTPRE                       69
00146 #define AST_TX_ALTRATE                        70
00147 #define AST_TX_PROTECT                        71
00148 #define AST_TX_CTSBURST                       72
00149 #define AST_TX_CTSEXT                         73
00150 #define AST_RX_NOBUF                          74
00151 #define AST_RX_BUSDMA                         75
00152 #define AST_RX_ORN                            76
00153 #define AST_RX_CRCERR                         77
00154 #define AST_RX_FIFOERR                        78
00155 #define AST_RX_BADCRYPT                       79
00156 #define AST_RX_BADMIC                         80
00157 #define AST_RX_PHYERR                         81
00158 #define AST_RX_TOOSHORT                       82
00159 #define AST_RX_TOOBIG                         83
00160 #define AST_RX_PACKETS                        84
00161 #define AST_RX_MGT                            85
00162 #define AST_RX_CTL                            86
00163 #define AST_TX_RSSI                           87
00164 #define AST_RX_RSSI                           88
00165 #define AST_BE_XMIT                           89
00166 #define AST_BE_NOBUF                          90
00167 #define AST_PER_CAL                           91
00168 #define AST_PER_CALFAIL                       92
00169 #define AST_PER_RFGAIN                        93
00170 #define AST_RATE_CALLS                        94
00171 #define AST_RATE_RAISE                        95
00172 #define AST_RATE_DROP                         96
00173 #define AST_ANT_DEFSWITCH                     97
00174 #define AST_ANT_TXSWITCH                      98
00175 
00176 // IEEE 802.11 STATS
00177 
00178 #define IS_RX_BADVERSION                      99
00179 #define IS_RX_TOOSHORT                       100
00180 #define IS_RX_WRONGBSS                       101
00181 #define IS_RX_DUP                            102
00182 #define IS_RX_WRONGDIR                       103
00183 #define IS_RX_MCASTECHO                      104
00184 #define IS_RX_NOTASSOC                       105
00185 #define IS_RX_NOPRIVACY                      106
00186 #define IS_RX_UNENCRYPTED                    107
00187 #define IS_RX_WEPFAIL                        108
00188 #define IS_RX_DECAP                          109
00189 #define IS_RX_MGTDISCARD                     110
00190 #define IS_RX_CTL                            111
00191 #define IS_RX_BEACON                         112
00192 #define IS_RX_RSTOOBIG                       113
00193 #define IS_RX_ELEM_MISSING                   114
00194 #define IS_RX_ELEM_TOOBIG                    115
00195 #define IS_RX_ELEM_TOOSMALL                  116
00196 #define IS_RX_ELEM_UNKNOWN                   117
00197 #define IS_RX_BADCHAN                        118
00198 #define IS_RX_CHANMISMATCH                   119
00199 #define IS_RX_NODEALLOC                      120
00200 #define IS_RX_SSIDMISMATCH                   121
00201 #define IS_RX_AUTH_UNSUPPORTED               122
00202 #define IS_RX_AUTH_FAIL                      123
00203 #define IS_RX_AUTH_COUNTERMEASURES           124
00204 #define IS_RX_ASSOC_BSS                      125
00205 #define IS_RX_ASSOC_NOTAUTH                  126
00206 #define IS_RX_ASSOC_CAPMISMATCH              127
00207 #define IS_RX_ASSOC_NORATE                   128
00208 #define IS_RX_ASSOC_BADWPAIE                 129
00209 #define IS_RX_DEAUTH                         130
00210 #define IS_RX_DISASSOC                       131
00211 #define IS_RX_BADSUBTYPE                     132
00212 #define IS_RX_NOBUF                          133
00213 #define IS_RX_DECRYPTCRC                     134
00214 #define IS_RX_AHDEMO_MGT                     135
00215 #define IS_RX_BAD_AUTH                       136
00216 #define IS_RX_UNAUTH                         137
00217 #define IS_RX_BADKEYID                       138
00218 #define IS_RX_CCMPREPLAY                     139
00219 #define IS_RX_CCMPFORMAT                     140
00220 #define IS_RX_CCMPMIC                        141
00221 #define IS_RX_TKIPREPLAY                     142
00222 #define IS_RX_TKIPFORMAT                     143
00223 #define IS_RX_TKIPMIC                        144
00224 #define IS_RX_TKIPICV                        145
00225 #define IS_RX_BADCIPHER                      146
00226 #define IS_RX_NOCIPHERCTX                    147
00227 #define IS_RX_ACL                            148
00228 #define IS_TX_NOBUF                          149
00229 #define IS_TX_NONODE                         150
00230 #define IS_TX_UNKNOWNMGT                     151
00231 #define IS_TX_BADCIPHER                      152
00232 #define IS_TX_NODEFKEY                       153
00233 #define IS_TX_NOHEADROOM                     154
00234 #define IS_SCAN_ACTIVE                       155
00235 #define IS_SCAN_PASSIVE                      156
00236 #define IS_NODE_TIMEOUT                      157
00237 #define IS_CRYPTO_NOMEM                      158
00238 #define IS_CRYPTO_TKIP                       159
00239 #define IS_CRYPTO_TKIPENMIC                  160
00240 #define IS_CRYPTO_TKIPDEMIC                  161
00241 #define IS_CRYPTO_TKIPCM                     162
00242 #define IS_CRYPTO_CCMP                       163
00243 #define IS_CRYPTO_WEP                        164
00244 #define IS_CRYPTO_SETKEY_CIPHER              165
00245 #define IS_CRYPTO_SETKEY_NOKEY               166
00246 #define IS_CRYPTO_DELKEY                     167
00247 #define IS_CRYPTO_BADCIPHER                  168
00248 #define IS_CRYPTO_NOCIPHER                   169
00249 #define IS_CRYPTO_ATTACHFAIL                 170
00250 #define IS_CRYPTO_SWFALLBACK                 171
00251 #define IS_CRYPTO_KEYFAIL                    172
00252 #define IS_CRYPTO_ENMICFAIL                  173
00253 #define IS_IBSS_CAPMISMATCH                  174
00254 #define IS_IBSS_NORATE                       175
00255 #define IS_PS_UNASSOC                        176
00256 #define IS_PS_BADAID                         177
00257 #define IS_PS_QEMPTY                         178
00258 
00259 // PER NODE ONOE STATS
00260 
00261 #define NODE_ON_TX_ERR                       179
00262 #define NODE_ON_TX_OK                        180
00263 #define NODE_ON_TX_RETR                      181
00264 
00265 /**************************************************************************************************
00266  * Define the generic content structure of a Cross-Layer Message   
00267  *************************************************************************************************/
00268 
00269 struct qos_generic_msg 
00270 {
00271   unsigned long struct_id;
00272   unsigned long type_msg;
00273   char     dev_name[10];
00274   unsigned int id_error;
00275 };
00276 
00277 
00278 
00279 /**************************************************************************************
00280  * Define the content structures of a specific Cross-Layer Message   
00281  *************************************************************************************/
00282 
00283 enum type_metric_t 
00284 {
00285   NOTHING = 0, 
00286   INT8    = 1, 
00287   INT32   = 2, 
00288   INT64   = 3
00289 };
00290 
00291 
00292 struct qos_metric_node_msg
00293 {
00294   unsigned long struct_id;
00295   unsigned long type_msg;
00296   char     dev_name[IFNAMESIZ+1];
00297   unsigned int id_error;
00298   char macaddr[IEEE80211_MAC_ADDR_LEN+1];
00299   enum type_metric_t type_metric;  
00300   unsigned long metric_name;
00301   union 
00302   {
00303     u_int8_t  int8;
00304     u_int32_t int32;
00305     u_int64_t int64;
00306   } metric;
00307 };
00308 
00309 struct qos_metric_ath_msg
00310 {
00311   unsigned long struct_id;
00312   unsigned long type_msg;
00313   char     dev_name[IFNAMESIZ+1];
00314   unsigned int id_error;
00315   enum type_metric_t type_metric;  
00316   unsigned long metric_name;
00317   union 
00318   {
00319     u_int8_t  int8;
00320     u_int32_t int32;
00321     u_int64_t int64;
00322   } metric;
00323 };
00324 
00325 struct qos_metric_net80211_msg
00326 {
00327   unsigned long struct_id;
00328   unsigned long type_msg;
00329   char     dev_name[IFNAMESIZ+1];
00330   unsigned int id_error;
00331   enum type_metric_t type_metric;  
00332   unsigned long metric_name;
00333   union 
00334   {
00335     u_int8_t  int8;
00336     u_int32_t int32;
00337     u_int64_t int64;
00338   } metric;
00339 };
00340 
00341 struct xian_float{
00342   unsigned long long numerator;
00343   unsigned long long denominator;
00344 };
00345 
00346 struct qos_metric_proto_msg
00347 {
00348   unsigned long struct_id;
00349   unsigned long type_msg;
00350   char     dev_name[IFNAMESIZ+1];
00351   unsigned int id_error;
00352   unsigned int nb;
00353   char macaddr[IEEE80211_MAC_ADDR_LEN+1];
00354   enum type_metric_t type_metric;  
00355   unsigned int metric_name[NB_METRICS];
00356   unsigned int id[NB_METRICS];
00357   unsigned int encoding_type[NB_METRICS];
00358   unsigned char mac[NB_METRICS][ETH_ALEN];
00359   union 
00360   {
00361     u_int8_t  int8;
00362     u_int32_t int32;
00363     u_int64_t int64;//unsigned long long
00364     struct xian_float value;
00365   } metric[NB_METRICS];
00366 };
00367 
00368 struct qos_metric_stat_msg
00369 {
00370   unsigned long struct_id;
00371   unsigned long type_msg;
00372   char     dev_name[IFNAMESIZ+1];
00373   unsigned int id_error;
00374   char macaddr[IEEE80211_MAC_ADDR_LEN+1];
00375   enum type_metric_t type_metric;  
00376   unsigned int id;
00377   union 
00378   {
00379     u_int8_t  int8;
00380     u_int32_t int32;
00381     u_int64_t int64;//unsigned long long
00382     struct xian_float xian_float;//float
00383   } metric;
00384 };
00385 
00386 #endif

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