summaryrefslogtreecommitdiff
path: root/accel-pptpd/radius
diff options
context:
space:
mode:
authorKozlov Dmitry <dima@server>2010-11-10 13:11:38 +0300
committerKozlov Dmitry <dima@server>2010-11-10 13:11:38 +0300
commit4d826710d0d30606da88ff3543a4b43521e404df (patch)
tree6c8db87f684e4abb67e72ee64a1d218de9dd4397 /accel-pptpd/radius
parentb6516bc491fcb7d9344f9cc720e20a5a20f94a32 (diff)
downloadaccel-ppp-4d826710d0d30606da88ff3543a4b43521e404df.tar.gz
accel-ppp-4d826710d0d30606da88ff3543a4b43521e404df.zip
radius: separated interim-verbose option to control verbosity of interim packets send/receive
Diffstat (limited to 'accel-pptpd/radius')
-rw-r--r--accel-pptpd/radius/acct.c10
-rw-r--r--accel-pptpd/radius/auth.c2
-rw-r--r--accel-pptpd/radius/radius.c5
-rw-r--r--accel-pptpd/radius/radius_p.h3
-rw-r--r--accel-pptpd/radius/req.c4
5 files changed, 15 insertions, 9 deletions
diff --git a/accel-pptpd/radius/acct.c b/accel-pptpd/radius/acct.c
index 85a2f0f..f8cfee7 100644
--- a/accel-pptpd/radius/acct.c
+++ b/accel-pptpd/radius/acct.c
@@ -85,7 +85,7 @@ static int rad_acct_read(struct triton_md_handler_t *h)
if (req->reply)
rad_packet_free(req->reply);
req->reply = pack;
- if (conf_verbose) {
+ if (conf_interim_verbose) {
log_ppp_info("recv ");
rad_packet_print(req->reply, log_ppp_info);
}
@@ -118,7 +118,7 @@ static void rad_acct_timeout(struct triton_timer_t *t)
rad_packet_change_int(req->pack, "Acct-Delay-Time", req->rpd->acct_delay_time);
req_set_RA(req, conf_acct_secret);
- rad_req_send(req);
+ rad_req_send(req, conf_interim_verbose);
}
static void rad_acct_interim_update(struct triton_timer_t *t)
@@ -138,7 +138,7 @@ static void rad_acct_interim_update(struct triton_timer_t *t)
rad_packet_change_val(rpd->acct_req->pack, "Acct-Status-Type", "Interim-Update");
rad_packet_change_int(rpd->acct_req->pack, "Acct-Delay-Time", 0);
req_set_RA(rpd->acct_req, conf_acct_secret);
- rad_req_send(rpd->acct_req);
+ rad_req_send(rpd->acct_req, conf_interim_verbose);
rpd->acct_req->timeout.period = conf_timeout * 1000;
triton_timer_add(rpd->ppp->ctrl->ctx, &rpd->acct_req->timeout, 0);
}
@@ -175,7 +175,7 @@ int rad_acct_start(struct radius_pd_t *rpd)
rpd->acct_delay_time += conf_timeout;
if (req_set_RA(rpd->acct_req, conf_acct_secret))
goto out_err;
- if (rad_req_send(rpd->acct_req))
+ if (rad_req_send(rpd->acct_req, conf_verbose))
goto out_err;
rad_req_wait(rpd->acct_req, conf_timeout);
if (!rpd->acct_req->reply) {
@@ -267,7 +267,7 @@ void rad_acct_stop(struct radius_pd_t *rpd)
rpd->acct_req->pack->id++;
if (req_set_RA(rpd->acct_req, conf_acct_secret))
break;
- if (rad_req_send(rpd->acct_req))
+ if (rad_req_send(rpd->acct_req, conf_verbose))
break;
rad_req_wait(rpd->acct_req, conf_timeout);
if (!rpd->acct_req->reply)
diff --git a/accel-pptpd/radius/auth.c b/accel-pptpd/radius/auth.c
index 2d17b67..55d1858 100644
--- a/accel-pptpd/radius/auth.c
+++ b/accel-pptpd/radius/auth.c
@@ -142,7 +142,7 @@ static int rad_auth_send(struct rad_req_t *req)
int i;
for(i = 0; i < conf_max_try; i++) {
- if (rad_req_send(req))
+ if (rad_req_send(req, conf_verbose))
goto out;
rad_req_wait(req, conf_timeout);
diff --git a/accel-pptpd/radius/radius.c b/accel-pptpd/radius/radius.c
index 6c9497c..3c885d8 100644
--- a/accel-pptpd/radius/radius.c
+++ b/accel-pptpd/radius/radius.c
@@ -29,6 +29,7 @@ in_addr_t conf_nas_ip_address;
in_addr_t conf_gw_ip_address;
in_addr_t conf_bind;
int conf_verbose;
+int conf_interim_verbose;
char *conf_auth_server;
int conf_auth_server_port = 1812;
@@ -385,6 +386,10 @@ static void __init radius_init(void)
if (opt && atoi(opt) > 0)
conf_verbose = 1;
+ opt = conf_get_opt("radius", "interim-verbose");
+ if (opt && atoi(opt) > 0)
+ conf_interim_verbose = 1;
+
opt = conf_get_opt("radius", "nas-ip-address");
if (opt)
conf_nas_ip_address = inet_addr(opt);
diff --git a/accel-pptpd/radius/radius_p.h b/accel-pptpd/radius/radius_p.h
index 2504468..6c4ef8f 100644
--- a/accel-pptpd/radius/radius_p.h
+++ b/accel-pptpd/radius/radius_p.h
@@ -57,6 +57,7 @@ struct rad_req_t
extern int conf_max_try;
extern int conf_timeout;
extern int conf_verbose;
+extern int conf_interim_verbose;
extern char *conf_nas_identifier;
extern in_addr_t conf_nas_ip_address;
extern in_addr_t conf_bind;
@@ -84,7 +85,7 @@ void rad_dict_free(struct rad_dict_t *dict);
struct rad_req_t *rad_req_alloc(struct radius_pd_t *rpd, int code, const char *username);
int rad_req_acct_fill(struct rad_req_t *);
void rad_req_free(struct rad_req_t *);
-int rad_req_send(struct rad_req_t *);
+int rad_req_send(struct rad_req_t *, int verbose);
int rad_req_wait(struct rad_req_t *, int);
struct radius_pd_t *find_pd(struct ppp_t *ppp);
diff --git a/accel-pptpd/radius/req.c b/accel-pptpd/radius/req.c
index 9ac741d..e945839 100644
--- a/accel-pptpd/radius/req.c
+++ b/accel-pptpd/radius/req.c
@@ -169,7 +169,7 @@ out_err:
return -1;
}
-int rad_req_send(struct rad_req_t *req)
+int rad_req_send(struct rad_req_t *req, int verbose)
{
if (req->hnd.fd == -1 && make_socket(req))
return -1;
@@ -177,7 +177,7 @@ int rad_req_send(struct rad_req_t *req)
if (!req->pack->buf && rad_packet_build(req->pack, req->RA))
goto out_err;
- if (conf_verbose) {
+ if (verbose) {
log_ppp_info("send ");
rad_packet_print(req->pack, log_ppp_info);
}