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

Diff of /radius/radiusd/snmpserv.c

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

revision 1.63 by gray, Tue Jun 17 16:13:00 2003 UTC revision 1.64 by gray, Thu Jun 19 12:39:42 2003 UTC
# Line 142  struct acl_closure { Line 142  struct acl_closure {
142  };  };
143    
144  int  int
145  _netdef_cmp(void *item, void *data)  _netdef_cmp(const void *item, const void *data)
146  {  {
147          NETDEF *nd = item;          const NETDEF *nd = item;
148          struct acl_closure *clos = data;          const struct acl_closure *clos = data;
149    
150          if (nd->ipaddr == (clos->ip & nd->netmask))          if (nd->ipaddr == (clos->ip & nd->netmask))
151                  return 0;                  return 0;
# Line 243  snmp_cfg_ident(int argc, cfg_value_t *ar Line 243  snmp_cfg_ident(int argc, cfg_value_t *ar
243  }  }
244    
245  static struct keyword snmp_access[] = {  static struct keyword snmp_access[] = {
246          "read-only", SNMP_RO,          { "read-only", SNMP_RO },
247          "read-write", SNMP_RW,          { "read-write", SNMP_RW },
248          "ro", SNMP_RO,          { "ro", SNMP_RO },
249          "rw", SNMP_RW,          { "rw", SNMP_RW },
250          0          { 0 }
251  };  };
252    
253  static int  static int
# Line 560  static struct mib_data { Line 560  static struct mib_data {
560  } mib_data[] = {  } mib_data[] = {
561          /* Authentication */          /* Authentication */
562          /* Fixed oids */          /* Fixed oids */
563          oid_AuthServIdent,                   snmp_auth_handler, NULL,          { oid_AuthServIdent,                   snmp_auth_handler, NULL },
564          oid_AuthServUpTime,                  snmp_auth_handler, NULL,          { oid_AuthServUpTime,                  snmp_auth_handler, NULL },
565          oid_AuthServResetTime,               snmp_auth_handler, NULL,          { oid_AuthServResetTime,               snmp_auth_handler, NULL },
566          oid_AuthServConfigReset,             snmp_auth_handler, NULL,          { oid_AuthServConfigReset,             snmp_auth_handler, NULL },
567          oid_AuthServTotalAccessRequests,     snmp_auth_handler, NULL,          { oid_AuthServTotalAccessRequests,     snmp_auth_handler, NULL },
568          oid_AuthServTotalInvalidRequests,    snmp_auth_handler, NULL,          { oid_AuthServTotalInvalidRequests,    snmp_auth_handler, NULL },
569          oid_AuthServTotalDupAccessRequests,  snmp_auth_handler, NULL,          { oid_AuthServTotalDupAccessRequests,  snmp_auth_handler, NULL },
570          oid_AuthServTotalAccessAccepts,      snmp_auth_handler, NULL,          { oid_AuthServTotalAccessAccepts,      snmp_auth_handler, NULL },
571          oid_AuthServTotalAccessRejects,      snmp_auth_handler, NULL,          { oid_AuthServTotalAccessRejects,      snmp_auth_handler, NULL },
572          oid_AuthServTotalAccessChallenges,   snmp_auth_handler, NULL,          { oid_AuthServTotalAccessChallenges,   snmp_auth_handler, NULL },
573          oid_AuthServTotalMalformedAccessRequests,          { oid_AuthServTotalMalformedAccessRequests,
574                                               snmp_auth_handler, NULL,                                               snmp_auth_handler, NULL },
575          oid_AuthServTotalBadAuthenticators,  snmp_auth_handler, NULL,          { oid_AuthServTotalBadAuthenticators,  snmp_auth_handler, NULL },
576          oid_AuthServTotalPacketsDropped,     snmp_auth_handler, NULL,          { oid_AuthServTotalPacketsDropped,     snmp_auth_handler, NULL },
577          oid_AuthServTotalUnknownTypes,       snmp_auth_handler, NULL,          { oid_AuthServTotalUnknownTypes,       snmp_auth_handler, NULL },
578    
579          /* Variable oids */          /* Variable oids */
580          oid_AuthClientIndex,                 snmp_auth_v_handler,NULL,          { oid_AuthClientIndex,                 snmp_auth_v_handler,NULL },
581          oid_AuthClientAddress,               snmp_auth_v_handler,NULL,          { oid_AuthClientAddress,               snmp_auth_v_handler,NULL },
582          oid_AuthClientID,                    snmp_auth_v_handler,NULL,          { oid_AuthClientID,                    snmp_auth_v_handler,NULL },
583          oid_AuthServAccessRequests,          snmp_auth_v_handler,NULL,          { oid_AuthServAccessRequests,          snmp_auth_v_handler,NULL },
584          oid_AuthServDupAccessRequests,       snmp_auth_v_handler,NULL,          { oid_AuthServDupAccessRequests,       snmp_auth_v_handler,NULL },
585          oid_AuthServAccessAccepts,           snmp_auth_v_handler,NULL,          { oid_AuthServAccessAccepts,           snmp_auth_v_handler,NULL },
586          oid_AuthServAccessRejects,           snmp_auth_v_handler,NULL,          { oid_AuthServAccessRejects,           snmp_auth_v_handler,NULL },
587          oid_AuthServAccessChallenges,        snmp_auth_v_handler,NULL,          { oid_AuthServAccessChallenges,        snmp_auth_v_handler,NULL },
588          oid_AuthServMalformedAccessRequests, snmp_auth_v_handler,NULL,          { oid_AuthServMalformedAccessRequests, snmp_auth_v_handler,NULL },
589          oid_AuthServBadAuthenticators,       snmp_auth_v_handler,NULL,          { oid_AuthServBadAuthenticators,       snmp_auth_v_handler,NULL },
590          oid_AuthServPacketsDropped,          snmp_auth_v_handler,NULL,          { oid_AuthServPacketsDropped,          snmp_auth_v_handler,NULL },
591          oid_AuthServUnknownTypes,            snmp_auth_v_handler,NULL,          { oid_AuthServUnknownTypes,            snmp_auth_v_handler,NULL },
592                    
593          /* Accounting */          /* Accounting */
594          /* Fixed oids */          /* Fixed oids */
595          oid_AccServIdent,                    snmp_acct_handler, NULL,          { oid_AccServIdent,                    snmp_acct_handler, NULL },
596          oid_AccServUpTime,                   snmp_acct_handler, NULL,          { oid_AccServUpTime,                   snmp_acct_handler, NULL },
597          oid_AccServResetTime,                snmp_acct_handler, NULL,          { oid_AccServResetTime,                snmp_acct_handler, NULL },
598          oid_AccServConfigReset,              snmp_acct_handler, NULL,          { oid_AccServConfigReset,              snmp_acct_handler, NULL },
599          oid_AccServTotalRequests,            snmp_acct_handler, NULL,          { oid_AccServTotalRequests,            snmp_acct_handler, NULL },
600          oid_AccServTotalInvalidRequests,     snmp_acct_handler, NULL,              { oid_AccServTotalInvalidRequests,     snmp_acct_handler, NULL },    
601          oid_AccServTotalDupRequests,         snmp_acct_handler, NULL,                { oid_AccServTotalDupRequests,         snmp_acct_handler, NULL },      
602          oid_AccServTotalResponses,           snmp_acct_handler, NULL,                { oid_AccServTotalResponses,           snmp_acct_handler, NULL },      
603          oid_AccServTotalMalformedRequests,   snmp_acct_handler, NULL,                { oid_AccServTotalMalformedRequests,   snmp_acct_handler, NULL },      
604          oid_AccServTotalBadAuthenticators,   snmp_acct_handler, NULL,                { oid_AccServTotalBadAuthenticators,   snmp_acct_handler, NULL },      
605          oid_AccServTotalPacketsDropped,      snmp_acct_handler, NULL,                { oid_AccServTotalPacketsDropped,      snmp_acct_handler, NULL },      
606          oid_AccServTotalNoRecords,           snmp_acct_handler, NULL,                { oid_AccServTotalNoRecords,           snmp_acct_handler, NULL },      
607          oid_AccServTotalUnknownTypes,        snmp_acct_handler, NULL,                { oid_AccServTotalUnknownTypes,        snmp_acct_handler, NULL },      
608    
609          /* Variable oids */          /* Variable oids */
610          oid_AccClientIndex,                  snmp_acct_v_handler,NULL,          { oid_AccClientIndex,                  snmp_acct_v_handler,NULL },
611          oid_AccClientAddress,                snmp_acct_v_handler,NULL,          { oid_AccClientAddress,                snmp_acct_v_handler,NULL },
612          oid_AccClientID,                     snmp_acct_v_handler,NULL,          { oid_AccClientID,                     snmp_acct_v_handler,NULL },
613          oid_AccServPacketsDropped,           snmp_acct_v_handler,NULL,          { oid_AccServPacketsDropped,           snmp_acct_v_handler,NULL },
614          oid_AccServRequests,                 snmp_acct_v_handler,NULL,          { oid_AccServRequests,                 snmp_acct_v_handler,NULL },
615          oid_AccServDupRequests,              snmp_acct_v_handler,NULL,          { oid_AccServDupRequests,              snmp_acct_v_handler,NULL },
616          oid_AccServResponses,                snmp_acct_v_handler,NULL,          { oid_AccServResponses,                snmp_acct_v_handler,NULL },
617          oid_AccServBadAuthenticators,        snmp_acct_v_handler,NULL,          { oid_AccServBadAuthenticators,        snmp_acct_v_handler,NULL },
618          oid_AccServMalformedRequests,        snmp_acct_v_handler,NULL,          { oid_AccServMalformedRequests,        snmp_acct_v_handler,NULL },
619          oid_AccServNoRecords,                snmp_acct_v_handler,NULL,          { oid_AccServNoRecords,                snmp_acct_v_handler,NULL },
620          oid_AccServUnknownTypes,             snmp_acct_v_handler,NULL,          { oid_AccServUnknownTypes,             snmp_acct_v_handler,NULL },
621    
622  #ifdef SNMP_COMPAT_0_96  #ifdef SNMP_COMPAT_0_96
623                    
624          /* Server */          /* Server */
625          oid_grad_radiusServerUpTime,         snmp_serv_handler, NULL,          { oid_grad_radiusServerUpTime,         snmp_serv_handler, NULL },
626          oid_grad_radiusServerResetTime,      snmp_serv_handler, NULL,          { oid_grad_radiusServerResetTime,      snmp_serv_handler, NULL },
627          oid_grad_radiusServerState,          snmp_serv_handler, NULL,          { oid_grad_radiusServerState,          snmp_serv_handler, NULL },
628    
629                    
630          /* Statistics */          /* Statistics */
631          oid_grad_StatIdent,             snmp_stat_handler, NULL,          { oid_grad_StatIdent,             snmp_stat_handler, NULL },
632          oid_grad_StatUpTime,            snmp_stat_handler, NULL,          { oid_grad_StatUpTime,            snmp_stat_handler, NULL },
633          oid_grad_StatConfigReset,       snmp_stat_handler, NULL,          { oid_grad_StatConfigReset,       snmp_stat_handler, NULL },
634          oid_grad_StatTotalLines,        snmp_stat_handler, NULL,          { oid_grad_StatTotalLines,        snmp_stat_handler, NULL },
635          oid_grad_StatTotalLinesInUse,   snmp_stat_handler, NULL,          { oid_grad_StatTotalLinesInUse,   snmp_stat_handler, NULL },
636          oid_grad_StatTotalLinesIdle,    snmp_stat_handler, NULL,          { oid_grad_StatTotalLinesIdle,    snmp_stat_handler, NULL },
637    
638          /* Variable oids */          /* Variable oids */
639          oid_grad_NASIndex1,             snmp_stat_nas1, NULL,          { oid_grad_NASIndex1,             snmp_stat_nas1, NULL },
640          oid_grad_NASIndex2,             snmp_stat_nas2, NULL,          { oid_grad_NASIndex2,             snmp_stat_nas2, NULL },
641          oid_grad_NASIndex3,             snmp_stat_nas3, NULL,          { oid_grad_NASIndex3,             snmp_stat_nas3, NULL },
642          oid_grad_NASIndex4,             snmp_stat_nas4, NULL,          { oid_grad_NASIndex4,             snmp_stat_nas4, NULL },
643    
644          oid_grad_NASAddress,            snmp_nas_table, NULL,          { oid_grad_NASAddress,            snmp_nas_table, NULL },
645          oid_grad_NASID,                 snmp_nas_table, NULL,          { oid_grad_NASID,                 snmp_nas_table, NULL },
646          oid_grad_NASLines,              snmp_nas_table, NULL,          { oid_grad_NASLines,              snmp_nas_table, NULL },
647          oid_grad_NASLinesInUse,         snmp_nas_table, NULL,          { oid_grad_NASLinesInUse,         snmp_nas_table, NULL },
648          oid_grad_NASLinesIdle,          snmp_nas_table, NULL,          { oid_grad_NASLinesIdle,          snmp_nas_table, NULL },
649    
650          oid_grad_StatPortIndex1,        snmp_port_index1, NULL,          { oid_grad_StatPortIndex1,        snmp_port_index1, NULL },
651          oid_grad_StatPortIndex2,        snmp_port_index2, NULL,          { oid_grad_StatPortIndex2,        snmp_port_index2, NULL },
652    
653          /* port table */          /* port table */
654          oid_grad_StatPortNASIndex,      snmp_port_table, NULL,          { oid_grad_StatPortNASIndex,      snmp_port_table, NULL },
655          oid_grad_StatPortID,            snmp_port_table, NULL,          { oid_grad_StatPortID,            snmp_port_table, NULL },
656          oid_grad_StatPortFramedAddress, snmp_port_table, NULL,          { oid_grad_StatPortFramedAddress, snmp_port_table, NULL },
657          oid_grad_StatPortTotalLogins,   snmp_port_table, NULL,          { oid_grad_StatPortTotalLogins,   snmp_port_table, NULL },
658          oid_grad_StatPortStatus,        snmp_port_table, NULL,          { oid_grad_StatPortStatus,        snmp_port_table, NULL },
659          oid_grad_StatPortStatusChangeTimestamp,   snmp_port_table, NULL,          { oid_grad_StatPortStatusChangeTimestamp,   snmp_port_table, NULL },
660          oid_grad_StatPortUpTime,        snmp_port_table, NULL,          { oid_grad_StatPortUpTime,        snmp_port_table, NULL },
661          oid_grad_StatPortLastLoginName, snmp_port_table, NULL,          { oid_grad_StatPortLastLoginName, snmp_port_table, NULL },
662          oid_grad_StatPortLastLoginTimestamp,  snmp_port_table, NULL,          { oid_grad_StatPortLastLoginTimestamp,  snmp_port_table, NULL },
663          oid_grad_StatPortLastLogoutTimestamp, snmp_port_table, NULL,          { oid_grad_StatPortLastLogoutTimestamp, snmp_port_table, NULL },
664          oid_grad_StatPortIdleTotalTime, snmp_port_table, NULL,          { oid_grad_StatPortIdleTotalTime, snmp_port_table, NULL },
665          oid_grad_StatPortIdleMaxTime,   snmp_port_table, NULL,          { oid_grad_StatPortIdleMaxTime,   snmp_port_table, NULL },
666          oid_grad_StatPortIdleMaxTimestamp, snmp_port_table, NULL,          { oid_grad_StatPortIdleMaxTimestamp, snmp_port_table, NULL },
667          oid_grad_StatPortInUseTotalTime, snmp_port_table, NULL,          { oid_grad_StatPortInUseTotalTime, snmp_port_table, NULL },
668          oid_grad_StatPortInUseMaxTime,   snmp_port_table, NULL,          { oid_grad_StatPortInUseMaxTime,   snmp_port_table, NULL },
669          oid_grad_StatPortInUseMaxTimestamp, snmp_port_table, NULL,          { oid_grad_StatPortInUseMaxTimestamp, snmp_port_table, NULL },
670  #endif  #endif
671          /* enterprise.gnu.radius subtree */          /* enterprise.gnu.radius subtree */
672          /* Server */          /* Server */
673          oid_radiusServerUpTime,         snmp_serv_handler, NULL,          { oid_radiusServerUpTime,         snmp_serv_handler, NULL },
674          oid_radiusServerResetTime,      snmp_serv_handler, NULL,          { oid_radiusServerResetTime,      snmp_serv_handler, NULL },
675          oid_radiusServerState,          snmp_serv_handler, NULL,          { oid_radiusServerState,          snmp_serv_handler, NULL },
676    
677    
678          /* Statistics */          /* Statistics */
679          oid_StatIdent,                       snmp_stat_handler, NULL,          { oid_StatIdent,                       snmp_stat_handler, NULL },
680          oid_StatUpTime,                      snmp_stat_handler, NULL,          { oid_StatUpTime,                      snmp_stat_handler, NULL },
681          oid_StatConfigReset,                 snmp_stat_handler, NULL,          { oid_StatConfigReset,                 snmp_stat_handler, NULL },
682          oid_StatTotalLines,                  snmp_stat_handler, NULL,          { oid_StatTotalLines,                  snmp_stat_handler, NULL },
683          oid_StatTotalLinesInUse,             snmp_stat_handler, NULL,          { oid_StatTotalLinesInUse,             snmp_stat_handler, NULL },
684          oid_StatTotalLinesIdle,              snmp_stat_handler, NULL,          { oid_StatTotalLinesIdle,              snmp_stat_handler, NULL },
685    
686          /* Variable oids */          /* Variable oids */
687          oid_NASIndex1,                       snmp_stat_nas1, NULL,          { oid_NASIndex1,                       snmp_stat_nas1, NULL },
688          oid_NASIndex2,                       snmp_stat_nas2, NULL,          { oid_NASIndex2,                       snmp_stat_nas2, NULL },
689          oid_NASIndex3,                       snmp_stat_nas3, NULL,          { oid_NASIndex3,                       snmp_stat_nas3, NULL },
690          oid_NASIndex4,                       snmp_stat_nas4, NULL,          { oid_NASIndex4,                       snmp_stat_nas4, NULL },
691    
692          oid_NASAddress,                      snmp_nas_table, NULL,          { oid_NASAddress,                      snmp_nas_table, NULL },
693          oid_NASID,                           snmp_nas_table, NULL,          { oid_NASID,                           snmp_nas_table, NULL },
694          oid_NASLines,                        snmp_nas_table, NULL,          { oid_NASLines,                        snmp_nas_table, NULL },
695          oid_NASLinesInUse,                   snmp_nas_table, NULL,          { oid_NASLinesInUse,                   snmp_nas_table, NULL },
696          oid_NASLinesIdle,                    snmp_nas_table, NULL,          { oid_NASLinesIdle,                    snmp_nas_table, NULL },
697    
698          oid_StatPortIndex1,                  snmp_port_index1, NULL,          { oid_StatPortIndex1,                  snmp_port_index1, NULL },
699          oid_StatPortIndex2,                  snmp_port_index2, NULL,          { oid_StatPortIndex2,                  snmp_port_index2, NULL },
700    
701          /* port table */          /* port table */
702          oid_StatPortNASIndex,                snmp_port_table, NULL,          { oid_StatPortNASIndex,                snmp_port_table, NULL },
703          oid_StatPortID,                      snmp_port_table, NULL,          { oid_StatPortID,                      snmp_port_table, NULL },
704          oid_StatPortFramedAddress,           snmp_port_table, NULL,          { oid_StatPortFramedAddress,           snmp_port_table, NULL },
705          oid_StatPortTotalLogins,             snmp_port_table, NULL,          { oid_StatPortTotalLogins,             snmp_port_table, NULL },
706          oid_StatPortStatus,                  snmp_port_table, NULL,          { oid_StatPortStatus,                  snmp_port_table, NULL },
707          oid_StatPortStatusChangeTimestamp,   snmp_port_table, NULL,          { oid_StatPortStatusChangeTimestamp,   snmp_port_table, NULL },
708          oid_StatPortUpTime,                  snmp_port_table, NULL,          { oid_StatPortUpTime,                  snmp_port_table, NULL },
709          oid_StatPortLastLoginName,           snmp_port_table, NULL,          { oid_StatPortLastLoginName,           snmp_port_table, NULL },
710          oid_StatPortLastLoginTimestamp,      snmp_port_table, NULL,          { oid_StatPortLastLoginTimestamp,      snmp_port_table, NULL },
711          oid_StatPortLastLogoutTimestamp,     snmp_port_table, NULL,          { oid_StatPortLastLogoutTimestamp,     snmp_port_table, NULL },
712          oid_StatPortIdleTotalTime,           snmp_port_table, NULL,          { oid_StatPortIdleTotalTime,           snmp_port_table, NULL },
713          oid_StatPortIdleMaxTime,             snmp_port_table, NULL,          { oid_StatPortIdleMaxTime,             snmp_port_table, NULL },
714          oid_StatPortIdleMaxTimestamp,        snmp_port_table, NULL,          { oid_StatPortIdleMaxTimestamp,        snmp_port_table, NULL },
715          oid_StatPortInUseTotalTime,          snmp_port_table, NULL,          { oid_StatPortInUseTotalTime,          snmp_port_table, NULL },
716          oid_StatPortInUseMaxTime,            snmp_port_table, NULL,          { oid_StatPortInUseMaxTime,            snmp_port_table, NULL },
717          oid_StatPortInUseMaxTimestamp,       snmp_port_table, NULL,          { oid_StatPortInUseMaxTimestamp,       snmp_port_table, NULL },
718    
719  };                                            };                                          
720    
# Line 2723  snmp_req_free(void *ptr) Line 2723  snmp_req_free(void *ptr)
2723    
2724  void  void
2725  snmp_req_drop(int type, void *data, void *orig_data,  snmp_req_drop(int type, void *data, void *orig_data,
2726                int fd, char *status_str)                int fd, const char *status_str)
2727  {  {
2728          SNMP_REQ *req = data ? data : orig_data;          SNMP_REQ *req = data ? data : orig_data;
         SNMP_REQ *orig = orig_data;  
2729          char ipbuf[DOTTED_QUAD_LEN];          char ipbuf[DOTTED_QUAD_LEN];
2730    
2731          radlog(L_NOTICE,          radlog(L_NOTICE,

Legend:
Removed from v.1.63  
changed lines
  Added in v.1.64

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