Commit Graph

38 Commits

Author SHA1 Message Date
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
Zhenhua Zhang a72e092d19 ppp: Add MAX_IPCP_FAILURE to avoid timeout quickly
We use IPCP NAK response to stall the progress of acquiring the client
IP address from DHCP server. So we need to increase the max failure of
NAKs in IPCP handshaking.
2010-07-09 09:53:24 -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 fa8614cc78 ppp: Make pppcp functions const correct 2010-04-28 17:27:35 -05:00
Kristen Carlson Accardi a9c0be7339 ppp: use default ACCM when sending LCP codes 1-7
According to the spec, you must transmit all Link Configuration,
Termination, and Code-Reject packets as if no options had been
negotiated.  This requires that when encoding we use the
default ACCM of 0xffffffff when sending these types of packets.
2010-04-26 15:31:17 -05:00
Denis Kenzior a661dd1583 ppp: Add pppcp_signal_down
For use when the link is abruptly terminated by the remote side
2010-04-13 12:03:32 -05:00
Denis Kenzior cad3223a94 ppp: Rip out the now unused option string stuff
Using wireshark is much easier
2010-04-08 16:47:05 -05:00
Denis Kenzior 06298becc1 ppp: Rip out the old option processing
Put in the new option processing
2010-04-08 16:47:05 -05:00
Denis Kenzior c5590d114e ppp: Move some one-time setters to the proto 2010-04-08 10:40:12 -05:00
Denis Kenzior 4e01f9921e ppp: Add rca callback
When the other side acks our options, then let us apply these options
locally and start using them
2010-04-07 16:41:49 -05:00
Denis Kenzior 5f361d7de9 ppp: Add pppcp option iterators 2010-04-07 16:41:49 -05:00
Denis Kenzior 892ee0a364 ppp: Move pppcp_timer_data private 2010-04-07 16:41:49 -05:00
Denis Kenzior 340013c6ef ppp: Hide away the magic_number in ppp_lcp.c 2010-04-07 16:41:40 -05:00
Denis Kenzior 5e67ee2ff5 ppp: Remove OPTION_ERR, treat errors as reject 2010-04-06 22:49:47 -05:00
Denis Kenzior 8bff9b6541 Refactor: Make struct pppcp declaration private 2010-04-05 16:55:28 -05:00
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 edba0296c5 Remove PPP CP event_queue handling and process events directly 2010-04-01 21:44:07 -07:00
Marcel Holtmann 4f99859d37 Remove useless pppcp_protocol_data structure 2010-04-01 09:13:44 -07:00
Marcel Holtmann eb9e7872a9 Add debugging for PPP LCP and IPCP options 2010-04-01 00:07:40 -07:00
Kristen Carlson Accardi 5260379d98 ppp: send Protocol-Reject
change ppp_decode to store the length of the decoded frame, so that
if we have a packet with a protocol we don't understand, we can send
Protocol-Reject packets.  Modify ppp_cp code to add support for sending
Protocol-Reject packet.
2010-03-26 19:19:46 -07:00
Kristen Carlson Accardi af63a2b8ee ppp: change debug output to include control protocol prefix 2010-03-25 12:38:57 -07:00
Kristen Carlson Accardi 060a195432 use separate timers for PPP config and terminate
Prevent conflicts between config timer information and terminate timer
information by providing a new data structure which keeps timer information
for config and terminate requests separate.
2010-03-24 23:04:45 -05:00
Kristen Carlson Accardi 31e99d9d78 Generic PPP control protocol support
Implement a generic protocol that can be shared by both the LCP and the
NCP implementation.
2010-03-22 17:28:23 -07:00