7 #include <freeradius-devel/ident.h>
8 RCSIDH(radius_snmp_h, "$Id$")
12 typedef enum smux_event_t {
13 SMUX_NONE, SMUX_CONNECT, SMUX_READ
16 extern void radius_snmp_init(void);
17 extern int smux_connect(void);
18 extern int smux_read(void);
21 * The RADIUS server snmp data structures.
23 typedef struct rad_snmp_server_t {
26 int32_t uptime; /* in hundredths of a second */
28 time_t last_reset_time;
31 int32_t total_requests;
32 int32_t total_invalid_requests;
33 int32_t total_dup_requests;
34 int32_t total_responses;
35 int32_t total_access_accepts;
36 int32_t total_access_rejects;
37 int32_t total_access_challenges;
38 int32_t total_malformed_requests;
39 int32_t total_bad_authenticators;
40 int32_t total_packets_dropped;
41 int32_t total_no_records;
42 int32_t total_unknown_types;
45 typedef struct rad_snmp_t {
46 rad_snmp_server_t auth;
47 rad_snmp_server_t acct;
48 smux_event_t smux_event;
49 const char *smux_password;
50 int snmp_write_access;
53 int smux_max_failures;
57 * Taken from RFC 2619 and RFC 2621
59 typedef struct rad_snmp_client_entry_t {
62 /* Client ID (string ) */
64 int dup_access_requests;
67 int access_challenges;
68 int auth_malformed_requests;
69 int auth_bad_authenticators;
70 int auth_packets_dropped;
71 int auth_unknown_types;
72 int acct_packets_dropped;
74 int acct_dup_requests;
76 int acct_bad_authenticators;
77 int acct_malformed_requests;
79 int acct_unknown_types;
80 } rad_snmp_client_entry_t;
82 extern rad_snmp_t rad_snmp;
84 #define RAD_SNMP_INC(_x) if (mainconfig.do_snmp) _x++
85 #define RAD_SNMP_TYPE_INC(_listener, _x) if (mainconfig.do_snmp) { \
86 if (_listener->type == RAD_LISTEN_AUTH) { \
88 } else { if (_listener->type == RAD_LISTEN_ACCT) \
89 rad_snmp.acct._x++; } } \
93 #define RAD_SNMP_INC(_x)
94 #define RAD_SNMP_TYPE_INC(_listener, _x)
96 #endif /* WITH_SNMP */
98 #endif /* _RADIUS_SNMP_H */