8 #ifdef HAVE_ASN1_SNMP_SNMPIMPL_H
11 #include <snmp_impl.h>
13 #ifdef HAVE_UCD_SNMP_ASN1_SNMP_SNMPIMPL_H
14 #include <ucd-snmp/asn1.h>
15 #include <ucd-snmp/snmp.h>
16 #include <ucd-snmp/snmp_impl.h>
22 extern void radius_snmp_init(void);
23 extern int smux_connect(void);
24 extern int smux_read(void);
27 * The RADIUS server snmp data structures.
29 typedef struct rad_snmp_server_t {
32 int32_t uptime; /* in hundredths of a second */
34 time_t last_reset_time;
37 int32_t total_requests;
38 int32_t total_invalid_requests;
39 int32_t total_dup_requests;
40 int32_t total_responses;
41 int32_t total_access_accepts;
42 int32_t total_access_rejects;
43 int32_t total_access_challenges;
44 int32_t total_malformed_requests;
45 int32_t total_bad_authenticators;
46 int32_t total_packets_dropped;
47 int32_t total_no_records;
48 int32_t total_unknown_types;
51 typedef struct rad_snmp_t {
52 rad_snmp_server_t auth;
53 rad_snmp_server_t acct;
54 smux_event_t smux_event;
55 const char *smux_password;
56 int snmp_write_access;
59 int smux_max_failures;
63 * Taken from RFC 2619 and RFC 2621
65 typedef struct rad_snmp_client_entry_t {
68 /* Client ID (string ) */
70 int dup_access_requests;
73 int access_challenges;
74 int auth_malformed_requests;
75 int auth_bad_authenticators;
76 int auth_packets_dropped;
77 int auth_unknown_types;
78 int acct_packets_dropped;
80 int acct_dup_requests;
82 int acct_bad_authenticators;
83 int acct_malformed_requests;
85 int acct_unknown_types;
86 } rad_snmp_client_entry_t;
88 extern rad_snmp_t rad_snmp;
90 #define RAD_SNMP_INC(_x) if (mainconfig.do_snmp) _x++
91 #define RAD_SNMP_FD_INC(_fd, _x) if (mainconfig.do_snmp) { \
92 if (_fd == authfd) { \
94 } else { if (_fd == acctfd) \
95 rad_snmp.acct._x++; } } \
99 #define RAD_SNMP_INC(_x)
100 #define RAD_SNMP_FD_INC(_fd, _x)
102 #endif /* WITH_SNMP */
104 #endif /* _RADIUS_SNMP_H */