mirror of git://git.sysmocom.de/ofono
ppp: Tweak the set_server_info API
This commit is contained in:
parent
b6601bfeed
commit
90d240820b
|
@ -465,10 +465,21 @@ void g_at_ppp_unref(GAtPPP *ppp)
|
||||||
g_free(ppp);
|
g_free(ppp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void g_at_ppp_set_server_info(GAtPPP *ppp, guint32 local, guint32 peer,
|
void g_at_ppp_set_server_info(GAtPPP *ppp,
|
||||||
guint32 dns1, guint32 dns2)
|
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)
|
static GAtPPP *ppp_init_common(GAtHDLC *hdlc)
|
||||||
|
|
|
@ -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_recording(GAtPPP *ppp, const char *filename);
|
||||||
|
|
||||||
void g_at_ppp_set_server_info(GAtPPP *ppp, guint32 local, guint32 peer,
|
void g_at_ppp_set_server_info(GAtPPP *ppp,
|
||||||
guint32 dns1, guint32 dns2);
|
const char *local_ip, const char *remote_ip,
|
||||||
|
const char *dns1, const char *dns2);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
}
|
}
|
||||||
|
|
|
@ -118,18 +118,9 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user)
|
||||||
static gboolean update_ppp(gpointer user)
|
static gboolean update_ppp(gpointer user)
|
||||||
{
|
{
|
||||||
GAtPPP *ppp = 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);
|
g_at_ppp_set_server_info(ppp, "192.168.1.1", "192.168.1.2",
|
||||||
inet_pton(AF_INET, remote_ip, &r);
|
"10.10.10.10", "10.10.10.11");
|
||||||
inet_pton(AF_INET, dns1, &d1);
|
|
||||||
inet_pton(AF_INET, dns2, &d2);
|
|
||||||
|
|
||||||
g_at_ppp_set_server_info(ppp, l, r, d1, d2);
|
|
||||||
|
|
||||||
return FALSE;
|
return FALSE;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue