Commit Graph

642 Commits

Author SHA1 Message Date
Denis Kenzior a6f910e27c gatserver: Change callback signature
Provide the originating GAtServer to the callback
2011-02-15 15:47:32 -06:00
Denis Kenzior a0cca0a970 gatserver: extend D with GSM/UMTS specifics 2011-02-15 15:47:32 -06:00
Denis Kenzior 5da299ad34 test-server: Behavior to match previous commit 2011-02-15 15:47:32 -06:00
Denis Kenzior 61b30c025d gatserver: Don't bother reporting command prefixes
The command line parser knows where the actual command line parameters
begin, so there's no need to make the callback skip the prefix and the
additional separator characters.
2011-02-15 15:47:32 -06:00
Martin Xu ad16e81aff PPP: Fix transmit ACCM and receive ACCM mixup
According to RFC1662 Section 7.1, ACCM Configuration Option is
used to inform the peer which control characters MUST remain
mapped when the peer sends them.
2011-02-14 14:22:32 -06:00
Olivier Guiter a1f5a5520a gatserver: Add ATS5 command feature 2011-02-14 09:51:30 -06:00
Denis Kenzior 2b9a14dd0c gatmux: Remove unused error variable 2011-02-08 16:48:52 -06:00
Carlos Pargada 1b10f55f5c gatchat: improve large file downlink data transfer
Fix large file downlink data transfer on IFX modem. Increase buffer size of
ring buffer to support close received Packets from the modem. Set highest
priority for write data on IO device
2011-01-20 12:59:40 +01:00
Marcel Holtmann d70011661c gatchat: The IO setup already ensures no encoding and no buffering 2011-01-20 10:56:21 +01:00
Marcel Holtmann 5d524cac73 gatchat: Small cleanup to make function look simpler 2011-01-20 10:55:31 +01:00
Marcel Holtmann 2f2460f5ae gatchat: Disable encoding for RawIP GIOChannel 2011-01-19 15:28:59 +01:00
Marcel Holtmann 2126700c3e gatchat: Fix setup of GIOChannel from multiplexer DLC 2011-01-19 12:10:10 +01:00
Denis Kenzior 45abba276b gatchat: Turn off buffering of GAtChat IO channels
After commit d83da35370 this was causing
the command queue to never run.
2011-01-18 12:16:19 -06:00
Olivier Guiter b931e77470 gatserver: ATS6 command handler added 2011-01-18 16:10:23 +01:00
Marcel Holtmann d83da35370 gatchat: Use g_io_channel_read_chars and g_io_channel_write_chars 2011-01-18 15:11:31 +01:00
Jeevaka Badrappan 2182336c8b gatchat: M15 coding styles fixes 2011-01-12 08:06:59 -08:00
Vinicius Costa Gomes 2702a2e349 gatchat: fix canceling in progress commands
As g_queue_peek_head() returns the node data field, we have to compare
it against the actual command, not against the pointer to the queue node.
2010-12-07 12:16:20 -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
Denis Kenzior 99107c6c9d gatchat: remove write watcher on a disconnect
There's a small probability that we call chat_wakeup_writer
just before the channel disonnects.  When this happens the write
watcher still fires causing a potential crash.
2010-11-23 03:21:22 -06:00
Marcel Holtmann 8c0163bfc0 gatchat: A full support for TUN/TAP pipe and GAtRawIP 2010-10-26 16:57:35 +02:00
Marcel Holtmann a34a8840c9 gatchat: Remove unused write_watch variable of GAtHDLC 2010-10-26 15:16:35 +02:00
Marcel Holtmann 79e23355a4 gatchat: Fix missing return value for g_at_chat_set_slave 2010-10-21 20:34:13 +02:00
Marcel Holtmann 692cf6a6f6 gatchat: Add skeleton for GAtRawIP module
This adds the basic skeleton for a GAtRawIP support. It is only the
skeleton with its intended API. It has no raw IP support yet.
2010-10-21 19:36:18 +02:00
Marcel Holtmann 7492223f49 gatchat: Add support for slave chat instances
This adds support to assign a slave chat instance to an existing chat
instance. The slave chat is now additionally bound by the lifetime of
its master chat instance.

