3 * PPP library with GLib integration
5 * Copyright (C) 2009-2011 Intel Corporation. All rights reserved.
7 * This program is free software; you can redistribute it and/or modify
8 * it under the terms of the GNU General Public License version 2 as
9 * published by the Free Software Foundation.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
16 * You should have received a copy of the GNU General Public License
17 * along with this program; if not, write to the Free Software
18 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34 typedef struct _GAtPPP GAtPPP;
36 typedef enum _GAtPPPDisconnectReason {
37 G_AT_PPP_REASON_UNKNOWN,
38 G_AT_PPP_REASON_AUTH_FAIL, /* Failed to authenticate */
39 G_AT_PPP_REASON_IPCP_FAIL, /* Failed to negotiate IPCP */
40 G_AT_PPP_REASON_NET_FAIL, /* Failed to create tun */
41 G_AT_PPP_REASON_PEER_CLOSED, /* Peer initiated a close */
42 G_AT_PPP_REASON_LINK_DEAD, /* Link to the peer died */
43 G_AT_PPP_REASON_LOCAL_CLOSE, /* Normal user close */
44 } GAtPPPDisconnectReason;
46 typedef void (*GAtPPPConnectFunc)(const char *iface, const char *local,
48 const char *dns1, const char *dns2,
50 typedef void (*GAtPPPDisconnectFunc)(GAtPPPDisconnectReason reason,
53 GAtPPP *g_at_ppp_new(void);
54 GAtPPP *g_at_ppp_server_new(const char *local);
55 GAtPPP *g_at_ppp_server_new_full(const char *local, int fd);
57 gboolean g_at_ppp_open(GAtPPP *ppp, GAtIO *io);
58 gboolean g_at_ppp_listen(GAtPPP *ppp, GAtIO *io);
59 void g_at_ppp_set_connect_function(GAtPPP *ppp, GAtPPPConnectFunc callback,
61 void g_at_ppp_set_disconnect_function(GAtPPP *ppp, GAtPPPDisconnectFunc func,
63 void g_at_ppp_set_suspend_function(GAtPPP *ppp, GAtSuspendFunc func,
65 void g_at_ppp_set_debug(GAtPPP *ppp, GAtDebugFunc func, gpointer user_data);
66 void g_at_ppp_shutdown(GAtPPP *ppp);
67 void g_at_ppp_suspend(GAtPPP *ppp);
68 void g_at_ppp_resume(GAtPPP *ppp);
69 void g_at_ppp_ref(GAtPPP *ppp);
70 void g_at_ppp_unref(GAtPPP *ppp);
72 gboolean g_at_ppp_set_credentials(GAtPPP *ppp, const char *username,
74 const char *g_at_ppp_get_username(GAtPPP *ppp);
75 const char *g_at_ppp_get_password(GAtPPP *ppp);
77 void g_at_ppp_set_recording(GAtPPP *ppp, const char *filename);
79 void g_at_ppp_set_server_info(GAtPPP *ppp, const char *remote_ip,
80 const char *dns1, const char *dns2);
82 void g_at_ppp_set_acfc_enabled(GAtPPP *ppp, gboolean enabled);
83 void g_at_ppp_set_pfc_enabled(GAtPPP *ppp, gboolean enabled);
89 #endif /* __G_AT_PPP_H */