summaryrefslogtreecommitdiff
path: root/accel-pptpd/ppp
diff options
context:
space:
mode:
authorDmitry Kozlov <xeb@mail.ru>2010-10-28 01:02:37 +0400
committerDmitry Kozlov <xeb@mail.ru>2010-10-28 01:02:37 +0400
commite1603a51f450ad7ee52fe89ef5d78b82845fdcc2 (patch)
tree02759aee4bbb3053bbc9c1be80af33585c356bda /accel-pptpd/ppp
parent04a57e858bed078548c4c8715aa3d35ba81401ae (diff)
downloadaccel-ppp-e1603a51f450ad7ee52fe89ef5d78b82845fdcc2.tar.gz
accel-ppp-e1603a51f450ad7ee52fe89ef5d78b82845fdcc2.zip
radius: rewrited Termination-Action attribute handling so it is rfc compliant now
Diffstat (limited to 'accel-pptpd/ppp')
-rw-r--r--accel-pptpd/ppp/ppp_auth.c18
-rw-r--r--accel-pptpd/ppp/ppp_auth.h6
2 files changed, 20 insertions, 4 deletions
diff --git a/accel-pptpd/ppp/ppp_auth.c b/accel-pptpd/ppp/ppp_auth.c
index 959dc2f..c993414 100644
--- a/accel-pptpd/ppp/ppp_auth.c
+++ b/accel-pptpd/ppp/ppp_auth.c
@@ -298,7 +298,7 @@ static void auth_layer_free(struct ppp_layer_data_t *ld)
_free(ad);
}
-void __export auth_successed(struct ppp_t *ppp, char *username)
+void __export ppp_auth_successed(struct ppp_t *ppp, char *username)
{
struct auth_layer_data_t *ad = container_of(ppp_find_layer_data(ppp, &auth_layer), typeof(*ad), ld);
log_ppp_debug("auth_layer_started\n");
@@ -307,7 +307,7 @@ void __export auth_successed(struct ppp_t *ppp, char *username)
triton_event_fire(EV_PPP_AUTHORIZED, ppp);
}
-void __export auth_failed(struct ppp_t *ppp)
+void __export ppp_auth_failed(struct ppp_t *ppp)
{
ppp_terminate(ppp, TERM_AUTH_ERROR, 0);
}
@@ -318,6 +318,20 @@ int __export ppp_auth_register_handler(struct ppp_auth_handler_t *h)
return 0;
}
+int __export ppp_auth_restart(struct ppp_t *ppp)
+{
+ struct auth_layer_data_t *ad = container_of(ppp_find_layer_data(ppp, &auth_layer), typeof(*ad), ld);
+ log_ppp_debug("ppp_auth_restart\n");
+
+ if (!ad->auth_opt.auth->h->restart)
+ return -1;
+
+ if (ad->auth_opt.auth->h->restart(ppp, ad->auth_opt.auth))
+ return -1;
+
+ return 0;
+}
+
static void __init ppp_auth_init()
{
ppp_register_layer("auth", &auth_layer);
diff --git a/accel-pptpd/ppp/ppp_auth.h b/accel-pptpd/ppp/ppp_auth.h
index fbd2017..ea12d9c 100644
--- a/accel-pptpd/ppp/ppp_auth.h
+++ b/accel-pptpd/ppp/ppp_auth.h
@@ -24,12 +24,14 @@ struct ppp_auth_handler_t
int (*finish)(struct ppp_t*, struct auth_data_t*);
void (*free)(struct ppp_t*,struct auth_data_t*);
int (*check)(uint8_t *);
+ int (*restart)(struct ppp_t*,struct auth_data_t*);
};
int ppp_auth_register_handler(struct ppp_auth_handler_t*);
-void auth_successed(struct ppp_t *ppp, char *username);
-void auth_failed(struct ppp_t *ppp);
+void ppp_auth_successed(struct ppp_t *ppp, char *username);
+void ppp_auth_failed(struct ppp_t *ppp);
+int ppp_auth_restart(struct ppp_t *ppp);
#endif