Commit Graph

106 Commits

Author SHA1 Message Date
Sergei Golubtsov c8ed7162d5 ppp: using RX ACCM = 0 by default
Some modems such as Quectel EC200T do not honor the default value for
the Async-Control-Character-Map (ACCM) configuration option defined in
RFC 1548 6.2 as 0xffffffff. This patch suggests to use RX ACCM = 0 for
Ofono by default as pppd does for instance. This will reduce PPP data
overhead as well.
2021-01-07 23:17:45 -06:00
Giacinto Cifelli 6fc119d9ea gatchat: support for auth NONE
Added authentication method G_AT_PPP_AUTH_METHOD_NONE and its handling.
2018-10-03 11:44:03 -05:00
Slava Monich 43c2bfdc52 gatchat: Removed unused GAtPPP field 2017-10-26 15:24:36 -05:00
Denis Kenzior 8edaaaf210 gatchat: Fix up minor coding style issues 2014-06-21 11:54:26 -05:00
Philip Paeps a88662d23c gatchat: implement PAP authentication
Make the authentication method configurable, CHAP or PAP, defaulting to
CHAP (i.e.: previous behaviour).

Implementation details:

 o If PAP is configured, we NAK the CHAP authentication protocol option
   in LCP configuration requests and suggest PAP instead.  This works
   around the amusing requirement of 3GPP TS 29.061 that modems must
   send a forced positive acknowledgement of the authentication method
   tried (i.e.: the modem will successfully accept any CHAP handshake,
   but if the network only supports PAP, the modem will hang up
   when it tries and fails to activate the PDP context)

 o The PAP Authenticate-Request is resent a hard-coded three times at
   ten-second intervals.  This may be a bit too persistent.  Chances
   are if it doesn't work the first time, it'll never work, but the
   RFC insists that we MUST retry.
2014-06-21 11:50:34 -05:00
Marcel Holtmann 21f9da9916 gatchat: Update copyright information 2011-10-10 13:39:25 -07:00
Denis Kenzior 2eb4611de8 ppp: Add basic length sanity checks 2011-06-29 05:00:56 -05:00
Denis Kenzior bc64df2d2a gatppp: Refactor tx path 2011-06-29 03:46:54 -05:00
Denis Kenzior bc37c74653 gatppp: Refactor rx path 2011-06-29 03:35:13 -05:00
Denis Kenzior 12338faabd gatppp: Re-format & re-word comments 2011-06-29 03:32:27 -05:00
Guillaume Zajac fed838f79f GAtPPP: Add PFC option support 2011-06-29 00:33:42 -05:00
Guillaume Zajac 84ccc874da GAtPPP: Add ACFC option support 2011-06-29 00:22:25 -05:00
Denis Kenzior e244e2d42a gatppp: Set the suspend function in open / listen
In case it was set before calling these functions
2011-05-25 05:22:58 -05:00
Denis Kenzior eeb3ccc321 gatppp: Refactor PPP API
Remove the series of constructors which take a GIOChannel directly.
These weren't used.

