Commit Graph

42 Commits

Author SHA1 Message Date
Marcel Holtmann 3472aa67a6 gatchat: Reword the fall through cases to avoid compiler warnings 2017-07-11 10:44:15 -07:00
Denis Kenzior e0e151e88c gatchat: Minor style fixup 2011-11-07 12:27:51 -06:00
Marcel Holtmann 21f9da9916 gatchat: Update copyright information 2011-10-10 13:39:25 -07:00
Denis Kenzior 57f32ff899 ppp: Remove some g_prints 2011-02-28 16:13:56 -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
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 674625ebe2 ppp: Don't accept 0 ip-addr/dns1/dns2 2010-06-29 11:55:18 -05: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 ae24477801 ppp: Refactor server RCR action
We need to generate the Conf-Rej / Conf-Nak in the same order as the
client sent us.
2010-06-28 15:58:03 -05:00
Denis Kenzior c5c7a229d2 ppp: Refactor client RCR action 2010-06-28 15:30:15 -05:00
Denis Kenzior d5c963f5d8 ppp: Simplify the logic by re-using code 2010-06-28 11:15:44 -05:00
Denis Kenzior cff81df606 ppp: Minor style tweaks 2010-06-28 10:21:33 -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
Zhenhua Zhang 28b2c32dc7 ppp: Fix incorrect packet length for little-endian
packet->length is in TCP/IP network byte order. It needs to call ntohs()
to convert to host byte order, which is little-endian.
2010-06-23 16:45:28 -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 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 9116b7e8f8 ppp: Let the upper layer handle open / up events
This removes the need for the layer_started functions in lcp and ipcp.
For LCP the link is always up unless the socket has been closed, and for
IPCP the link should be opened as soon as LCP is ready anyway.
2010-04-13 13:58:12 -05:00
Denis Kenzior dbbaa3c416 ppp: Reset the options whenever the layer is down
So we can re-negotiate the options if the layer is opened again.
2010-04-13 13:34:12 -05:00
Denis Kenzior 8c1677713f ppp: Rename data to pppcp 2010-04-13 13:27:23 -05:00
Denis Kenzior 5a25fd6f11 ppp: Use flags not booleans for ipcp options 2010-04-09 08:55:16 -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 7c3e43be03 ppp: port IPCP to the new option framework 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 fc26e6e409 ppp: Cleanup ipcp.c 2010-04-07 16:41:49 -05:00
Denis Kenzior 8bff9b6541 Refactor: Make struct pppcp declaration private 2010-04-05 16:55:28 -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 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
Marcel Holtmann 5772ad5d8b Make GAtPPP fields really private 2010-04-03 22:25:09 -07:00
Marcel Holtmann 9d8e55d489 Fix coding style with callback structures 2010-04-02 19:01:38 -07:00
Denis Kenzior ebc6e3b9dc Refactor: Get rid of (now) pointless comments 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
Denis Kenzior 1ed6966cb4 Split out ipcp protocol into ppp_ipcp.c 2010-04-02 12:53:45 -05:00