From 9fea1535934b5f04a82b43a6a465cccd4f490586 Mon Sep 17 00:00:00 2001 From: Guillaume Zajac Date: Wed, 4 May 2011 17:39:00 +0200 Subject: [PATCH] ppp_net: add ppp_net_suspend_interface() function --- gatchat/ppp.h | 1 + gatchat/ppp_net.c | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/gatchat/ppp.h b/gatchat/ppp.h index d2786d7..22809d8 100644 --- a/gatchat/ppp.h +++ b/gatchat/ppp.h @@ -107,6 +107,7 @@ const char *ppp_net_get_interface(struct ppp_net *net); void ppp_net_process_packet(struct ppp_net *net, const guint8 *packet); void ppp_net_free(struct ppp_net *net); gboolean ppp_net_set_mtu(struct ppp_net *net, guint16 mtu); +void ppp_net_suspend_interface(struct ppp_net *net); /* PPP functions related to main GAtPPP object */ void ppp_debug(GAtPPP *ppp, const char *str); diff --git a/gatchat/ppp_net.c b/gatchat/ppp_net.c index 1a6cdf7..9abf590 100644 --- a/gatchat/ppp_net.c +++ b/gatchat/ppp_net.c @@ -196,3 +196,12 @@ void ppp_net_free(struct ppp_net *net) g_free(net->if_name); g_free(net); } + +void ppp_net_suspend_interface(struct ppp_net *net) +{ + if (net == NULL || net->channel == NULL) + return; + + if (net->watch) + g_source_remove(net->watch); +} -- 2.7.4