From ebbd6f580322767983ebf6b4049924d7e2de642f Mon Sep 17 00:00:00 2001 From: Kozlov Dmitry Date: Mon, 27 Aug 2012 12:22:43 +0400 Subject: fix typo (successed -> succeeded) Conflicts: accel-pppd/ppp/ppp_auth.c --- accel-pppd/auth/auth_chap_md5.c | 8 ++++---- accel-pppd/auth/auth_mschap_v1.c | 6 +++--- accel-pppd/auth/auth_mschap_v2.c | 4 ++-- accel-pppd/auth/auth_pap.c | 6 +++--- accel-pppd/include/ppp_auth.h | 38 +++++++++++++++++++++++++++++++++++++- accel-pppd/ppp/ppp_auth.c | 4 ++-- accel-pppd/ppp/ppp_auth.h | 2 +- 7 files changed, 52 insertions(+), 16 deletions(-) mode change 120000 => 100644 accel-pppd/include/ppp_auth.h diff --git a/accel-pppd/auth/auth_chap_md5.c b/accel-pppd/auth/auth_chap_md5.c index a43081d..7e14b8d 100644 --- a/accel-pppd/auth/auth_chap_md5.c +++ b/accel-pppd/auth/auth_chap_md5.c @@ -28,7 +28,7 @@ #define VALUE_SIZE 16 #define MSG_FAILURE "Authentication failed" -#define MSG_SUCCESS "Authentication successed" +#define MSG_SUCCESS "Authentication succeeded" #define HDR_LEN (sizeof(struct chap_hdr_t)-2) @@ -290,7 +290,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h name = _strndup(msg->name,ntohs(msg->hdr.len) - sizeof(*msg) + 2); if (conf_any_login) { - if (ppp_auth_successed(ad->ppp, name)) { + if (ppp_auth_succeeded(ad->ppp, name)) { chap_send_failure(ad); ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0); _free(name); @@ -332,7 +332,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h _free(name); } else { if (!ad->started) { - if (ppp_auth_successed(ad->ppp, name)) { + if (ppp_auth_succeeded(ad->ppp, name)) { chap_send_failure(ad); ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0); _free(name); @@ -355,7 +355,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h _free(name); } else { if (!ad->started) { - if (ppp_auth_successed(ad->ppp, name)) { + if (ppp_auth_succeeded(ad->ppp, name)) { chap_send_failure(ad); ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0); _free(name); diff --git a/accel-pppd/auth/auth_mschap_v1.c b/accel-pppd/auth/auth_mschap_v1.c index fd1a60a..adfbc60 100644 --- a/accel-pppd/auth/auth_mschap_v1.c +++ b/accel-pppd/auth/auth_mschap_v1.c @@ -36,7 +36,7 @@ static int conf_interval = 0; static int conf_max_failure = 3; static int conf_any_login = 0; static char *conf_msg_failure = "E=691 R=0"; -static char *conf_msg_success = "Authentication successed"; +static char *conf_msg_success = "Authentication succeeded"; ; struct chap_hdr_t @@ -300,7 +300,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h } if (conf_any_login) { - if (ppp_auth_successed(ad->ppp, name)) { + if (ppp_auth_succeeded(ad->ppp, name)) { chap_send_failure(ad, mschap_error); ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0); _free(name); @@ -325,7 +325,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h _free(name); } else { if (!ad->started) { - if (ppp_auth_successed(ad->ppp, name)) { + if (ppp_auth_succeeded(ad->ppp, name)) { chap_send_failure(ad, mschap_error); ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0); _free(name); diff --git a/accel-pppd/auth/auth_mschap_v2.c b/accel-pppd/auth/auth_mschap_v2.c index ffb6fbf..b8f346a 100644 --- a/accel-pppd/auth/auth_mschap_v2.c +++ b/accel-pppd/auth/auth_mschap_v2.c @@ -36,7 +36,7 @@ static int conf_interval = 0; static int conf_max_failure = 3; static char *conf_msg_failure = "E=691 R=0 V=3"; static char *conf_msg_failure2 = "Authentication failure"; -static char *conf_msg_success = "Authentication successed"; +static char *conf_msg_success = "Authentication succeeded"; struct chap_hdr_t { @@ -396,7 +396,7 @@ static void chap_recv_response(struct chap_auth_data_t *ad, struct chap_hdr_t *h _free(name); } else { if (!ad->started) { - if (ppp_auth_successed(ad->ppp, name)) { + if (ppp_auth_succeeded(ad->ppp, name)) { chap_send_failure(ad, mschap_error, reply_msg); ap_session_terminate(&ad->ppp->ses, TERM_AUTH_ERROR, 0); _free(name); diff --git a/accel-pppd/auth/auth_pap.c b/accel-pppd/auth/auth_pap.c index 206ecde..08edbcb 100644 --- a/accel-pppd/auth/auth_pap.c +++ b/accel-pppd/auth/auth_pap.c @@ -13,7 +13,7 @@ #include "memdebug.h" #define MSG_FAILED "Authentication failed" -#define MSG_SUCCESSED "Authentication successed" +#define MSG_SUCCESSED "Authentication succeeded" #define HDR_LEN (sizeof(struct pap_hdr_t)-2) @@ -199,7 +199,7 @@ static int pap_recv_req(struct pap_auth_data_t *p, struct pap_hdr_t *hdr) peer_id = _strndup((const char*)peer_id, peer_id_len); if (conf_any_login) { - if (ppp_auth_successed(p->ppp, peer_id)) { + if (ppp_auth_succeeded(p->ppp, peer_id)) { pap_send_nak(p, hdr->id); ap_session_terminate(&p->ppp->ses, TERM_AUTH_ERROR, 0); _free(peer_id); @@ -232,7 +232,7 @@ static int pap_recv_req(struct pap_auth_data_t *p, struct pap_hdr_t *hdr) ret = -1; _free(peer_id); } else { - if (ppp_auth_successed(p->ppp, peer_id)) { + if (ppp_auth_succeeded(p->ppp, peer_id)) { pap_send_nak(p, hdr->id); ap_session_terminate(&p->ppp->ses, TERM_AUTH_ERROR, 0); _free(peer_id); diff --git a/accel-pppd/include/ppp_auth.h b/accel-pppd/include/ppp_auth.h deleted file mode 120000 index 527c853..0000000 --- a/accel-pppd/include/ppp_auth.h +++ /dev/null @@ -1 +0,0 @@ -../ppp/ppp_auth.h \ No newline at end of file diff --git a/accel-pppd/include/ppp_auth.h b/accel-pppd/include/ppp_auth.h new file mode 100644 index 0000000..9c68466 --- /dev/null +++ b/accel-pppd/include/ppp_auth.h @@ -0,0 +1,37 @@ +#ifndef PPP_AUTH_H +#define PPP_AUTH_H + +#include "list.h" + +struct ppp_auth_handler_t; + +struct auth_data_t +{ + struct list_head entry; + int proto; + int state; + struct ppp_auth_handler_t *h; +}; + +struct ppp_auth_handler_t +{ + struct list_head entry; + const char *name; + struct auth_data_t* (*init)(struct ppp_t*); + int (*send_conf_req)(struct ppp_t*, struct auth_data_t*, uint8_t*); + int (*recv_conf_req)(struct ppp_t*, struct auth_data_t*, uint8_t*); + int (*start)(struct ppp_t*, struct auth_data_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*); + +int ppp_auth_succeeded(struct ppp_t *ppp, char *username); +void ppp_auth_failed(struct ppp_t *ppp, char *username); +int ppp_auth_restart(struct ppp_t *ppp); + +#endif + diff --git a/accel-pppd/ppp/ppp_auth.c b/accel-pppd/ppp/ppp_auth.c index 805bf74..2b4aff9 100644 --- a/accel-pppd/ppp/ppp_auth.c +++ b/accel-pppd/ppp/ppp_auth.c @@ -333,11 +333,11 @@ static void __ppp_auth_started(struct ppp_t *ppp) ppp_layer_started(ppp, &ad->ld); - log_ppp_info1("%s: authentication successed\n", ppp->ses.username); + log_ppp_info1("%s: authentication succeeded\n", ppp->ses.username); triton_event_fire(EV_SES_AUTHORIZED, ppp); } -int __export ppp_auth_successed(struct ppp_t *ppp, char *username) +int __export ppp_auth_succeeded(struct ppp_t *ppp, char *username) { struct ap_session *ses; struct auth_layer_data_t *ad = container_of(ppp_find_layer_data(ppp, &auth_layer), typeof(*ad), ld); diff --git a/accel-pppd/ppp/ppp_auth.h b/accel-pppd/ppp/ppp_auth.h index b6a7b14..af98262 100644 --- a/accel-pppd/ppp/ppp_auth.h +++ b/accel-pppd/ppp/ppp_auth.h @@ -29,7 +29,7 @@ struct ppp_auth_handler_t int ppp_auth_register_handler(struct ppp_auth_handler_t*); -int ppp_auth_successed(struct ppp_t *ppp, char *username); +int ppp_auth_succeeded(struct ppp_t *ppp, char *username); void ppp_auth_failed(struct ppp_t *ppp, char *username); int ppp_auth_restart(struct ppp_t *ppp); -- cgit v1.2.3