Commit Graph

58 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
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
Oleg Zhurakivskyy 82ac630693 gatchat: Add IPv6 Control Protocol 2011-11-07 12:24:30 -06: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 bc37c74653 gatppp: Refactor rx path 2011-06-29 03:35:13 -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
Guillaume Zajac 47f5887c29 ppp_net: add ppp_net_resume_interface() API 2011-05-24 12:25:07 -05:00
Guillaume Zajac 7e5ccc18d7 gatppp: Add new contructor to use external fd 2011-05-24 12:10:22 -05:00
Guillaume Zajac 9fea153593 ppp_net: add ppp_net_suspend_interface() function 2011-05-08 23:00:12 -05:00
Denis Kenzior 802962adbc gatppp: Add a debug macro 2011-02-28 16:13:55 -06: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
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
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
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 87340d64e2 ppp: Make ppp_chap_process_packet const correct 2010-04-28 17:27:35 -05:00
Denis Kenzior 955673573b ppp: Make ppp_net_process_packet const correct 2010-04-28 17:27:35 -05:00
Kristen Carlson Accardi e98fb9a6bd ppp: change MTU on TUN device when MRU option received 2010-04-22 17:56:31 -05:00
Kristen Carlson Accardi 71775550fe ppp: implement MRU option
If the peer requests a MRU option, set the mtu for the network
phase.  When we are in link establishment phase, we should
continue to behave as if no option has been set and the peer
should use the default MRU.

This option is required for the Huawei E160G modem.
2010-04-22 07:00:40 +02:00
Kristen Carlson Accardi 60643ee287 ppp: nak unknown auth protocol
If we are sent a Config-Request for an auth proto other than
CHAP with MD5, send a NAK.
2010-04-14 17:16:03 -05:00
Denis Kenzior 7085818f23 ppp: Cleanup function definitions in ppp.h 2010-04-13 15:32:35 -05:00
Kristen Carlson Accardi b74a9342d2 ppp: remove pfc and acfc
We will not support pfc or acfc
2010-04-13 15:32:35 -05:00
Denis Kenzior 0aaf98a354 ppp: Get rid of net_open and net_close
There really isn't a need for these now
2010-04-13 15:14:40 -05:00
Denis Kenzior 1d939052fc ppp: Introduce ppp_net_down_notify 2010-04-13 14:59:13 -05:00
Denis Kenzior d1d73a75fc ppp: Introduce ppp_net_up_notify and use it
This is slightly cleaner way than defining a weird callback function.
2010-04-13 14:55:10 -05:00
Denis Kenzior 6525826455 ppp: Hide ppp_net definition in ppp_net.c 2010-04-13 14:42:59 -05:00
Denis Kenzior 18e5e26acb ppp: Remove auth_ functions from ppp_auth.c
These really serve no purpose right now as we use only CHAP.  So they
only take up space and make the code harder to read.  If we implement
1-3 auth protocols, then they're easier handled inside gatppp.c.  If we
have more, then a proper auth driver framework is required.
2010-04-13 14:21:16 -05:00
Denis Kenzior 42f6e8ec6e ppp: introduce ppp_auth_notify
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.
2010-04-13 14:21:16 -05:00
Denis Kenzior fed99b9265 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.
2010-04-13 14:21:12 -05:00
Denis Kenzior f5270cc9bd ppp: Use pppcp_signal functions directly
No real need to wrap them behind lcp_ functions
2010-04-13 12:03:32 -05:00
Denis Kenzior b803ea8616 ppp: Fix make some functions const correct 2010-04-08 16:47:04 -05:00
Denis Kenzior 97ff3d56f4 Fix: Allow setting of tx ACCM
Specification is explicit that ACCM defaults to ~0
2010-04-06 22:49:47 -05:00
Marcel Holtmann c2fb0a1630 Move PPP constants where they are used 2010-04-03 22:32:27 -07:00
Marcel Holtmann 5772ad5d8b Make GAtPPP fields really private 2010-04-03 22:25:09 -07:00
Kristen Carlson Accardi 3c3077f847 ppp: implement net close 2010-04-02 19:03:56 -05:00
Denis Kenzior 2c466c8baf Refactor: Get rid of packet handler registrations
There are only about 4 protocols that the current ppp code handles and
it is doubtful that it will grow much more.  There's no point in having
an extensive packet handler registration framework.
2010-04-02 15:11:48 -05:00
Kristen Carlson Accardi 74e1abd353 ppp: use queue to transmit
Since we are using non buffered I/O, use a queue to transmit when buffer
space is available.
2010-04-02 13:05:47 -05:00
Denis Kenzior 1ed6966cb4 Split out ipcp protocol into ppp_ipcp.c 2010-04-02 12:53:45 -05:00
Kristen Carlson Accardi c2a589e732 ppp: fix event generation on close
Prevents too early transition to PPP_DEAD
2010-04-02 12:53:45 -05:00
Marcel Holtmann a845dc8da7 Remove obfuscation for some of the event handling 2010-04-01 20:40:39 -07:00
Marcel Holtmann 7d6649680f Remove PPP event_queue handling and process events directly 2010-04-01 20:26:24 -07:00
Marcel Holtmann dabac98cb4 Remove PPP recv_queue handling and process frames directly 2010-04-01 20:11:43 -07:00
Marcel Holtmann 544c02da49 Add support for recording PPP sessions in pppdump format 2010-04-01 13:47:25 -07:00
Marcel Holtmann ef82241deb Implement g_at_ppp_set_debug support 2010-04-01 13:11:11 -07:00
Marcel Holtmann 4f99859d37 Remove useless pppcp_protocol_data structure 2010-04-01 09:13:44 -07:00
Denis Kenzior cc1bb46ffa Refactor: Use GAtDisconnectFunc for ppp disconnect
The ppp argument to the current disconnect callback is useless as the
ppp structure is most likely stored in user data anyway.
2010-03-31 18:47:30 -05:00