ppp_net: add ppp_net_resume_interface() API

This commit is contained in:
Guillaume Zajac 2011-05-20 11:38:13 +02:00 committed by Denis Kenzior
parent 6f6a9747f8
commit 47f5887c29
2 changed files with 11 additions and 0 deletions

View File

@ -108,6 +108,7 @@ 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);
void ppp_net_resume_interface(struct ppp_net *net);
/* PPP functions related to main GAtPPP object */
void ppp_debug(GAtPPP *ppp, const char *str);

View File

@ -222,3 +222,13 @@ void ppp_net_suspend_interface(struct ppp_net *net)
g_source_remove(net->watch);
net->watch = 0;
}
void ppp_net_resume_interface(struct ppp_net *net)
{
if (net == NULL || net->channel == NULL)
return;
net->watch = g_io_add_watch(net->channel,
G_IO_IN | G_IO_HUP | G_IO_ERR | G_IO_NVAL,
ppp_net_callback, net);
}