diff options
author | Denis Kenzior <denkenz@gmail.com> | 2010-06-29 11:53:11 -0500 |
---|---|---|
committer | Denis Kenzior <denkenz@gmail.com> | 2010-06-29 11:53:11 -0500 |
commit | 820b1f55c8f9e615ef860327ef58a54006ec8822 (patch) | |
tree | f760579f42c3d87d9dc415848414cfa4b8a6e4a2 /gatchat/ppp_cp.c | |
parent | 969862337a77d10081cc72ca9ec0aaafaa3e977e (diff) | |
download | ofono-820b1f55c8f9e615ef860327ef58a54006ec8822.tar.bz2 |
ppp: Refactor server-side API
The biggest update here is that the server needs to be in dormant mode
by default, so as not to send a Configure-Req to the peer until the peer
is ready. This requires adding special constructor for LCP to
initialize it to Stopped state instead of initial state.
Along with this, we pass the server local IP directly to the ppp server
constructor.
Diffstat (limited to 'gatchat/ppp_cp.c')
-rw-r--r-- | gatchat/ppp_cp.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c index b0a18aac..647e241e 100644 --- a/gatchat/ppp_cp.c +++ b/gatchat/ppp_cp.c @@ -996,7 +996,8 @@ void pppcp_set_local_options(struct pppcp_data *pppcp, pppcp->local_options_len = len; } -struct pppcp_data *pppcp_new(GAtPPP *ppp, const struct pppcp_proto *proto) +struct pppcp_data *pppcp_new(GAtPPP *ppp, const struct pppcp_proto *proto, + gboolean dormant) { struct pppcp_data *data; @@ -1004,7 +1005,11 @@ struct pppcp_data *pppcp_new(GAtPPP *ppp, const struct pppcp_proto *proto) if (!data) return NULL; - data->state = INITIAL; + if (dormant) + data->state = STOPPED; + else + data->state = INITIAL; + data->config_timer_data.restart_interval = INITIAL_RESTART_TIMEOUT; data->terminate_timer_data.restart_interval = INITIAL_RESTART_TIMEOUT; data->config_timer_data.max_counter = MAX_CONFIGURE; |