8 typedef enum smux_event_t {
9 SMUX_NONE, SMUX_CONNECT, SMUX_READ
12 extern void radius_snmp_init(void);
13 extern int smux_connect(void);
14 extern int smux_read(void);
17 * The RADIUS server snmp data structures.
19 typedef struct rad_snmp_server_t {
22 int32_t uptime; /* in hundredths of a second */
24 time_t last_reset_time;
27 int32_t total_requests;
28 int32_t total_invalid_requests;
29 int32_t total_dup_requests;
30 int32_t total_responses;
31 int32_t total_access_accepts;
32 int32_t total_access_rejects;
33 int32_t total_access_challenges;
34 int32_t total_malformed_requests;
35 int32_t total_bad_authenticators;
36 int32_t total_packets_dropped;
37 int32_t total_no_records;
38 int32_t total_unknown_types;
41 typedef struct rad_snmp_t {
42 rad_snmp_server_t auth;
43 rad_snmp_server_t acct;
44 smux_event_t smux_event;
45 const char *smux_password;
46 int snmp_write_access;
49 int smux_max_failures;
53 * Taken from RFC 2619 and RFC 2621
55 typedef struct rad_snmp_client_entry_t {
58 /* Client ID (string ) */
60 int dup_access_requests;
63 int access_challenges;
64 int auth_malformed_requests;
65 int auth_bad_authenticators;
66 int auth_packets_dropped;
67 int auth_unknown_types;
68 int acct_packets_dropped;
70 int acct_dup_requests;
72 int acct_bad_authenticators;
73 int acct_malformed_requests;
75 int acct_unknown_types;
76 } rad_snmp_client_entry_t;
78 extern rad_snmp_t rad_snmp;
80 #define RAD_SNMP_INC(_x) if (mainconfig.do_snmp) _x++
81 #define RAD_SNMP_TYPE_INC(_listener, _x) if (mainconfig.do_snmp) { \
82 if (_listener->type == RAD_LISTEN_AUTH) { \
84 } else { if (_listener->type == RAD_LISTEN_ACCT) \
85 rad_snmp.acct._x++; } } \
89 #define RAD_SNMP_INC(_x)
90 #define RAD_SNMP_TYPE_INC(_listener, _x)
92 #endif /* WITH_SNMP */
94 #endif /* _RADIUS_SNMP_H */