diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-04-13 14:11:44 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-04-13 14:21:12 -0500 |
commit | fed99b926553bfec68afa65663e4148172eb12ec (patch) | |
tree | 463479bf03b31903c74f4f4e34c0d95ac5c675e2 /gatchat/ppp.h | |
parent | 552db428ef06f1dfd650bcb549dda93a743640eb (diff) | |
download | ofono-fed99b926553bfec68afa65663e4148172eb12ec.tar.bz2 |
ppp: Transition the phase directly
Use of the generate event function, while more 'pure' with regard to how
the spec views transitions, actually makes code more difficult to read.
Instead use phase transitions directly inside gatppp. This still bleeds
through a little into lcp code, and probably should be fixed in a better
way eventually.
Diffstat (limited to 'gatchat/ppp.h')
-rw-r--r-- | gatchat/ppp.h | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/gatchat/ppp.h b/gatchat/ppp.h index ccbd80d6..e975c21b 100644 --- a/gatchat/ppp.h +++ b/gatchat/ppp.h @@ -26,14 +26,12 @@ #define IPCP_PROTO 0x8021 #define PPP_IP_PROTO 0x0021 -enum ppp_event { - PPP_UP = 1, - PPP_OPENED, - PPP_SUCCESS, - PPP_NONE, - PPP_CLOSING, - PPP_FAIL, - PPP_DOWN +enum ppp_phase { + PPP_PHASE_DEAD = 0, /* Link dead */ + PPP_PHASE_ESTABLISHMENT, /* LCP started */ + PPP_PHASE_AUTHENTICATION, /* Auth started */ + PPP_PHASE_NETWORK, /* IPCP started */ + PPP_PHASE_TERMINATION, /* LCP Terminate phase */ }; struct ppp_header { @@ -90,7 +88,7 @@ struct ppp_net_data { }; void ppp_debug(GAtPPP *ppp, const char *str); -void ppp_generate_event(GAtPPP *ppp, enum ppp_event event); +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_set_recv_accm(GAtPPP *ppp, guint32 accm); |