Commit Graph

2069 Commits

Author SHA1 Message Date
Denis Kenzior 04cfa990e2 Refactor: add pppcp_set/get_magic_number 2010-04-05 16:55:07 -05:00
Denis Kenzior de83e99644 Refactor: add pppcp_set_prefix 2010-04-05 16:46:08 -05:00
Denis Kenzior 97b0aa590d Refactor: add pppcp_get_ppp 2010-04-05 16:44:00 -05:00
Denis Kenzior 7739af4a26 Refactor: add pppcp_set_option_strings 2010-04-05 16:42:17 -05:00
Denis Kenzior 7b447dd0e2 Refactor: Move valid code selection to ipcp/lcp
We already have a set_valid_codes function, let us use it
2010-04-05 16:16:14 -05:00
Denis Kenzior 4f5de3426e Refactor: Move packet_ops to a static look-up
No need to allocate space for this, as it is always the same for all
instances.
2010-04-05 16:14:39 -05:00
Denis Kenzior 48a012c810 Refactor: Make option_scan more type safe 2010-04-05 14:32:11 -05:00
Denis Kenzior 5e8a9c2941 Refactor: Make option_process more typesafe
option_process was declared with two gpointer arguments for the sole
reason of being used as a GFunc.  Casting to a GFunc or re-writing the
foreach as a loop is preferable.
2010-04-05 14:25:14 -05:00
Denis Kenzior 60d96505dc Refactor: Add pppcp_set_data & pppcp_get_data
Using these functions makes the code much cleaner than trying to pass
the priv pointer everywhere
2010-04-05 14:16:00 -05:00
Marcel Holtmann 331fcaea32 Make pppcp_code enum a private structure 2010-04-05 11:12:43 -07:00
Marcel Holtmann 12ffb2c772 Make pppcp_event_type enum a private structure 2010-04-05 11:05:08 -07:00
Denis Kenzior 64ffcf1cfa Refactor: Move to a transition state table
It is much more compact to re-implement the transition states as a table
as opposed to functions with switch/case statements.  The logic is made
much easier to follow and much of the code duplication is eliminated
2010-04-05 12:36:43 -05:00
Denis Kenzior d6517e63fe Refactor: Make the enum assignments explicit
They will be used for certain magic later on
2010-04-05 10:13:10 -05:00
Denis Kenzior e56710e1da Refactor: Move the state definition to ppp_cp.c 2010-04-05 10:12:39 -05:00
Kristen Carlson Accardi 9905245e79 ppp: implement Max-Failure counter
put a cap on the number of Configure-Nak packets we send.
2010-04-05 09:45:14 -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
Marcel Holtmann 352ea97f8f Hide internals of ring buffer structure 2010-04-02 21:51:19 -07:00
Marcel Holtmann 09f7be82a9 Remove circular inclusion protection from ring buffer header 2010-04-02 20:34:25 -07:00
Marcel Holtmann 764501482e Fix some cases where g_try_new should be used 2010-04-02 19:20:53 -07:00
Marcel Holtmann 4733ddaffa Move frame NULL checks into the unstuffing function 2010-04-02 19:06:31 -07:00
Marcel Holtmann 9d8e55d489 Fix coding style with callback structures 2010-04-02 19:01:38 -07:00
Kristen Carlson Accardi 3c3077f847 ppp: implement net close 2010-04-02 19:03:56 -05:00
Denis Kenzior ebc6e3b9dc Refactor: Get rid of (now) pointless comments 2010-04-02 19:03:56 -05:00
Marcel Holtmann ffa99a1ebb Also the default case should have a break statement 2010-04-02 13:48:44 -07:00
Denis Kenzior 349d4d8c5d Remove the PPP option from gsmdial
Pointless since we should always connect using PPP
2010-04-02 15:13:25 -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
Marcel Holtmann 3c39543cd6 Fix tabs vs. whitespace coding style violation 2010-04-02 13:34:10 -07:00
Marcel Holtmann 76200165bb Add more missing break statements 2010-04-02 13:33:35 -07:00
Kristen Carlson Accardi 0766a67832 ppp: fix missing breaks in switch statements 2010-04-02 13:19:14 -07:00
Marcel Holtmann 8097a1ed52 Add missing break or fall through comments to switch statements 2010-04-02 12:40:45 -07:00
Marcel Holtmann 0e8b2815a8 Always reset option_rval for every option 2010-04-02 11:43:20 -07:00
Marcel Holtmann 843d3bd2a3 Add missing arpa/inet.h includes 2010-04-02 11:42:42 -07: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
Denis Kenzior 398acbc976 Fix: Make the C-APDU logic more readable 2010-04-02 11:28:02 -05:00
Denis Kenzior c2d46ba4eb Style: Multiline comments 2010-04-02 11:20:44 -05:00
Denis Kenzior 5665cefd47 Fix: Tweak the language parser 2010-04-02 11:19:03 -05:00
Denis Kenzior af3af57696 Fix: Remove erroneous comment 2010-04-02 11:11:53 -05:00
Denis Kenzior 30c07824ed Fix: AT Commands are probably just text 2010-04-02 11:11:13 -05:00
Denis Kenzior 6fb687b996 Fix: Trivial indentation issues 2010-04-02 11:08:41 -05:00
Yang Gu 46f5f65214 Add parser for browser identity objects 2010-04-02 11:05:42 -05:00
Yang Gu f5c0041240 Add parser for language objects 2010-04-02 11:05:17 -05:00
Yang Gu fa846bd4a4 Add parser for dtmf string objects 2010-04-02 11:04:44 -05:00
Yang Gu 2490058b08 Add parser for bc repeat indicator objects 2010-04-02 11:03:07 -05:00
Yang Gu 0958247c3f Add parser for at response objects 2010-04-02 11:02:53 -05:00
Yang Gu 94b4c25517 Add parser for at command objects 2010-04-02 11:02:42 -05:00
Yang Gu 1ae1fc8778 Add parser for date-time and time zone objects 2010-04-02 11:01:56 -05:00
Yang Gu b20e0d2bf5 Make function decode_scts public 2010-04-02 11:00:56 -05:00