In case the master is cloned, the slave chat instance will also be
cloned as well.

With this it is possible to suspend the master while still have an
active slave for notifications or extra commands.
2010-10-21 18:41:38 +02:00
Marcel Holtmann d0cbae0092 ppp: Fix some coding style and memory leaks 2010-10-21 18:26:50 +02:00
Marcel Holtmann 0caafef6c9 gatchat: Add support for skipping AT+CMUX speed parameter 2010-10-19 18:50:52 +02:00
Denis Kenzior 1e1ddfcf1b gatchat: Fix calling unregister from callbacks
This fixes the issues with SIM hotswap on infineon
2010-10-14 09:42:42 -05:00
Denis Kenzior fd113f7204 gatchat: break out the remove_if logic
And make unregister_group use the new function
2010-10-14 09:42:42 -05:00
Denis Kenzior 7fd86cf94f gatchat: quit early if the group id doesn't match
If the ID of the notify matches but the group id does not match it means
that the unregister is being called with an id that does not belong to
that particular group.  Checking further entries is no longer necessary.
2010-10-14 09:42:42 -05:00
Denis Kenzior 94fb2f23f8 gatsyntax: Fix responses starting with a quote 2010-09-29 05:37:41 -05:00
Marcel Holtmann 3dbfa4a7b4 gatchat: Hook up g_at_mux_set_debug to print debug messages for real 2010-09-26 17:25:27 +09: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
Denis Kenzior 54c75c47f8 gatchat: Skip string contents in extract_line 2010-08-16 13:11:44 -05:00
Denis Kenzior 5681e9df49 gatchat: Handle embedded \r and \n in responses 2010-08-16 12:44:50 -05:00
Denis Kenzior 0b2beb0068 gatutil: Handle non-printable characters
Signed arithmetic and shifts do not work well...
2010-08-16 11:25:19 -05:00
Denis Kenzior 5f47eca7ed gatchat: Add g_at_chat_clone
This function will clone a chat object, but will create a new group
internally.
2010-08-12 16:06:32 -05:00
Denis Kenzior 2356ebf9ef gatchat: Make GAtChat a facade for struct at_chat
Each GAtChat object is now simply a representation of a set of
outstanding commands and registered unsolicited notification handlers.
This makes it easy to cancel entire groups, e.g. by canceling the
GAtChat object itself rather than forcing the user into tracking all
relevant g_at_chat_register and g_at_chat_send ids.
2010-08-12 16:06:27 -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
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 e70b1f0abd gatserver: Restore GAtServer disconnect handling
Restore GAtServer disconnect handling when resuming a server session
2010-07-07 11:26:55 -05:00
Zhenhua Zhang 1badaf741a test-server: Refactor set_raw_mode
Rename variable 'options' to 'ti' and use sizeof(ti).
2010-07-06 22:30:32 -03:00
Zhenhua Zhang 2d219d37f9 gatserver: Don't free twice after user disconnect
It's possible to free gatserver in user disconnect function. So we
should not free it again.
2010-07-06 11:24:44 -05:00
Zhenhua Zhang 4ec07e9443 test-server: Use cfmakeraw to set TTY raw mode
Use cfmakeraw to disable echoing and special characters processing. If
we don't turn off ICRNL, TTY layer translates \r\n to \n\n.
2010-07-06 09:49:48 -03:00
Zhenhua Zhang b86b2d3299 gatppp: Check ppp instance before unref it 2010-07-06 09:47:15 -03:00
Denis Kenzior a92d37454a gsmdial: Wait for a no carrier before sending CFUN 2010-06-29 12:15:44 -05:00
Denis Kenzior 3a6b3bcd0c test-server: Send a NO_CARRIER when ppp is done 2010-06-29 12:12:42 -05:00
Denis Kenzior 2955c206e4 test-server: Update to the new API 2010-06-29 12:01:34 -05: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 969862337a test-server: Update to the new API 2010-06-29 11:50:25 -05:00
Denis Kenzior d7c0640412 ppp: Tweak set_server_info API some more 2010-06-29 11:49:40 -05:00
Denis Kenzior 295270b4be hdlc: Stop recording packets to stdout (fd = 0) 2010-06-29 11:46:40 -05:00
Denis Kenzior aca0fdf87f hdlc: Don't bother recording empty packets 2010-06-29 11:46:20 -05:00
Zhenhua Zhang 1afd51a8c7 gsmdial: Configure network interface for PPP 2010-06-28 17:39:23 -05:00
Zhenhua Zhang 0725aba03f test-server: Configure network interface
Require ROOT priviledge to:
1. Run external command to configure and bring up network interface.
2. Enable kernel IP forwarding.
2010-06-28 17:39:18 -05:00
Denis Kenzior 90d240820b ppp: Tweak the set_server_info API 2010-06-28 17:38:54 -05:00
Zhenhua Zhang b6601bfeed test-server: Add PPP server support
So that gsmdial and wvdial could talk to test-server and establish PPP
connection.
2010-06-28 16:37:20 -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 8be0707ab0 gsmdial: Update to the new API 2010-06-28 10:19:14 -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
Zhenhua Zhang 9f180fc27a ppp: Fix leak in pppcp_send_protocol_reject
Free the reject pppcp packet after ppp_transmit.
2010-06-21 09:19:55 -05:00
Denis Kenzior ab76f57cf9 gathdlc: Don't crash if unreffed in callback 2010-06-18 12:23:10 -05:00
Zhenhua Zhang e2e17512e0 gsmdial: Unref ppp when we get disconnected 2010-06-17 14:57:49 -05:00
Zhenhua Zhang 199582f684 test-server: Fix GIOChannel leak in create_tty
Remove client_io and unref server_io after creating GAtServer.
2010-06-17 14:54:42 -05:00
Zhenhua Zhang 1822deba4a gatserver: Check for disconnection when resuming
If the internal GAtIO is no longer valid, treat it as if our channel was
disconnected.
2010-06-17 14:38:53 -05:00
Zhenhua Zhang 047ea0cebb gatserver: Suspend/resume GAtServer with GAtIO
Support g_at_server_suspend and g_at_server_resume operation by using
GAtIO to handle IO related function.
2010-06-17 14:38:23 -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
Denis Kenzior 75e6a4707b gathdlc: Free the main HDLC structure on unref 2010-06-11 09:20:05 -05:00
Denis Kenzior 719842ea39 gatchat: Check for disconnection when resuming
If the internal GAtIO is no longer valid, treat it as if our channel was
disconnected.
2010-06-07 19:32:26 -05:00
Marcel Holtmann 6178173160 Restore GAtChat disconnect handling when resuming a chat session 2010-06-07 02:18:39 -07:00
Denis Kenzior 1803f00c6e ppp: Trivial whitespace error 2010-05-19 05:26:21 -05:00
Kristen Carlson Accardi 3fff4c49c8 ppp: implement ppp_packet_new 2010-05-19 02:58:45 -05:00
Kristen Carlson Accardi 41188e326a ppp: fix another hardcode of ppp_packet size 2010-05-11 09:26:08 -05:00
Denis Kenzior 1794ad32fd gsmdial: Shut down cleanly when ppp link dies 2010-05-10 16:36:33 -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 f13d5e2bad gsmdial: use g_at_ppp_new_from_io() 2010-05-10 15:41:39 -05:00
Kristen Carlson Accardi 72c38f7adb gatchat: implement g_at_chat_get_io() 2010-05-10 15:41:39 -05:00
Kristen Carlson Accardi cb36130b13 gsmdial: use g_at_chat_suspend 2010-05-10 15:41:39 -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 02c2cdaf21 gsmdial: Port to new PPP api 2010-04-30 15:32:45 -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
Denis Kenzior 95e0a15010 gathdlc: Add from_io constructor 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
Denis Kenzior 378f3c61e3 gathdlc: Add accessor for GAtIO 2010-04-28 17:27:36 -05:00
Denis Kenzior 3b98ed067a gathdlc: Port GAtHDLC to use GAtIO 2010-04-28 17:27:36 -05:00
Denis Kenzior d271216112 ppp: Don't crash if the interface wasn't created 2010-04-28 17:27:36 -05:00
Denis Kenzior db0b7c8a98 ppp: Accept 1500 byte MTUs 2010-04-28 17:27:36 -05:00
Denis Kenzior 7d5a3730d1 gsmdial: Use set recording on the HDLC object 2010-04-28 17:27:36 -05:00
Denis Kenzior ed15727b98 ppp: Add getter for HDLC object 2010-04-28 17:27:36 -05:00
Denis Kenzior 4cdf49f0de ppp: Initial port of PPP to use GAtHDLC 2010-04-28 17:27:35 -05:00
Denis Kenzior fa8614cc78 ppp: Make pppcp functions const correct 2010-04-28 17:27:35 -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
Denis Kenzior 5acb633a1d gathdlc: Add recording support, ported from PPP
For protocol examination using wireshark
2010-04-28 17:27:35 -05:00
Denis Kenzior 41ce6212a1 gathdlc: Add receive ACCM support 2010-04-28 17:27:35 -05:00
Denis Kenzior 7c6c72f558 gathdlc: Support transmit ACCM 2010-04-28 17:27:35 -05:00
Denis Kenzior e088f3c2bb gatchat: Don't try to cleanup twice
In case we get unrefed from the disconnect callback
2010-04-28 17:27:35 -05:00
Denis Kenzior 0845dc3b5d gatchat: Use GAtIO for write watchers 2010-04-28 17:27:34 -05:00
Denis Kenzior 6a66505e46 gatio: support for blocking / nonblocking writes 2010-04-28 17:27:34 -05:00
Denis Kenzior 85448aac8c gatchat: get_channel should return one from GAtIO 2010-04-28 17:27:34 -05:00
Denis Kenzior 19115e0a15 gatchat: Channel is now setup by GAtIO 2010-04-28 17:27:34 -05:00
Denis Kenzior 033b576593 gatchat: Better re-entrancy handling 2010-04-28 17:27:34 -05:00
Denis Kenzior 9c3ae4746e gsmdial: Get rid of g_at_chat_shutdown usage 2010-04-28 17:27:34 -05:00
Denis Kenzior d875298404 gsmdial: Unref the chat instead of using shutdown 2010-04-28 17:27:34 -05:00
Denis Kenzior 8645b05c4f gatmux: Unref the chat instead of using shutdown 2010-04-28 17:27:34 -05:00
Denis Kenzior f9b2e5cf5a gatchat: Only set debug on IO if we have it 2010-04-28 17:27:33 -05:00
Denis Kenzior 3aa1faddef gatchat: Replace shutdown by suspend/resume
Shutdown was actually pointless and according to Marcel he only had it
in mind for PPP useage.
2010-04-28 17:27:33 -05:00
Denis Kenzior 7b8f4f5dc8 gatchat: port gatchat to use gatio 2010-04-28 17:27:33 -05:00
Denis Kenzior 43c30e2292 gatio: Remove g_at_io_shutdown 2010-04-28 17:27:33 -05:00
Denis Kenzior 204814da05 gatio: Get re-entrancy correct 2010-04-28 17:27:32 -05:00
Denis Kenzior c614254ae9 gatio: Style fix for gsource id comparisons 2010-04-28 17:27:32 -05:00
Denis Kenzior 2d2bc8b5b3 gatio: Kill the reader when no more space 2010-04-28 17:27:32 -05:00
Denis Kenzior f09ce13ad7 gatchat: Remove g_at_chat_set_syntax
Never used and too unsafe in its current form
2010-04-28 17:27:32 -05:00
Denis Kenzior 5fc7c1e1d0 gatchat: Add initial GAtIO implementation 2010-04-28 17:27:32 -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
Kristen Carlson Accardi fce78feb54 ppp: discard non-LCP packets in ESTABLISHMENT phase 2010-04-26 12:38:31 -05:00
Marcel Holtmann cc1975270c Fix broken HDLC flag handling 2010-04-24 19:12:30 +02:00
Marcel Holtmann 057bd9f0b3 Fix wrong escape character check in HDLC transmit 2010-04-24 19:02:04 +02:00
Marcel Holtmann 46839fbd15 Allow real wrapping around of HDLC transmit ring buffer 2010-04-24 19:00:54 +02:00
Marcel Holtmann 8f05535bb2 Add offset parameter to ring_buffer_write_ptr() function 2010-04-24 18:59:44 +02:00
Marcel Holtmann 9fd7d841c8 Add support for wrapping of HDLC transmit ring buffer 2010-04-24 18:54:34 +02:00
Marcel Holtmann d2c8f124e6 Use HDLC_FCS helper where possible 2010-04-23 17:22:56 +02:00
Marcel Holtmann 2a609f9054 Use HDLC constants instead of magic numbers 2010-04-23 17:21:49 +02:00
Marcel Holtmann a31870f542 Add support for wrapping of HDLC receive ring buffer 2010-04-23 17:18:30 +02:00
Denis Kenzior fa5e8cf56b ppp: Fix trivial style error 2010-04-22 17:58:29 -05:00
Kristen Carlson Accardi e98fb9a6bd ppp: change MTU on TUN device when MRU option received 2010-04-22 17:56:31 -05:00
Denis Kenzior fde23f113a ppp: Request MRU if we ever get NAKed with it
Huawei E160G hardware seems to NAK our configure request and suggest
that it will never send packets bigger than 1440 bytes.  Since we don't
particularly care (our receive ring buffer is 4K, so it can handle 2048
byte packets), we just re-send the Configure Request with the preferred
value.
2010-04-22 15:08:05 -05:00
Denis Kenzior 07280e1bff ppp: Fix trivial copy paste error 2010-04-22 15:07:42 -05:00
Denis Kenzior 226865272c ppp: Shut off IPCP when entering TERMINATING phase 2010-04-22 15:05:18 -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
Marcel Holtmann 123b87de2c No to check for NULL pointers with g_free 2010-04-15 04:42:03 -07: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 15d93ad0b9 Fix: GAtMux channels should return EAGAIN
GAtChat uses non-blocking semantics, so the GAtMux channels should
return the EAGAIN status to make GAtChat work properly.
2010-04-14 10:39:47 -05:00
Denis Kenzior c8aa645973 ppp: Refing the channel is actually not necessary
The read_watch and write_watches both take a ref
2010-04-13 15:57:07 -05:00
Denis Kenzior 8e15816ac1 Fix: Don't try to set channel flags if they're 0 2010-04-13 15:37:05 -05:00
Denis Kenzior c74e2ab189 ppp: TUN channel should not be opened NONBLOCKING
We don't handle it as a nonblocking channel and getting it right would
be a nightmare.
2010-04-13 15:35:55 -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
Kristen Carlson Accardi 9c3631f24e ppp: remove references to magic number
We will not support loopback detection.
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 71ddfca269 ppp: Use chap functions directly, instead of auth 2010-04-13 14:21:16 -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 e21bb72df0 ppp: Add set / get password & username
Also refactor the set credentials function, we will be removing the auth
object shortly
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 552db428ef ppp: Refactor how tls/tlu/tld/tlf are used
With the upper layer driving these, the special handling is no longer
required.
2010-04-13 14:00:01 -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 87939c2fcf Merge: make link 2010-04-13 13:57:03 -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 843db6f9a5 ppp: unref should mean a hard shutdown
This can happen when e.g. the modem is physically removed from the
system and it is not feasible to wait for the nice shutdown state to be
reached.
2010-04-13 12:03:32 -05:00
Denis Kenzior b916f189f5 ppp: Signal Down & Close when socket is closed 2010-04-13 12:03:32 -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 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 36d15b4366 ppp: Keep track when read watcher dies 2010-04-13 12:03:32 -05:00
Denis Kenzior 79d81af431 ppp: Remove unused define 2010-04-13 12:03:32 -05:00
Denis Kenzior 6ac0025767 Fix: busy loop in atserver 2010-04-12 22:33:42 -05:00
Marcel Holtmann 7a27cc42fc Reindent the handler registration inside AT server 2010-04-12 18:13:02 -07:00
Marcel Holtmann f319e65b99 Use ppp_debug() for PPP CP event debug statements 2010-04-12 18:02:11 -07:00
Marcel Holtmann 143d6db7c3 Remove useless debug in PPP transmit destroy callback 2010-04-12 17:53:29 -07:00
Marcel Holtmann a977ecf260 Remove various GDestroyNotify function casting 2010-04-12 17:48:20 -07:00
Marcel Holtmann 5b229e60c9 The exit() function should always use positive exit values 2010-04-12 17:37:50 -07:00
Marcel Holtmann 0e178517ce Fix file descriptor leakage when closing PPP recording 2010-04-12 17:34:24 -07:00
Marcel Holtmann 313eb4f285 The AT+CGDATA command should return CONNECT on success 2010-04-12 16:36:06 -07:00
Marcel Holtmann 9fe2d4c88c Add fake support for AT+CGDATA and AT+CGDCONT inside AT server 2010-04-12 16:34:13 -07:00
Marcel Holtmann a21499ca01 Add basic support for emulating AT+CGATT inside AT server 2010-04-12 16:28:59 -07:00
Marcel Holtmann 4add05f4f0 Add basic support for emulating AT+CGREG inside AT server 2010-04-12 16:22:57 -07:00
Marcel Holtmann 5c1da8f6fc Add basic support for emulating AT+CREG inside AT server 2010-04-12 16:19:34 -07:00
Marcel Holtmann 156904535e Check for PIN after activating the modem 2010-04-11 18:23:24 +02:00
Marcel Holtmann 3187e46799 Reduce fake CFUN delay to 1 second to make testing simpler 2010-04-11 18:18:01 +02:00
Marcel Holtmann 4e16e48b24 Make CPIN handling of AT server a bit more compliant 2010-04-11 18:14:12 +02:00
Marcel Holtmann 0cafc1646c Add really simple COPS support to AT command server 2010-04-11 18:10:50 +02:00
Marcel Holtmann 2dab6bc3a6 The user data pointer variable should be called user_data 2010-04-11 17:42:40 +02:00
Marcel Holtmann 0b2014df05 Implement full CFUN handling for AT server 2010-04-11 17:36:34 +02:00
Marcel Holtmann 46e77907b3 Use a ring buffer for non-blocking HDLC output streams 2010-04-11 07:01:14 +02:00
Marcel Holtmann 6ddf874318 Add initial implementation for QCDM test utility 2010-04-10 15:13:23 +02:00
Marcel Holtmann 20b394e72b Add abstraction for HDLC stream handling 2010-04-10 15:11:46 +02:00
Marcel Holtmann a9c204effa Add utility helper for debugging binary blobs 2010-04-10 11:56:11 +02:00
Marcel Holtmann 4c76be6c0d Add generic receive function definition 2010-04-10 11:54:12 +02:00
Marcel Holtmann 017b4d3955 Check for PIN status to see details in debug output 2010-04-10 09:33:45 +02:00
Marcel Holtmann 8cd991b81f Add skeleton for QCDM test program 2010-04-10 01:33:47 +02:00
Marcel Holtmann 455884d86e Remove one empty line and add another one 2010-04-09 17:10:48 +02:00
Marcel Holtmann df9723db02 Move CRC-CCITT table and helper into separate file 2010-04-09 17:08:30 +02:00
Denis Kenzior a4921aef11 ppp: Trivial style fix
Be more explicit
2010-04-09 08:57:12 -05:00
Denis Kenzior 5a25fd6f11 ppp: Use flags not booleans for ipcp options 2010-04-09 08:55:16 -05:00