| 1 |
/* |
| 2 |
* Family 0x000b - Statistics. |
| 3 |
* |
| 4 |
*/ |
| 5 |
|
| 6 |
#define FAIM_INTERNAL |
| 7 |
#include <aim.h> |
| 8 |
|
| 9 |
static int reportinterval(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
| 10 |
{ |
| 11 |
int ret = 0; |
| 12 |
aim_rxcallback_t userfunc; |
| 13 |
fu16_t interval; |
| 14 |
|
| 15 |
interval = aimbs_get16(bs); |
| 16 |
|
| 17 |
if ((userfunc = aim_callhandler(sess, rx->conn, snac->family, snac->subtype))) |
| 18 |
ret = userfunc(sess, rx, interval); |
| 19 |
|
| 20 |
return ret; |
| 21 |
} |
| 22 |
|
| 23 |
static int snachandler(aim_session_t *sess, aim_module_t *mod, aim_frame_t *rx, aim_modsnac_t *snac, aim_bstream_t *bs) |
| 24 |
{ |
| 25 |
|
| 26 |
if (snac->subtype == 0x0002) |
| 27 |
return reportinterval(sess, mod, rx, snac, bs); |
| 28 |
|
| 29 |
return 0; |
| 30 |
} |
| 31 |
|
| 32 |
faim_internal int stats_modfirst(aim_session_t *sess, aim_module_t *mod) |
| 33 |
{ |
| 34 |
|
| 35 |
mod->family = 0x000b; |
| 36 |
mod->version = 0x0001; |
| 37 |
mod->toolid = 0x0104; |
| 38 |
mod->toolversion = 0x0001; |
| 39 |
mod->flags = 0; |
| 40 |
strncpy(mod->name, "stats", sizeof(mod->name)); |
| 41 |
mod->snachandler = snachandler; |
| 42 |
|
| 43 |
return 0; |
| 44 |
} |