ppp: introduce ppp_auth_notify
authorDenis Kenzior <denkenz@gmail.com>
Tue, 13 Apr 2010 19:19:04 +0000 (14:19 -0500)
committerDenis Kenzior <denkenz@gmail.com>
Tue, 13 Apr 2010 19:21:16 +0000 (14:21 -0500)
This function will be notified whenever authentication has succeeded /
failed.  This can happen in the authentication phase or during the
network phase.  If auth fails, then we should proceed to the terminate
phase.

gatchat/gatppp.c
gatchat/ppp.h

index eb44030..d9ab89c 100644 (file)
@@ -407,6 +407,14 @@ void ppp_set_auth(GAtPPP *ppp, const guint8* auth_data)
        }
 }
 
+void ppp_auth_notify(GAtPPP *ppp, gboolean success)
+{
+       if (success)
+               ppp_enter_phase(ppp, PPP_PHASE_NETWORK);
+       else
+               ppp_enter_phase(ppp, PPP_PHASE_TERMINATION);
+}
+
 void ppp_set_recv_accm(GAtPPP *ppp, guint32 accm)
 {
        ppp->recv_accm = accm;
index e975c21..565a9fa 100644 (file)
@@ -91,6 +91,7 @@ void ppp_debug(GAtPPP *ppp, const char *str);
 void ppp_enter_phase(GAtPPP *ppp, enum ppp_phase phase);
 void ppp_transmit(GAtPPP *ppp, guint8 *packet, guint infolen);
 void ppp_set_auth(GAtPPP *ppp, const guint8 *auth_data);
+void ppp_auth_notify(GAtPPP *ppp, gboolean success);
 void ppp_set_recv_accm(GAtPPP *ppp, guint32 accm);
 void ppp_set_xmit_accm(GAtPPP *ppp, guint32 accm);
 void ppp_set_pfc(GAtPPP *ppp, gboolean pfc);