summaryrefslogtreecommitdiff
path: root/accel-pppd/radius/radius_p.h
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2011-06-22 10:25:53 +0400
committerKozlov Dmitry <dima@server>2011-06-22 10:25:53 +0400
commit852f842d6521c5c260d24cf23a0e5a317cf25a0b (patch)
treea3ee3c141c49d9e3811d586ae3735c2c21c3d4f2 /accel-pppd/radius/radius_p.h
parent05ad71a30740f1cca95e9f47a8a56c65b03402ed (diff)
downloadaccel-ppp-852f842d6521c5c260d24cf23a0e5a317cf25a0b.tar.gz
accel-ppp-852f842d6521c5c260d24cf23a0e5a317cf25a0b.zip
temp
Diffstat (limited to 'accel-pppd/radius/radius_p.h')
-rw-r--r--accel-pppd/radius/radius_p.h37
1 files changed, 31 insertions, 6 deletions
diff --git a/accel-pppd/radius/radius_p.h b/accel-pppd/radius/radius_p.h
index 929fe8e6..6ee130f1 100644
--- a/accel-pppd/radius/radius_p.h
+++ b/accel-pppd/radius/radius_p.h
@@ -10,6 +10,8 @@
#include "ppp.h"
#include "ipdb.h"
+struct rad_server_t;
+
struct radius_pd_t
{
struct list_head entry;
@@ -46,16 +48,37 @@ struct radius_pd_t
struct rad_req_t
{
+ struct list_head entry;
struct triton_context_t ctx;
struct triton_md_handler_t hnd;
struct triton_timer_t timeout;
uint8_t RA[16];
struct rad_packet_t *pack;
struct rad_packet_t *reply;
+
+ struct radius_pd_t *rpd;
+ struct rad_server_t *serv;
+
in_addr_t server_addr;
int server_port;
+};
- struct radius_pd_t *rpd;
+struct rad_server_t
+{
+ struct list_head entry;
+ in_addr_t auth_addr;
+ int auth_port;
+ char *auth_secret;
+ in_addr_t acct_addr;
+ int acct_port;
+ char *acct_secret;
+ int max_req_cnt;
+ int req_cnt;
+ struct list_head req_queue;
+ int client_cnt;
+ time_t fail_time;
+ int conf_fail_time;
+ pthread_mutex_t lock;
};
@@ -70,11 +93,6 @@ extern in_addr_t conf_nas_ip_address;
extern in_addr_t conf_bind;
extern in_addr_t conf_gw_ip_address;
extern in_addr_t conf_auth_server;
-extern char *conf_auth_secret;
-extern int conf_auth_server_port;
-extern in_addr_t conf_acct_server;
-extern char *conf_acct_secret;
-extern int conf_acct_server_port;
extern char *conf_dm_coa_secret;
extern int conf_sid_in_auth;
extern int conf_require_nas_ident;
@@ -122,6 +140,13 @@ int rad_packet_send(struct rad_packet_t *pck, int fd, struct sockaddr_in *addr);
void dm_coa_cancel(struct radius_pd_t *pd);
+struct rad_server_t *rad_server_get();
+void rad_server_put(struct rad_server_t *);
+int rad_server_req_enter(struct rad_req_t *);
+void rad_server_req_exit(struct rad_req_t *);
+int rad_server_realloc(struct rad_req_t *, int);
+void rad_server_fail(struct rad_server_t *);
+
struct stat_accm_t;
struct stat_accm_t *stat_accm_create(unsigned int time);
void stat_accm_add(struct stat_accm_t *, unsigned int);