summaryrefslogtreecommitdiffstats
path: root/gatchat/gsmdial.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-03-31 18:48:30 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-03-31 18:48:30 -0500
commitee8084c0d02d99cbb0d6835a13b4c1fbb9d1fa0f (patch)
tree6fd8f85252021b507dfd9d6715989ddacf47194c /gatchat/gsmdial.c
parentcc1bb46ffadaf41e3c501cc03eeabb9c1ba5ee08 (diff)
downloadofono-ee8084c0d02d99cbb0d6835a13b4c1fbb9d1fa0f.tar.bz2
Fix: Update gsm dial to the new GAtPPP API
Diffstat (limited to 'gatchat/gsmdial.c')
-rw-r--r--gatchat/gsmdial.c25
1 files changed, 8 insertions, 17 deletions
diff --git a/gatchat/gsmdial.c b/gatchat/gsmdial.c
index fd68c5c8..1050bd6c 100644
--- a/gatchat/gsmdial.c
+++ b/gatchat/gsmdial.c
@@ -219,19 +219,9 @@ out:
return FALSE;
}
-static void print_ip_address(const char *label, guint32 ip_addr)
-{
- struct in_addr addr;
- char buf[INET_ADDRSTRLEN];
-
- addr.s_addr = ip_addr;
-
- if (inet_ntop(AF_INET, &addr, buf, INET_ADDRSTRLEN))
- g_print("%s: %s\n", label, buf);
-}
-
-static void ppp_connect(GAtPPP *ppp, GAtPPPConnectStatus success,
- guint32 ip_addr, guint32 dns1, guint32 dns2,
+static void ppp_connect(GAtPPPConnectStatus success,
+ const char *iface, const char *ip,
+ const char *dns1, const char *dns2,
gpointer user_data)
{
if (success != G_AT_PPP_CONNECT_SUCCESS) {
@@ -240,12 +230,13 @@ static void ppp_connect(GAtPPP *ppp, GAtPPPConnectStatus success,
}
/* print out the negotiated address and dns server */
- print_ip_address("IP Address", ip_addr);
- print_ip_address("Primary DNS Server", dns1);
- print_ip_address("Secondary DNS Server", dns2);
+ g_print("Network Device: %s\n", iface);
+ g_print("IP Address: %s\n", ip);
+ g_print("Primary DNS Server: %s\n", dns1);
+ g_print("Secondary DNS Server: %s\n", dns2);
}
-static void ppp_disconnect(GAtPPP *ppp, gpointer user_data)
+static void ppp_disconnect(gpointer user_data)
{
g_print("PPP Link down\n");
}