summaryrefslogtreecommitdiffstats
path: root/gatchat/ppp_cp.c
diff options
context:
space:
mode:
authorMarcel Holtmann <marcel@holtmann.org>2010-04-05 11:05:08 -0700
committerMarcel Holtmann <marcel@holtmann.org>2010-04-05 11:05:08 -0700
commit12ffb2c772fd35af4a18d3b8d1ef39a0c3895ec1 (patch)
tree8687ec61298470971c1b6f226f01f86a8801819d /gatchat/ppp_cp.c
parent64ffcf1cfacf9c400c0b6eb8c86f421341f988b2 (diff)
downloadofono-12ffb2c772fd35af4a18d3b8d1ef39a0c3895ec1.tar.bz2
Make pppcp_event_type enum a private structure
Diffstat (limited to 'gatchat/ppp_cp.c')
-rw-r--r--gatchat/ppp_cp.c40
1 files changed, 39 insertions, 1 deletions
diff --git a/gatchat/ppp_cp.c b/gatchat/ppp_cp.c
index 38b0bfee..115fb65e 100644
--- a/gatchat/ppp_cp.c
+++ b/gatchat/ppp_cp.c
@@ -135,6 +135,29 @@ static int cp_transitions[16][10] = {
{ INV, INV, 2, 3, 4, 5, 6, 7, 8, SER|9 },
};
+enum pppcp_event_type {
+ UP = 0,
+ DOWN = 1,
+ OPEN = 2,
+ CLOSE = 3,
+ TO_PLUS = 4,
+ TO_MINUS = 5,
+ RCR_PLUS = 6,
+ RCR_MINUS = 7,
+ RCA = 8,
+ RCN = 9,
+ RTR = 10,
+ RTA = 11,
+ RUC = 12,
+ RXJ_PLUS = 13,
+ RXJ_MINUS = 14,
+ RXR = 15,
+};
+
+static void pppcp_generate_event(struct pppcp_data *data,
+ enum pppcp_event_type event_type,
+ guint8 *packet, guint len);
+
static void pppcp_packet_free(struct pppcp_packet *packet)
{
g_free(pppcp_to_ppp_packet(packet));
@@ -638,7 +661,7 @@ static void pppcp_transition_state(enum pppcp_state new_state,
/*
* send the event handler a new event to process
*/
-void pppcp_generate_event(struct pppcp_data *data,
+static void pppcp_generate_event(struct pppcp_data *data,
enum pppcp_event_type event_type,
guint8 *packet, guint len)
{
@@ -715,6 +738,21 @@ error:
pppcp_illegal_event(data->state, event_type);
}
+void pppcp_signal_open(struct pppcp_data *data)
+{
+ pppcp_generate_event(data, OPEN, NULL, 0);
+}
+
+void pppcp_signal_close(struct pppcp_data *data)
+{
+ pppcp_generate_event(data, CLOSE, NULL, 0);
+}
+
+void pppcp_signal_up(struct pppcp_data *data)
+{
+ pppcp_generate_event(data, UP, NULL, 0);
+}
+
static gint is_option(gconstpointer a, gconstpointer b)
{
const struct ppp_option *o = a;