52 |
}, |
}, |
53 |
#ifdef USE_SNMP |
#ifdef USE_SNMP |
54 |
{ "SNMP", 0, MAX_REQUEST_TIME, 0, |
{ "SNMP", 0, MAX_REQUEST_TIME, 0, |
55 |
snmp_decode, /* Decoder */ |
snmp_req_decode, /* Decoder */ |
56 |
snmp_answer, /* Handler */ |
snmp_req_respond, /* Handler */ |
57 |
NULL, /* Retransmitter */ |
NULL, /* Retransmitter */ |
58 |
snmp_req_cmp, /* Comparator */ |
snmp_req_cmp, /* Comparator */ |
59 |
snmp_req_free, /* Deallocator */ |
snmp_req_free, /* Deallocator */ |
60 |
snmp_req_drop, /* Drop function */ |
snmp_req_drop, /* Drop function */ |
61 |
NULL, /* Cleanup function */ |
NULL, /* Cleanup function */ |
62 |
NULL, /* Failure indicator */ |
NULL, /* Failure indicator */ |
63 |
NULL, |
NULL, |
64 |
}, |
}, |
65 |
#endif |
#endif |
359 |
} |
} |
360 |
return NULL; |
return NULL; |
361 |
} |
} |
362 |
|
|
363 |
|
static int |
364 |
|
_count_stat(void *item, void *data) |
365 |
|
{ |
366 |
|
REQUEST *req = item; |
367 |
|
QUEUE_STAT *stat = data; |
368 |
|
switch (req->status) { |
369 |
|
case RS_COMPLETED: |
370 |
|
(*stat)[req->type].completed++; |
371 |
|
break; |
372 |
|
|
373 |
|
case RS_PROXY: |
374 |
|
(*stat)[req->type].pending++; /*FIXME: Rename? */ |
375 |
|
break; |
376 |
|
|
377 |
|
case RS_WAITING: |
378 |
|
(*stat)[req->type].waiting++; |
379 |
|
break; |
380 |
|
} |
381 |
|
return 0; |
382 |
|
} |
383 |
|
|
384 |
|
int |
385 |
|
request_stat_list(QUEUE_STAT stat) |
386 |
|
{ |
387 |
|
memset(stat, 0, sizeof(QUEUE_STAT)); |
388 |
|
list_iterate(request_list, _count_stat, &stat); |
389 |
|
return 0; |
390 |
|
} |
391 |
|
|