This change also allows the construction of the PPP object and filling
in various pertinent information without starting the HDLC processing.
The client must now use g_at_ppp_open() for the client side or
g_at_ppp_listen() for the server side to start the true PPP session.
The previous owner of the GAtIO object must be suspended beforehand.
2011-05-24 12:25:07 -05:00
Denis Kenzior 72dee45005 gatppp: Make sure to clean up guard_timeout_source 2011-05-24 12:25:07 -05:00
Denis Kenzior d82c5ce1fa gatppp: Rename guard_timeout_src to _source 2011-05-24 12:25:07 -05:00
Guillaume Zajac db430aaf1c gatppp: Do not call disconnect func if suspended 2011-05-24 12:25:07 -05:00
Guillaume Zajac ab027e9e9c gatppp: Add GAtPPP suspend API 2011-05-24 12:25:07 -05:00
Guillaume Zajac 7617c492b8 gatppp: Add GAtPPP resume functionality 2011-05-24 12:25:07 -05:00
Denis Kenzior 832cc3317b gatppp: Make ppp->fd handling a bit easier to grok 2011-05-24 12:10:22 -05:00
Denis Kenzior 5405d0860f gatppp: Ensure created GAtPPP object is not null 2011-05-24 12:10:22 -05:00
Guillaume Zajac 7e5ccc18d7 gatppp: Add new contructor to use external fd 2011-05-24 12:10:22 -05:00
Denis Kenzior be7cce9cb3 gatppp: Don't go over 80 characters / line 2011-05-24 11:47:46 -05:00
Guillaume Zajac f1cbb783fc gatppp: Add API for setting suspend callback
In situations where the PPP stream can be suspended by the peer, e.g. in
the server role using '+++'
2011-05-08 23:03:22 -05:00
Denis Kenzior 6f8675d7fa gatppp: Try to detect no carrier conditions 2011-02-28 16:13:56 -06:00
Denis Kenzior ea56a71067 gatppp: Delay signaling ppp_down
Delay signaling of ppp_down until we exit the GAtHDLC read handler.
Otherwise exchanging the read handler on GAtIO might lead to funny
double consumption problems.
2011-02-28 16:13:56 -06:00
Denis Kenzior e880aab120 gatppp: Replace some left-over g_prints with DBG 2011-02-28 16:13:55 -06:00
Denis Kenzior b6bc221bc8 gatppp: Send the final terminate ack
In the case where we're going down, but have a pending terminate ack,
delay signaling the upper layers until the ack has been put on the wire.
2011-02-28 16:13:55 -06:00
Lucas De Marchi 521071a785 gatchat: explicitly compare pointers to NULL
This patch was generated by the following semantic patch
(http://coccinelle.lip6.fr/)

// <smpl>
@fix disable is_null,isnt_null1@
expression *E;
@@

- !E
+ E == NULL
// </smpl>
2010-11-29 12:05:29 -06:00
Lucas De Marchi 53f1e826c6 Fix common misspellings in gatchat
Fix common misspellings by using the list available at
http://en.wikipedia.org/wiki/Wikipedia:Lists_of_common_misspellings/For_machines

From the list cited above, the substitution script found the following
misspellings:

priviledge->privilege
succeded->succeeded
2010-09-14 16:00:42 +09:00
Zhenhua Zhang b3c35db955 gatppp: Unset disconnect function when unref PPP
Unset IO disconnect function when we try to destroy GAtPPP instance.
After freeing the instance, the IO disconnect function should not be
invoked.
2010-07-07 11:26:55 -05:00
Zhenhua Zhang b86b2d3299 gatppp: Check ppp instance before unref it 2010-07-06 09:47:15 -03:00
Denis Kenzior 820b1f55c8 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.
2010-06-29 11:53:11 -05:00
Denis Kenzior d7c0640412 ppp: Tweak set_server_info API some more 2010-06-29 11:49:40 -05:00
Denis Kenzior 90d240820b ppp: Tweak the set_server_info API 2010-06-28 17:38:54 -05:00
Zhenhua Zhang 588db02354 gatppp: Add PPP server extension
1. Add interface to set PPP server info by g_at_ppp_set_server_info.
2. Pass local and peer address through IPCP handshaking.
2010-06-28 10:17:58 -05:00
Denis Kenzior 48c3c4268c gatppp: whitespace issues 2010-06-11 09:20:05 -05:00
Denis Kenzior a0eafc269e gatppp: Unref HDLC when unrefing PPP 2010-06-11 09:20:05 -05:00
Kristen Carlson Accardi 3fff4c49c8 ppp: implement ppp_packet_new 2010-05-19 02:58:45 -05:00
Denis Kenzior 3946d7e07c ppp: Keep these defines private 2010-05-10 16:28:23 -05:00
Kristen Carlson Accardi 125fc62526 ppp: set address and control field
Before sending to hdlc, set the address and control field.
Fix hardcode of ppp header size.
2010-05-10 16:27:15 -05:00
Kristen Carlson Accardi 2d8a1462db ppp: transition to dead when lcp finished
Transition to DEAD when lcp is finished and ignore any io
disconnects if we are already dead.
2010-05-10 15:29:44 -05:00
Denis Kenzior 6d20194e75 ppp: Refactor connect / disconnect callbacks
Right now it is very hard to figure out whether we should be calling the
connect callback or the disconnect callback.  So refactor as follows:
	- Connect callback is only called once the net is actually up
	- Disconnect callback is called once ppp is down, with a reason
	  for why it is so.
2010-04-30 15:31:26 -05:00
Denis Kenzior 9ae0dcb47d ppp: get rid of ppp_enter_phase
This function simply didn't have the context of why the phase was being
entered.  Instead have each protocol notify GAtPPP as to what is
happening.  We already had this more or less for IPCP and AUTH events,
this just now formalizes it for LCP as well.
2010-04-30 14:37:17 -05:00
Denis Kenzior c7ef06f91e ppp: Add _from_io constructor 2010-04-30 10:52:16 -05:00
Kristen Carlson Accardi 5ef90f934b ppp: fix return of drop_packet for NETWORK phase 2010-04-29 18:49:16 -05:00
Kristen Carlson Accardi 7d59d7a377 ppp: silently drop invalid packets 2010-04-29 14:40:20 -05:00
Kristen Carlson Accardi 9d5eb5110f ppp: transition to dead when read io destroyed
remove call to signal_close for lcp object, it is redundent.  If
our io is destroyed we are dead, so transition the ppp phase to
DEAD so our disconnect callback can be called.
2010-04-29 14:24:47 -05:00
Denis Kenzior c9edf56fc6 ppp: Hang set_recording off the GAtPPP object
Marcel: recording right now only works for PPP, so we'd need some sort
of multi-protocol support.

So for now expose set_recording to be used through the main PPP object.
HDLC object recording support needs to be extended.
2010-04-28 20:25:10 -05:00
Denis Kenzior fb8ca665dd ppp: Re-add capability to detect io down events 2010-04-28 17:27:36 -05:00