summaryrefslogtreecommitdiffstats
path: root/plugins/phonesim.c
diff options
context:
space:
mode:
authorDenis Kenzior <denkenz@gmail.com>2011-03-11 11:15:04 -0600
committerDenis Kenzior <denkenz@gmail.com>2011-03-15 17:14:26 -0500
commit8c601d48fb8ffef7ef4cfa2d835cdaf60a7c6f78 (patch)
tree1e8fc5ff79e54cef911ea1b6f54902cbdd486f39 /plugins/phonesim.c
parent88402f02b2acf764707b46e5fc2207355d4181d8 (diff)
downloadofono-8c601d48fb8ffef7ef4cfa2d835cdaf60a7c6f78.tar.bz2
phonesim: Add support for ipv6 / dual contexts
Diffstat (limited to 'plugins/phonesim.c')
-rw-r--r--plugins/phonesim.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/plugins/phonesim.c b/plugins/phonesim.c
index 4221896b..e515a10a 100644
--- a/plugins/phonesim.c
+++ b/plugins/phonesim.c
@@ -77,6 +77,7 @@ struct phonesim_data {
struct gprs_context_data {
GAtChat *chat;
char *interface;
+ enum ofono_gprs_proto proto;
};
static void at_cgact_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -89,9 +90,22 @@ static void at_cgact_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
decode_at_error(&error, g_at_result_final_response(result));
- if (ok)
- ofono_gprs_context_set_interface(gc, gcd->interface);
+ if (ok == FALSE)
+ goto done;
+
+ ofono_gprs_context_set_interface(gc, gcd->interface);
+
+ if (gcd->proto == OFONO_GPRS_PROTO_IP ||
+ gcd->proto == OFONO_GPRS_PROTO_IPV4V6)
+ ofono_gprs_context_set_ipv4_address(gc, NULL, FALSE);
+ if (gcd->proto == OFONO_GPRS_PROTO_IPV6 ||
+ gcd->proto == OFONO_GPRS_PROTO_IPV4V6) {
+ ofono_gprs_context_set_ipv6_address(gc, "fe80::1");
+ ofono_gprs_context_set_ipv6_prefix_length(gc, 10);
+ }
+
+done:
cb(&error, cbd->data);
}
@@ -115,6 +129,7 @@ static void phonesim_activate_primary(struct ofono_gprs_context *gc,
int len = 0;
cbd->user = gc;
+ gcd->proto = ctx->proto;
switch (ctx->proto) {
case OFONO_GPRS_PROTO_IP: