mirror of git://git.sysmocom.de/ofono
ppp: Tweak set_server_info API some more
This commit is contained in:
parent
295270b4be
commit
d7c0640412
|
@ -465,21 +465,18 @@ void g_at_ppp_unref(GAtPPP *ppp)
|
||||||
g_free(ppp);
|
g_free(ppp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void g_at_ppp_set_server_info(GAtPPP *ppp,
|
void g_at_ppp_set_server_info(GAtPPP *ppp, const char *remote,
|
||||||
const char *local, const char *remote,
|
|
||||||
const char *dns1, const char *dns2)
|
const char *dns1, const char *dns2)
|
||||||
{
|
{
|
||||||
guint32 l = 0;
|
|
||||||
guint32 r = 0;
|
guint32 r = 0;
|
||||||
guint32 d1 = 0;
|
guint32 d1 = 0;
|
||||||
guint32 d2 = 0;
|
guint32 d2 = 0;
|
||||||
|
|
||||||
inet_pton(AF_INET, local, &l);
|
|
||||||
inet_pton(AF_INET, remote, &r);
|
inet_pton(AF_INET, remote, &r);
|
||||||
inet_pton(AF_INET, dns1, &d1);
|
inet_pton(AF_INET, dns1, &d1);
|
||||||
inet_pton(AF_INET, dns2, &d2);
|
inet_pton(AF_INET, dns2, &d2);
|
||||||
|
|
||||||
ipcp_set_server_info(ppp->ipcp, l, r, d1, d2);
|
ipcp_set_server_info(ppp->ipcp, r, d1, d2);
|
||||||
}
|
}
|
||||||
|
|
||||||
static GAtPPP *ppp_init_common(GAtHDLC *hdlc)
|
static GAtPPP *ppp_init_common(GAtHDLC *hdlc)
|
||||||
|
|
|
@ -69,8 +69,7 @@ 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,
|
void g_at_ppp_set_server_info(GAtPPP *ppp, const char *remote_ip,
|
||||||
const char *local_ip, const char *remote_ip,
|
|
||||||
const char *dns1, const char *dns2);
|
const char *dns1, const char *dns2);
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|
|
@ -86,8 +86,7 @@ void lcp_protocol_reject(struct pppcp_data *lcp, guint8 *packet, gsize len);
|
||||||
/* IPCP related functions */
|
/* IPCP related functions */
|
||||||
struct pppcp_data *ipcp_new(GAtPPP *ppp);
|
struct pppcp_data *ipcp_new(GAtPPP *ppp);
|
||||||
void ipcp_free(struct pppcp_data *data);
|
void ipcp_free(struct pppcp_data *data);
|
||||||
void ipcp_set_server_info(struct pppcp_data *ipcp, guint32 local_addr,
|
void ipcp_set_server_info(struct pppcp_data *ipcp, guint32 peer_addr,
|
||||||
guint32 peer_addr,
|
|
||||||
guint32 dns1, guint32 dns2);
|
guint32 dns1, guint32 dns2);
|
||||||
|
|
||||||
/* CHAP related functions */
|
/* CHAP related functions */
|
||||||
|
|
|
@ -129,20 +129,14 @@ static void ipcp_reset_server_config_options(struct ipcp_data *ipcp)
|
||||||
ipcp_generate_config_options(ipcp);
|
ipcp_generate_config_options(ipcp);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ipcp_set_server_info(struct pppcp_data *pppcp, guint32 local_addr,
|
void ipcp_set_server_info(struct pppcp_data *pppcp, guint32 peer_addr,
|
||||||
guint32 peer_addr,
|
|
||||||
guint32 dns1, guint32 dns2)
|
guint32 dns1, guint32 dns2)
|
||||||
{
|
{
|
||||||
struct ipcp_data *ipcp = pppcp_get_data(pppcp);
|
struct ipcp_data *ipcp = pppcp_get_data(pppcp);
|
||||||
|
|
||||||
ipcp->local_addr = local_addr;
|
|
||||||
ipcp->peer_addr = peer_addr;
|
ipcp->peer_addr = peer_addr;
|
||||||
ipcp->dns1 = dns1;
|
ipcp->dns1 = dns1;
|
||||||
ipcp->dns2 = dns2;
|
ipcp->dns2 = dns2;
|
||||||
ipcp->is_server = TRUE;
|
|
||||||
|
|
||||||
ipcp_reset_server_config_options(ipcp);
|
|
||||||
pppcp_set_local_options(pppcp, ipcp->options, ipcp->options_len);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void ipcp_up(struct pppcp_data *pppcp)
|
static void ipcp_up(struct pppcp_data *pppcp)
|
||||||
|
|
Loading…
Reference in New Issue