/[radius]/radius/radiusd/request.c
ViewVC logotype

Diff of /radius/radiusd/request.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.27 by gray, Fri Apr 25 22:50:09 2003 UTC revision 1.28 by gray, Sun Apr 27 17:08:26 2003 UTC
# Line 52  struct request_class request_class[] = { Line 52  struct request_class request_class[] = {
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
# Line 359  request_scan_list(int type, list_iterato Line 359  request_scan_list(int type, list_iterato
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            

Legend:
Removed from v.1.27  
changed lines
  Added in v.1.28

savannah-hackers-public@gnu.org
ViewVC Help
Powered by ViewVC 1.1.26