summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2010-06-28 17:38:54 -0500
committerDenis Kenzior <denkenz@gmail.com>2010-06-28 17:38:54 -0500
commit90d240820bd9cbb01d0e4e9af5223ff2bc078375 (patch)
treece33a4c4d7358daa85c173fd3cdb3abdef1b5bcc
parentb6601bfeedb3871d423135b1d4e1b9c35ceeef91 (diff)
downloadofono-90d240820bd9cbb01d0e4e9af5223ff2bc078375.tar.bz2
ppp: Tweak the set_server_info API
-rw-r--r--gatchat/gatppp.c17
-rw-r--r--gatchat/gatppp.h5
-rw-r--r--gatchat/test-server.c15
3 files changed, 20 insertions, 17 deletions
diff --git a/gatchat/gatppp.c b/gatchat/gatppp.c
index b65733ee..1f5b581d 100644
--- a/gatchat/gatppp.c
+++ b/gatchat/gatppp.c
@@ -465,10 +465,21 @@ void g_at_ppp_unref(GAtPPP *ppp)
g_free(ppp);
}
-void g_at_ppp_set_server_info(GAtPPP *ppp, guint32 local, guint32 peer,
- guint32 dns1, guint32 dns2)
+void g_at_ppp_set_server_info(GAtPPP *ppp,
+ const char *local, const char *remote,
+ const char *dns1, const char *dns2)
{
- ipcp_set_server_info(ppp->ipcp, local, peer, dns1, dns2);
+ guint32 l = 0;
+ guint32 r = 0;
+ guint32 d1 = 0;
+ guint32 d2 = 0;
+
+ inet_pton(AF_INET, local, &l);
+ inet_pton(AF_INET, remote, &r);
+ inet_pton(AF_INET, dns1, &d1);
+ inet_pton(AF_INET, dns2, &d2);
+
+ ipcp_set_server_info(ppp->ipcp, l, r, d1, d2);
}
static GAtPPP *ppp_init_common(GAtHDLC *hdlc)
diff --git a/gatchat/gatppp.h b/gatchat/gatppp.h
index aea4ec07..3a25380a 100644
--- a/gatchat/gatppp.h
+++ b/gatchat/gatppp.h
@@ -69,8 +69,9 @@ const char *g_at_ppp_get_password(GAtPPP *ppp);
void g_at_ppp_set_recording(GAtPPP *ppp, const char *filename);
-void g_at_ppp_set_server_info(GAtPPP *ppp, guint32 local, guint32 peer,
- guint32 dns1, guint32 dns2);
+void g_at_ppp_set_server_info(GAtPPP *ppp,
+ const char *local_ip, const char *remote_ip,
+ const char *dns1, const char *dns2);
#ifdef __cplusplus
}
diff --git a/gatchat/test-server.c b/gatchat/test-server.c
index 08de689e..71e49863 100644
--- a/gatchat/test-server.c
+++ b/gatchat/test-server.c
@@ -118,18 +118,9 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user)
static gboolean update_ppp(gpointer user)
{
GAtPPP *ppp = user;
- char local_ip[INET_ADDRSTRLEN] = "192.168.1.1";
- char remote_ip[INET_ADDRSTRLEN] = "192.168.1.2";
- char dns1[INET_ADDRSTRLEN] = "10.10.10.10";
- char dns2[INET_ADDRSTRLEN] = "10.10.10.11";
- guint32 l, r, d1, d2;
-
- inet_pton(AF_INET, local_ip, &l);
- inet_pton(AF_INET, remote_ip, &r);
- inet_pton(AF_INET, dns1, &d1);
- inet_pton(AF_INET, dns2, &d2);
-
- g_at_ppp_set_server_info(ppp, l, r, d1, d2);
+
+ g_at_ppp_set_server_info(ppp, "192.168.1.1", "192.168.1.2",
+ "10.10.10.10", "10.10.10.11");
return FALSE;
}