00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022 #ifndef __AWHANDLER_NETIF__
00023 #define __AWHANDLER_NETIF__
00024
00025 #include "monitor.h"
00026 #include "wire.h"
00027
00190
00191
00192
00193
00194
00195
00196
00197
00198
00199
00200
00204 typedef struct {
00205
00206 aw_event_sig_t
00207 rate,
00208 bytes,
00209 packets,
00210 errs,
00211 drop,
00212 fifo,
00213 frame,
00214 compz,
00215 multi;
00216
00217 } aw_netifhandler_rxevents_t;
00218
00222 typedef struct {
00223
00224 aw_event_sig_t
00225 rate,
00226 bytes,
00227 packets,
00228 errs,
00229 drop,
00230 fifo,
00231 colls,
00232 carrier,
00233 compz;
00234
00235 } aw_netifhandler_txevents_t;
00236
00240 typedef struct {
00241
00242 aw_event_sig_t
00243 down;
00244
00245 aw_netifhandler_rxevents_t
00246 rx;
00247
00248 aw_netifhandler_txevents_t
00249 tx;
00250
00251 } aw_netifhandler_events_t;
00252
00256 typedef struct {
00257
00258
00259 int64_t
00260 last_rx_bytes,
00261 last_tx_bytes;
00262
00263
00264 aw_timestamp_t
00265 last_handlertime;
00266
00267 } aw_netifhandler_state_t;
00268
00272 typedef struct {
00273
00274 aw_handler_t
00275 handler_header;
00276
00277 aw_netifhandler_events_t
00278 events;
00279
00280
00281 byte_t
00282 *dev;
00283
00284
00285 byte_t
00286 devlen;
00287
00288 aw_netifhandler_state_t
00289 state;
00290
00291 } aw_netifhandler_t ;
00292
00303 aw_netifhandler_t *aw_create_netifhandler(const aw_netifhandler_events_t *events,
00304 const byte_t *dev,
00305 int32_t (*regevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00306 int32_t (*regmaskevent)(aw_handler_t *h, aw_address_t *eventid, u_int32_t index),
00307 const aw_alarm_sched_t *sched,
00308 aw_logger_t *logger
00309 );
00310
00315 void aw_free_netifhandler(aw_netifhandler_t *p);
00316
00320 aw_handler_t *aw_wire_netifhandler(aw_wire_mkhandler_args_t *args);
00321
00322 #endif