* [RESEND 3 PATCH 00/13] IPv6 Support
@ 2011-03-07 14:02 Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 01/13] gprs: factor out common code Mika Liljeberg
` (13 more replies)
0 siblings, 14 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1678 bytes --]
Hi All,
Patches rebased to current master.
Regards,
MikaL
"IPv6 host walked into a bar. No-one would talk to it."
[RESEND 3 PATCH 01/13] gprs: factor out common code
[RESEND 3 PATCH 02/13] gprs: Update documentation for IPv6
[RESEND 3 PATCH 03/13] gprs: driver interface changes for IPv6
[RESEND 3 PATCH 04/13] gprs: core support for IPv6
[RESEND 3 PATCH 05/13] test: modify test scripts for IPv6
[RESEND 3 PATCH 06/13] isimodem: IPv6 support
[RESEND 3 PATCH 07/13] atmodem: update to new gprs context interface
[RESEND 3 PATCH 08/13] huaweimodem: update to new gprs context interface
[RESEND 3 PATCH 09/13] mbmmodem: update to new gprs context interface
[RESEND 3 PATCH 10/13] hsomodem: update to new gprs context interface
[RESEND 3 PATCH 11/13] ifxmodem: update to new gprs context interface
[RESEND 3 PATCH 12/13] stemodem: update to new gprs context interface
[RESEND 3 PATCH 13/13] phonesim: add IPv6 support
Makefile.am | 3 +-
doc/connman-api.txt | 9 +-
drivers/atmodem/gprs-context.c | 41 ++--
drivers/hsomodem/gprs-context.c | 48 +++--
drivers/huaweimodem/gprs-context.c | 43 +++--
drivers/ifxmodem/gprs-context.c | 36 ++--
drivers/isimodem/gprs-context.c | 119 +++++++-----
drivers/mbmmodem/gprs-context.c | 65 ++++---
drivers/stemodem/gprs-context.c | 30 ++-
include/gprs-context.h | 27 ++-
plugins/phonesim.c | 32 +++-
src/gprs.c | 390 ++++++++++++++++++++++++------------
test/set-context-property | 38 ++++
13 files changed, 580 insertions(+), 301 deletions(-)
^ permalink raw reply [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 01/13] gprs: factor out common code
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 02/13] gprs: Update documentation for IPv6 Mika Liljeberg
` (12 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4880 bytes --]
---
src/gprs.c | 111 +++++++++++++++++++++++++++---------------------------------
1 files changed, 50 insertions(+), 61 deletions(-)
diff --git a/src/gprs.c b/src/gprs.c
index 33711dc..b478f88 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -256,6 +256,49 @@ static void gprs_cid_release(struct ofono_gprs *gprs, unsigned int id)
idmap_put(gprs->cid_map, id);
}
+static gboolean assign_context(struct pri_context *ctx)
+{
+ struct idmap *cidmap = ctx->gprs->cid_map;
+ unsigned int cid_min;
+ GSList *l;
+
+ if (cidmap == NULL)
+ return FALSE;
+
+ cid_min = idmap_get_min(cidmap);
+
+ ctx->context.cid = gprs_cid_alloc(ctx->gprs);
+ if (ctx->context.cid == 0)
+ return FALSE;
+
+ for (l = ctx->gprs->context_drivers; l; l = l->next) {
+ struct ofono_gprs_context *gc = l->data;
+
+ if (gc->inuse == TRUE)
+ continue;
+
+ if (gc->type == OFONO_GPRS_CONTEXT_TYPE_ANY ||
+ gc->type == ctx->type) {
+ ctx->context_driver = gc;
+ ctx->context_driver->inuse = TRUE;
+ return TRUE;
+ }
+ }
+
+ return FALSE;
+}
+
+static void release_context(struct pri_context *ctx)
+{
+ if (ctx == NULL || ctx->gprs == NULL || ctx->context_driver == NULL)
+ return;
+
+ gprs_cid_release(ctx->gprs, ctx->context.cid);
+ ctx->context.cid = 0;
+ ctx->context_driver->inuse = FALSE;
+ ctx->context_driver = NULL;
+}
+
static struct pri_context *gprs_context_by_path(struct ofono_gprs *gprs,
const char *ctx_path)
{
@@ -704,12 +747,7 @@ static void pri_activate_callback(const struct ofono_error *error,
telephony_error_to_str(error));
__ofono_dbus_pending_reply(&ctx->pending,
__ofono_error_failed(ctx->pending));
-
- gprs_cid_release(ctx->gprs, ctx->context.cid);
- ctx->context.cid = 0;
- ctx->context_driver->inuse = FALSE;
- ctx->context_driver = NULL;
-
+ release_context(ctx);
return;
}
@@ -745,11 +783,8 @@ static void pri_deactivate_callback(const struct ofono_error *error, void *data)
return;
}
- gprs_cid_release(ctx->gprs, ctx->context.cid);
- ctx->context.cid = 0;
+ release_context(ctx);
ctx->active = FALSE;
- ctx->context_driver->inuse = FALSE;
- ctx->context_driver = NULL;
__ofono_dbus_pending_reply(&ctx->pending,
dbus_message_new_method_return(ctx->pending));
@@ -996,38 +1031,6 @@ static DBusMessage *pri_set_message_center(struct pri_context *ctx,
return NULL;
}
-static gboolean assign_context(struct pri_context *ctx)
-{
- struct idmap *cidmap = ctx->gprs->cid_map;
- unsigned int cid_min;
- GSList *l;
-
- if (cidmap == NULL)
- return FALSE;
-
- cid_min = idmap_get_min(cidmap);
-
- ctx->context.cid = gprs_cid_alloc(ctx->gprs);
- if (ctx->context.cid == 0)
- return FALSE;
-
- for (l = ctx->gprs->context_drivers; l; l = l->next) {
- struct ofono_gprs_context *gc = l->data;
-
- if (gc->inuse == TRUE)
- continue;
-
- if (gc->type == OFONO_GPRS_CONTEXT_TYPE_ANY ||
- gc->type == ctx->type) {
- ctx->context_driver = gc;
- ctx->context_driver->inuse = TRUE;
- return TRUE;
- }
- }
-
- return FALSE;
-}
-
static DBusMessage *pri_set_property(DBusConnection *conn,
DBusMessage *msg, void *data)
{
@@ -1345,14 +1348,9 @@ static void gprs_attached_update(struct ofono_gprs *gprs)
if (ctx->active == FALSE)
continue;
- gprs_cid_release(gprs, ctx->context.cid);
- ctx->context.cid = 0;
+ release_context(ctx);
ctx->active = FALSE;
- ctx->context_driver->inuse = FALSE;
- ctx->context_driver = NULL;
-
pri_reset_context_settings(ctx);
-
value = FALSE;
ofono_dbus_signal_property_changed(conn, ctx->path,
OFONO_CONNECTION_CONTEXT_INTERFACE,
@@ -1737,10 +1735,7 @@ static void gprs_deactivate_for_remove(const struct ofono_error *error,
return;
}
- gprs_cid_release(gprs, ctx->context.cid);
- ctx->context.cid = 0;
- ctx->context_driver->inuse = FALSE;
- ctx->context_driver = NULL;
+ release_context(ctx);
if (gprs->settings) {
g_key_file_remove_group(gprs->settings, ctx->key, NULL);
@@ -1832,12 +1827,9 @@ static void gprs_deactivate_for_all(const struct ofono_error *error,
return;
}
- gprs_cid_release(gprs, ctx->context.cid);
- ctx->active = FALSE;
- ctx->context.cid = 0;
- ctx->context_driver->inuse = FALSE;
- ctx->context_driver = NULL;
+ release_context(ctx);
+ ctx->active = FALSE;
pri_reset_context_settings(ctx);
value = ctx->active;
@@ -2088,11 +2080,8 @@ void ofono_gprs_context_deactivated(struct ofono_gprs_context *gc,
if (ctx->active == FALSE)
break;
- gprs_cid_release(ctx->gprs, ctx->context.cid);
- ctx->context.cid = 0;
+ release_context(ctx);
ctx->active = FALSE;
- ctx->context_driver->inuse = FALSE;
- ctx->context_driver = NULL;
pri_reset_context_settings(ctx);
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 02/13] gprs: Update documentation for IPv6
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 01/13] gprs: factor out common code Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 03/13] gprs: driver interface changes " Mika Liljeberg
` (11 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1130 bytes --]
---
doc/connman-api.txt | 9 +++++++--
1 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/doc/connman-api.txt b/doc/connman-api.txt
index ece5bd3..5a987d3 100644
--- a/doc/connman-api.txt
+++ b/doc/connman-api.txt
@@ -195,7 +195,7 @@ Properties boolean Active [readwrite]
string Protocol [readwrite]
Holds the protocol for this context. Valid values
- are: "ip" and "ipv6".
+ are: "ip", "ipv6" and "ipv4v6".
string Name [readwrite]
@@ -209,7 +209,7 @@ Properties boolean Active [readwrite]
string Interface [readonly, optional]
- Holds the interface of the network interface
+ Holds the name of the network interface
used by this context (e.g. "ppp0" "usb0")
string Method [readonly, optional]
@@ -255,6 +255,11 @@ Properties boolean Active [readwrite]
via this proxy. All other values are left
out in this case.
+ string IPv6Address [readonly, optional]
+
+ Holds the IPv6 link local address for this
+ context.
+
string MessageProxy [readwrite, MMS only]
Holds the MMS Proxy setting.
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 03/13] gprs: driver interface changes for IPv6
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 01/13] gprs: factor out common code Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 02/13] gprs: Update documentation for IPv6 Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 04/13] gprs: core support " Mika Liljeberg
` (10 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2629 bytes --]
---
include/gprs-context.h | 27 ++++++++++++++++++++++-----
1 files changed, 22 insertions(+), 5 deletions(-)
diff --git a/include/gprs-context.h b/include/gprs-context.h
index c29c0dc..f2d6df4 100644
--- a/include/gprs-context.h
+++ b/include/gprs-context.h
@@ -37,6 +37,7 @@ struct ofono_gprs_context;
enum ofono_gprs_proto {
OFONO_GPRS_PROTO_IP = 0,
OFONO_GPRS_PROTO_IPV6,
+ OFONO_GPRS_PROTO_IPV4V6,
};
enum ofono_gprs_context_type {
@@ -47,6 +48,12 @@ enum ofono_gprs_context_type {
OFONO_GPRS_CONTEXT_TYPE_IMS,
};
+enum ofono_gprs_addrconf {
+ OFONO_GPRS_ADDRCONF_NONE,
+ OFONO_GPRS_ADDRCONF_STATIC,
+ OFONO_GPRS_ADDRCONF_DHCP,
+};
+
struct ofono_gprs_primary_context {
unsigned int cid;
int direction;
@@ -58,10 +65,6 @@ struct ofono_gprs_primary_context {
typedef void (*ofono_gprs_context_cb_t)(const struct ofono_error *error,
void *data);
-typedef void (*ofono_gprs_context_up_cb_t)(const struct ofono_error *error,
- const char *interface, ofono_bool_t static_ip,
- const char *address, const char *netmask,
- const char *gw, const char **dns, void *data);
struct ofono_gprs_context_driver {
const char *name;
@@ -70,7 +73,7 @@ struct ofono_gprs_context_driver {
void (*remove)(struct ofono_gprs_context *gc);
void (*activate_primary)(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data);
+ ofono_gprs_context_cb_t cb, void *data);
void (*deactivate_primary)(struct ofono_gprs_context *gc,
unsigned int id,
ofono_gprs_context_cb_t cb, void *data);
@@ -94,6 +97,20 @@ struct ofono_modem *ofono_gprs_context_get_modem(struct ofono_gprs_context *gc);
void ofono_gprs_context_set_type(struct ofono_gprs_context *gc,
enum ofono_gprs_context_type type);
+void ofono_gprs_context_set_interface(struct ofono_gprs_context *gc,
+ const char *interface);
+void ofono_gprs_context_set_ip_addrconf(struct ofono_gprs_context *gc,
+ enum ofono_gprs_addrconf method);
+void ofono_gprs_context_set_ip_address(struct ofono_gprs_context *gc,
+ const char *address);
+void ofono_gprs_context_set_ip_netmask(struct ofono_gprs_context *gc,
+ const char *netmask);
+void ofono_gprs_context_set_ip_gateway(struct ofono_gprs_context *gc,
+ const char *netmask);
+void ofono_gprs_context_set_ipv6_address(struct ofono_gprs_context *gc,
+ const char *address);
+void ofono_gprs_context_set_dns_servers(struct ofono_gprs_context *gc,
+ const char **dns);
#ifdef __cplusplus
}
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 04/13] gprs: core support for IPv6
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (2 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 03/13] gprs: driver interface changes " Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 05/13] test: modify test scripts " Mika Liljeberg
` (9 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 13664 bytes --]
---
src/gprs.c | 285 +++++++++++++++++++++++++++++++++++++++++++++---------------
1 files changed, 213 insertions(+), 72 deletions(-)
diff --git a/src/gprs.c b/src/gprs.c
index b478f88..e19c5ca 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -34,6 +34,8 @@
#include <net/route.h>
#include <netinet/in.h>
#include <arpa/inet.h>
+#include <linux/netlink.h>
+#include <linux/rtnetlink.h>
#include <glib.h>
#include <gdbus.h>
@@ -100,10 +102,12 @@ struct ofono_gprs {
struct ofono_sim_context *sim_context;
};
+struct pri_context;
+
struct ofono_gprs_context {
struct ofono_gprs *gprs;
+ struct pri_context *pri;
enum ofono_gprs_context_type type;
- ofono_bool_t inuse;
const struct ofono_gprs_context_driver *driver;
void *driver_data;
struct ofono_atom *atom;
@@ -112,10 +116,11 @@ struct ofono_gprs_context {
struct context_settings {
enum ofono_gprs_context_type type;
char *interface;
- gboolean static_ip;
+ enum ofono_gprs_addrconf method;
char *ip;
char *netmask;
char *gateway;
+ char *ipv6;
char **dns;
char *proxy;
};
@@ -227,6 +232,8 @@ static const char *gprs_proto_to_string(enum ofono_gprs_proto proto)
return "ip";
case OFONO_GPRS_PROTO_IPV6:
return "ipv6";
+ case OFONO_GPRS_PROTO_IPV4V6:
+ return "ipv4v6";
};
return NULL;
@@ -241,11 +248,28 @@ static gboolean gprs_proto_from_string(const char *str,
} else if (g_str_equal(str, "ipv6")) {
*proto = OFONO_GPRS_PROTO_IPV6;
return TRUE;
+ } else if (g_str_equal(str, "ipv4v6")) {
+ *proto = OFONO_GPRS_PROTO_IPV4V6;
+ return TRUE;
}
return FALSE;
}
+static const char *gprs_addrconf_to_string(enum ofono_gprs_addrconf method)
+{
+ switch (method) {
+ case OFONO_GPRS_ADDRCONF_NONE:
+ return NULL;
+ case OFONO_GPRS_ADDRCONF_STATIC:
+ return "static";
+ case OFONO_GPRS_ADDRCONF_DHCP:
+ return "dhcp";
+ }
+
+ return NULL;
+}
+
static unsigned int gprs_cid_alloc(struct ofono_gprs *gprs)
{
return idmap_alloc(gprs->cid_map);
@@ -274,13 +298,13 @@ static gboolean assign_context(struct pri_context *ctx)
for (l = ctx->gprs->context_drivers; l; l = l->next) {
struct ofono_gprs_context *gc = l->data;
- if (gc->inuse == TRUE)
+ if (gc->pri != NULL)
continue;
if (gc->type == OFONO_GPRS_CONTEXT_TYPE_ANY ||
gc->type == ctx->type) {
ctx->context_driver = gc;
- ctx->context_driver->inuse = TRUE;
+ gc->pri = ctx;
return TRUE;
}
}
@@ -295,7 +319,7 @@ static void release_context(struct pri_context *ctx)
gprs_cid_release(ctx->gprs, ctx->context.cid);
ctx->context.cid = 0;
- ctx->context_driver->inuse = FALSE;
+ ctx->context_driver->pri = NULL;
ctx->context_driver = NULL;
}
@@ -314,14 +338,22 @@ static struct pri_context *gprs_context_by_path(struct ofono_gprs *gprs,
return NULL;
}
-static void context_settings_free(struct context_settings *settings)
+static void pri_context_settings_free(struct pri_context *ctx)
{
+ struct context_settings *settings = ctx->settings;
+
+ if (settings == NULL)
+ return;
+
+ ctx->settings = NULL;
+
g_free(settings->interface);
g_free(settings->ip);
g_free(settings->netmask);
g_free(settings->gateway);
g_strfreev(settings->dns);
g_free(settings->proxy);
+ g_free(settings->ipv6);
g_free(settings);
}
@@ -360,12 +392,10 @@ static void context_settings_append_variant(struct context_settings *settings,
goto done;
}
- if (settings->static_ip == TRUE)
- method = "static";
- else
- method = "dhcp";
-
- ofono_dbus_dict_append(&array, "Method", DBUS_TYPE_STRING, &method);
+ method = gprs_addrconf_to_string(settings->method);
+ if (method != NULL)
+ ofono_dbus_dict_append(&array, "Method", DBUS_TYPE_STRING,
+ &method);
if (settings->ip)
ofono_dbus_dict_append(&array, "Address", DBUS_TYPE_STRING,
@@ -379,6 +409,10 @@ static void context_settings_append_variant(struct context_settings *settings,
ofono_dbus_dict_append(&array, "Gateway", DBUS_TYPE_STRING,
&settings->gateway);
+ if (settings->ipv6 != NULL)
+ ofono_dbus_dict_append(&array, "IPv6Address", DBUS_TYPE_STRING,
+ &settings->ipv6);
+
if (settings->dns)
ofono_dbus_dict_append_array(&array, "DomainNameServers",
DBUS_TYPE_STRING,
@@ -556,6 +590,65 @@ done:
close(sk);
}
+static void pri_setipv6(const char *interface, const char *address,
+ ofono_bool_t up)
+{
+ struct ifreq ifr;
+ struct nlmsghdr *nlh;
+ struct ifaddrmsg *ifa;
+ struct rtattr *rta;
+ struct sockaddr_nl sa = {.nl_family = AF_NETLINK };
+ int sk;
+ char buf[256];
+
+ if (interface == NULL)
+ return;
+
+ sk = socket(PF_INET6, SOCK_DGRAM, 0);
+ if (sk < 0)
+ return;
+
+ memset(&ifr, 0, sizeof(ifr));
+ strncpy(ifr.ifr_name, interface, IFNAMSIZ);
+
+ if (ioctl(sk, SIOCGIFINDEX, &ifr) < 0)
+ goto done;
+
+ close(sk);
+
+ sk = socket(AF_NETLINK, SOCK_RAW, NETLINK_ROUTE);
+ if (sk < 0)
+ return;
+
+ nlh = (struct nlmsghdr *)buf;
+
+ nlh->nlmsg_type = up ? RTM_NEWADDR : RTM_DELADDR;
+ nlh->nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL;
+ nlh->nlmsg_pid = getpid();
+ nlh->nlmsg_seq = 0;
+
+ ifa = NLMSG_DATA(nlh);
+
+ ifa->ifa_family = AF_INET6;
+ ifa->ifa_prefixlen = 64;
+ ifa->ifa_flags = IFA_F_PERMANENT | IFA_F_NODAD;
+ ifa->ifa_scope = RT_SCOPE_LINK;
+ ifa->ifa_index = ifr.ifr_ifindex;
+
+ rta = IFA_RTA(ifa);
+
+ rta->rta_type = IFA_ADDRESS;
+ rta->rta_len = RTA_LENGTH(sizeof(struct in6_addr));
+ inet_pton(AF_INET6, address, RTA_DATA(rta));
+
+ nlh->nlmsg_len = NLMSG_LENGTH(sizeof(*ifa) + rta->rta_len);
+
+ sendto(sk, nlh, nlh->nlmsg_len, 0, (struct sockaddr *)&sa, sizeof(sa));
+
+done:
+ close(sk);
+}
+
static void pri_setproxy(const char *interface, const char *proxy)
{
struct rtentry rt;
@@ -596,68 +689,54 @@ static void pri_setproxy(const char *interface, const char *proxy)
static void pri_reset_context_settings(struct pri_context *ctx)
{
- char *interface;
+ struct context_settings *settings = ctx->settings;
- if (ctx->settings == NULL)
+ if (settings == NULL)
return;
- interface = ctx->settings->interface;
- ctx->settings->interface = NULL;
-
- context_settings_free(ctx->settings);
- ctx->settings = NULL;
-
- pri_context_signal_settings(ctx);
-
if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS) {
- pri_setaddr(interface, NULL);
+ pri_setaddr(settings->interface, NULL);
g_free(ctx->proxy_host);
ctx->proxy_host = NULL;
ctx->proxy_port = 0;
}
- pri_ifupdown(interface, FALSE);
+ if (settings->ipv6 != NULL)
+ pri_setipv6(settings->interface, settings->ipv6, FALSE);
- g_free(interface);
+ pri_ifupdown(settings->interface, FALSE);
+
+ pri_context_settings_free(ctx);
+ pri_context_signal_settings(ctx);
}
-static void pri_update_context_settings(struct pri_context *ctx,
- const char *interface,
- ofono_bool_t static_ip,
- const char *ip, const char *netmask,
- const char *gateway, const char **dns)
+static void pri_update_context_settings(struct pri_context *ctx)
{
- if (ctx->settings)
- context_settings_free(ctx->settings);
+ struct context_settings *settings = ctx->settings;
- ctx->settings = g_try_new0(struct context_settings, 1);
- if (ctx->settings == NULL)
+ if (settings == NULL || settings->interface == NULL)
return;
- ctx->settings->type = ctx->type;
-
- ctx->settings->interface = g_strdup(interface);
- ctx->settings->static_ip = static_ip;
- ctx->settings->ip = g_strdup(ip);
- ctx->settings->netmask = g_strdup(netmask);
- ctx->settings->gateway = g_strdup(gateway);
- ctx->settings->dns = g_strdupv((char **)dns);
+ settings->type = ctx->type;
if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS && ctx->message_proxy)
- ctx->settings->proxy = g_strdup(ctx->message_proxy);
+ settings->proxy = g_strdup(ctx->message_proxy);
+
+ if (settings->ipv6 != NULL)
+ pri_setipv6(settings->interface, settings->ipv6, TRUE);
- pri_ifupdown(interface, TRUE);
+ pri_ifupdown(settings->interface, TRUE);
if (ctx->type == OFONO_GPRS_CONTEXT_TYPE_MMS) {
pri_parse_proxy(ctx, ctx->message_proxy);
DBG("proxy %s port %u", ctx->proxy_host, ctx->proxy_port);
- pri_setaddr(interface, ip);
+ pri_setaddr(settings->interface, settings->ip);
if (ctx->proxy_host)
- pri_setproxy(interface, ctx->proxy_host);
+ pri_setproxy(settings->interface, ctx->proxy_host);
}
pri_context_signal_settings(ctx);
@@ -729,25 +808,19 @@ static DBusMessage *pri_get_properties(DBusConnection *conn,
return reply;
}
-static void pri_activate_callback(const struct ofono_error *error,
- const char *interface,
- ofono_bool_t static_ip,
- const char *ip, const char *netmask,
- const char *gateway, const char **dns,
- void *data)
+static void pri_activate_callback(const struct ofono_error *error, void *data)
{
struct pri_context *ctx = data;
DBusConnection *conn = ofono_dbus_get_connection();
dbus_bool_t value;
- DBG("%p %s", ctx, interface);
-
if (error->type != OFONO_ERROR_TYPE_NO_ERROR) {
DBG("Activating context failed with error: %s",
telephony_error_to_str(error));
__ofono_dbus_pending_reply(&ctx->pending,
__ofono_error_failed(ctx->pending));
release_context(ctx);
+ pri_context_settings_free(ctx);
return;
}
@@ -755,14 +828,7 @@ static void pri_activate_callback(const struct ofono_error *error,
__ofono_dbus_pending_reply(&ctx->pending,
dbus_message_new_method_return(ctx->pending));
- /*
- * If we don't have the interface, don't bother emitting any settings,
- * as nobody can make use of them
- */
- if (interface != NULL)
- pri_update_context_settings(ctx, interface, static_ip,
- ip, netmask, gateway, dns);
-
+ pri_update_context_settings(ctx);
value = ctx->active;
ofono_dbus_signal_property_changed(conn, ctx->path,
OFONO_CONNECTION_CONTEXT_INTERFACE,
@@ -1079,15 +1145,22 @@ static DBusMessage *pri_set_property(DBusConnection *conn,
return __ofono_error_attach_in_progress(msg);
if (value) {
- if (assign_context(ctx) == FALSE)
- return __ofono_error_not_implemented(msg);
+ pri_context_settings_free(ctx);
+ ctx->settings = g_try_new0(struct context_settings, 1);
+ if (ctx->settings == NULL)
+ return __ofono_error_failed(msg);
+
+ assign_context(ctx);
}
gc = ctx->context_driver;
if (gc == NULL || gc->driver == NULL ||
gc->driver->activate_primary == NULL ||
- gc->driver->deactivate_primary == NULL)
+ gc->driver->deactivate_primary == NULL) {
+ release_context(ctx);
+ pri_context_settings_free(ctx);
return __ofono_error_not_implemented(msg);
+ }
ctx->pending = dbus_message_ref(msg);
@@ -1211,15 +1284,9 @@ static void pri_context_destroy(gpointer userdata)
{
struct pri_context *ctx = userdata;
- if (ctx->settings) {
- context_settings_free(ctx->settings);
- ctx->settings = NULL;
- }
-
+ pri_context_settings_free(ctx);
g_free(ctx->proxy_host);
-
g_free(ctx->path);
-
g_free(ctx);
}
@@ -2120,6 +2187,8 @@ static void gprs_context_remove(struct ofono_atom *atom)
if (gc == NULL)
return;
+ release_context(gc->pri);
+
if (gc->driver && gc->driver->remove)
gc->driver->remove(gc);
@@ -2192,6 +2261,78 @@ void ofono_gprs_context_set_type(struct ofono_gprs_context *gc,
gc->type = type;
}
+void ofono_gprs_context_set_interface(struct ofono_gprs_context *gc,
+ const char *interface)
+{
+ struct context_settings *settings = gc->pri->settings;
+
+ g_free(settings->interface);
+ settings->interface = g_strdup(interface);
+}
+
+void ofono_gprs_context_set_ip_addrconf(struct ofono_gprs_context *gc,
+ enum ofono_gprs_addrconf method)
+{
+ struct context_settings *settings = gc->pri->settings;
+
+ settings->method = method;
+}
+
+void ofono_gprs_context_set_ip_address(struct ofono_gprs_context *gc,
+ const char *address)
+{
+ struct context_settings *settings = gc->pri->settings;
+
+ g_free(settings->ip);
+ settings->ip = g_strdup(address);
+}
+
+void ofono_gprs_context_set_ip_netmask(struct ofono_gprs_context *gc,
+ const char *netmask)
+{
+ struct context_settings *settings = gc->pri->settings;
+
+ g_free(settings->netmask);
+ settings->netmask = g_strdup(netmask);
+}
+
+void ofono_gprs_context_set_ip_gateway(struct ofono_gprs_context *gc,
+ const char *gateway)
+{
+ struct context_settings *settings = gc->pri->settings;
+
+ g_free(settings->gateway);
+ settings->gateway = g_strdup(gateway);
+}
+
+void ofono_gprs_context_set_ipv6_address(struct ofono_gprs_context *gc,
+ const char *address)
+{
+ struct context_settings *settings = gc->pri->settings;
+ uint8_t *addr = alloca(sizeof(struct in6_addr));
+ char *straddr = alloca(INET6_ADDRSTRLEN);
+
+ if (!inet_pton(AF_INET6, address, addr))
+ return;
+
+ memset(addr, 0, 8);
+ addr[0] = 0xfe;
+ addr[1] = 0x80;
+ inet_ntop(AF_INET6, addr, straddr, INET6_ADDRSTRLEN);
+
+ g_free(settings->ipv6);
+ settings->ipv6 = g_strdup(straddr);
+}
+
+void ofono_gprs_context_set_dns_servers(struct ofono_gprs_context *gc,
+ const char **dns)
+{
+ struct context_settings *settings = gc->pri->settings;
+
+ g_strfreev(settings->dns);
+ settings->dns = g_strdupv((char **)dns);
+}
+
int ofono_gprs_driver_register(const struct ofono_gprs_driver *d)
{
DBG("driver: %p, name: %s", d, d->name);
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 05/13] test: modify test scripts for IPv6
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (3 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 04/13] gprs: core support " Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 06/13] isimodem: IPv6 support Mika Liljeberg
` (8 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 1755 bytes --]
---
Makefile.am | 3 ++-
test/set-context-property | 38 ++++++++++++++++++++++++++++++++++++++
2 files changed, 40 insertions(+), 1 deletions(-)
create mode 100755 test/set-context-property
diff --git a/Makefile.am b/Makefile.am
index 3f20717..dc6ae39 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -501,7 +501,8 @@ test_scripts = test/backtrace \
test/cdma-hangup \
test/disable-call-forwarding \
test/list-messages \
- test/test-sms
+ test/test-sms \
+ test/set-context-property
if TEST
testdir = $(pkglibdir)/test
diff --git a/test/set-context-property b/test/set-context-property
new file mode 100755
index 0000000..8ea0e3a
--- /dev/null
+++ b/test/set-context-property
@@ -0,0 +1,38 @@
+#!/usr/bin/python
+
+import sys
+import dbus
+
+if len(sys.argv) < 4:
+ print "Usage: set-context-property <context> <name> <value>"
+ sys.exit(1)
+
+bus = dbus.SystemBus()
+
+manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+ 'org.ofono.Manager')
+
+modems = manager.GetModems()
+
+for path, properties in modems:
+ if "org.ofono.ConnectionManager" not in properties["Interfaces"]:
+ continue
+
+ connman = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.ConnectionManager')
+
+ contexts = connman.GetContexts()
+
+ if (len(contexts) == 0):
+ print "No context available"
+ sys.exit(1)
+
+ path = contexts[int(sys.argv[1])][0]
+ context = dbus.Interface(bus.get_object('org.ofono', path),
+ 'org.ofono.ConnectionContext')
+
+ try:
+ context.SetProperty(sys.argv[2], sys.argv[3])
+ except dbus.DBusException, e:
+ print "Error setting context %s property %s: %s" % (path, sys.argv[2], str(e))
+ exit(2)
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 06/13] isimodem: IPv6 support
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (4 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 05/13] test: modify test scripts " Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 07/13] atmodem: update to new gprs context interface Mika Liljeberg
` (7 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 7169 bytes --]
---
drivers/isimodem/gprs-context.c | 119 ++++++++++++++++++++++++---------------
1 files changed, 73 insertions(+), 46 deletions(-)
diff --git a/drivers/isimodem/gprs-context.c b/drivers/isimodem/gprs-context.c
index ad7abad..c386fef 100644
--- a/drivers/isimodem/gprs-context.c
+++ b/drivers/isimodem/gprs-context.c
@@ -62,10 +62,7 @@ struct context_data {
uint16_t gpds; /* GPDS object handle */
unsigned cid; /* oFono core context ID */
struct ofono_gprs_context *context;
- union {
- ofono_gprs_context_up_cb_t up_cb;
- ofono_gprs_context_cb_t down_cb;
- };
+ ofono_gprs_context_cb_t cb;
void *data;
GIsiPEP *pep;
@@ -112,15 +109,14 @@ typedef void (*ContextFailFunc)(struct context_data *cd);
static void gprs_up_fail(struct context_data *cd)
{
- CALLBACK_WITH_FAILURE(cd->up_cb, NULL, 0, NULL, NULL, NULL, NULL,
- cd->data);
reset_context(cd);
+ CALLBACK_WITH_FAILURE(cd->cb, cd->data);
}
static void gprs_down_fail(struct context_data *cd)
{
- CALLBACK_WITH_FAILURE(cd->down_cb, cd->data);
reset_context(cd);
+ CALLBACK_WITH_FAILURE(cd->cb, cd->data);
}
static gboolean check_resp(const GIsiMessage *msg, uint8_t id, size_t minlen,
@@ -206,12 +202,12 @@ static void activate_ind_cb(const GIsiMessage *msg, void *opaque)
{
struct context_data *cd = opaque;
GIsiSubBlockIter iter;
+ const char *dns[5];
+ int dns_count = 0;
char ifname[IF_NAMESIZE];
- char *ip = NULL;
- char *pdns = NULL;
- char *sdns = NULL;
- const char *dns[3];
+ char *ip_addr = NULL;
+ char *ipv6_addr = NULL;
if (!check_ind(msg, 2, cd))
return;
@@ -225,8 +221,6 @@ static void activate_ind_cb(const GIsiMessage *msg, void *opaque)
switch (g_isi_sb_iter_get_id(&iter)) {
- /* TODO: IPv6 address support */
-
case GPDS_PDP_ADDRESS_INFO:
if (!g_isi_sb_iter_get_byte(&iter, &addr_len, 3))
@@ -236,9 +230,15 @@ static void activate_ind_cb(const GIsiMessage *msg, void *opaque)
4))
goto error;
- ip = alloca(INET_ADDRSTRLEN);
- inet_ntop(AF_INET, (const void *)addr_value, ip,
- INET_ADDRSTRLEN);
+ if (addr_len == 4) {
+ ip_addr = alloca(INET_ADDRSTRLEN);
+ inet_ntop(AF_INET, (const void *)addr_value,
+ ip_addr, INET_ADDRSTRLEN);
+ } else if (addr_len == 16) {
+ ipv6_addr = alloca(INET6_ADDRSTRLEN);
+ inet_ntop(AF_INET6, (const void *)addr_value,
+ ipv6_addr, INET6_ADDRSTRLEN);
+ }
break;
case GPDS_PDNS_ADDRESS_INFO:
@@ -250,9 +250,17 @@ static void activate_ind_cb(const GIsiMessage *msg, void *opaque)
4))
break;
- pdns = alloca(INET_ADDRSTRLEN);
- inet_ntop(AF_INET, (const void *)addr_value, pdns,
- INET_ADDRSTRLEN);
+ if (addr_len == 4) {
+ char *addr = alloca(INET_ADDRSTRLEN);
+ inet_ntop(AF_INET, (const void *)addr_value,
+ addr, INET_ADDRSTRLEN);
+ dns[dns_count++] = addr;
+ } else if (addr_len == 16) {
+ char *addr = alloca(INET6_ADDRSTRLEN);
+ inet_ntop(AF_INET6, (const void *)addr_value,
+ addr, INET6_ADDRSTRLEN);
+ dns[dns_count++] = addr;
+ }
break;
case GPDS_SDNS_ADDRESS_INFO:
@@ -264,9 +272,17 @@ static void activate_ind_cb(const GIsiMessage *msg, void *opaque)
4))
break;
- sdns = alloca(INET_ADDRSTRLEN);
- inet_ntop(AF_INET, (const void *)addr_value, sdns,
- INET_ADDRSTRLEN);
+ if (addr_len == 4) {
+ char *addr = alloca(INET_ADDRSTRLEN);
+ inet_ntop(AF_INET, (const void *)addr_value,
+ addr, INET_ADDRSTRLEN);
+ dns[dns_count++] = addr;
+ } else if (addr_len == 16) {
+ char *addr = alloca(INET6_ADDRSTRLEN);
+ inet_ntop(AF_INET6, (const void *)addr_value,
+ addr, INET6_ADDRSTRLEN);
+ dns[dns_count++] = addr;
+ }
break;
default:
@@ -279,26 +295,26 @@ static void activate_ind_cb(const GIsiMessage *msg, void *opaque)
if (!g_isi_pep_get_ifname(cd->pep, ifname))
goto error;
- dns[0] = pdns;
- dns[1] = sdns;
- dns[2] = 0;
+ ofono_gprs_context_set_interface(cd->context, ifname);
- CALLBACK_WITH_SUCCESS(cd->up_cb, ifname, TRUE, (const char *)ip,
- STATIC_IP_NETMASK, NULL,
- dns, cd->data);
- return;
+ if (ip_addr != NULL) {
+ ofono_gprs_context_set_ip_addrconf(cd->context,
+ OFONO_GPRS_ADDRCONF_STATIC);
+ ofono_gprs_context_set_ip_address(cd->context, ip_addr);
+ ofono_gprs_context_set_ip_netmask(cd->context,
+ STATIC_IP_NETMASK);
+ }
-error:
- gprs_up_fail(cd);
-}
+ if (ipv6_addr != NULL)
+ ofono_gprs_context_set_ipv6_address(cd->context, ipv6_addr);
-static void activate_fail_ind_cb(const GIsiMessage *msg, void *opaque)
-{
- struct context_data *cd = opaque;
+ dns[dns_count] = 0;
+ ofono_gprs_context_set_dns_servers(cd->context, dns);
- if (!check_ind(msg, 2, cd))
- return;
+ CALLBACK_WITH_SUCCESS(cd->cb, cd->data);
+ return;
+error:
gprs_up_fail(cd);
}
@@ -319,8 +335,6 @@ static void send_context_activate(GIsiClient *client, void *opaque)
g_isi_client_ind_subscribe(client, GPDS_CONTEXT_ACTIVATE_IND,
activate_ind_cb, cd);
- g_isi_client_ind_subscribe(client, GPDS_CONTEXT_ACTIVATE_FAIL_IND,
- activate_fail_ind_cb, cd);
g_isi_client_ind_subscribe(client, GPDS_CONTEXT_DEACTIVATE_IND,
deactivate_ind_cb, cd);
@@ -478,7 +492,7 @@ static void create_pipe_cb(GIsiPipe *pipe)
static void isi_gprs_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data)
+ ofono_gprs_context_cb_t cb, void *data)
{
struct context_data *cd = ofono_gprs_context_get_data(gc);
@@ -486,8 +500,7 @@ static void isi_gprs_activate_primary(struct ofono_gprs_context *gc,
if (cd == NULL || !cd->gpds) {
/* GPDS is not reachable */
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL,
- NULL, data);
+ CALLBACK_WITH_FAILURE(cb, data);
return;
}
@@ -498,12 +511,26 @@ static void isi_gprs_activate_primary(struct ofono_gprs_context *gc,
}
cd->cid = ctx->cid;
- cd->up_cb = cb;
+ cd->cb = cb;
cd->data = data;
cd->pep = NULL;
cd->pipe = NULL;
cd->handle = INVALID_ID;
- cd->type = GPDS_PDP_TYPE_IPV4;
+
+ switch (ctx->proto) {
+ case OFONO_GPRS_PROTO_IP:
+ cd->type = GPDS_PDP_TYPE_IPV4;
+ break;
+
+ case OFONO_GPRS_PROTO_IPV6:
+ cd->type = GPDS_PDP_TYPE_IPV6;
+ break;
+
+ case OFONO_GPRS_PROTO_IPV4V6:
+ /* Not supported by modem */
+ CALLBACK_WITH_FAILURE(cb, data);
+ return;
+ }
if (strlen(ctx->apn) >= GPDS_MAX_APN_STRING_LENGTH
|| strlen(ctx->username) >= GPDS_MAX_USERNAME_LENGTH
@@ -545,7 +572,7 @@ static void context_deactivate_cb(const GIsiMessage *msg, void *opaque)
gprs_down_fail))
return;
- CALLBACK_WITH_SUCCESS(cd->down_cb, cd->data);
+ CALLBACK_WITH_SUCCESS(cd->cb, cd->data);
reset_context(cd);
}
@@ -563,7 +590,7 @@ static void isi_gprs_deactivate_primary(struct ofono_gprs_context *gc,
if (cd == NULL)
return;
- cd->down_cb = cb;
+ cd->cb = cb;
cd->data = data;
msg[1] = cd->handle;
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 07/13] atmodem: update to new gprs context interface
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (5 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 06/13] isimodem: IPv6 support Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 08/13] huaweimodem: " Mika Liljeberg
` (6 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4200 bytes --]
---
drivers/atmodem/gprs-context.c | 41 ++++++++++++++++++++-------------------
1 files changed, 21 insertions(+), 20 deletions(-)
diff --git a/drivers/atmodem/gprs-context.c b/drivers/atmodem/gprs-context.c
index 56d65d4..2c4797b 100644
--- a/drivers/atmodem/gprs-context.c
+++ b/drivers/atmodem/gprs-context.c
@@ -62,10 +62,7 @@ struct gprs_context_data {
char password[OFONO_GPRS_MAX_PASSWORD_LENGTH + 1];
GAtPPP *ppp;
enum state state;
- union {
- ofono_gprs_context_cb_t down_cb; /* Down callback */
- ofono_gprs_context_up_cb_t up_cb; /* Up callback */
- };
+ ofono_gprs_context_cb_t cb;
void *cb_data; /* Callback data */
};
@@ -93,9 +90,12 @@ static void ppp_connect(const char *interface, const char *local,
ofono_info("DNS: %s, %s", dns1, dns2);
gcd->state = STATE_ACTIVE;
- CALLBACK_WITH_SUCCESS(gcd->up_cb, interface, TRUE, local,
- STATIC_IP_NETMASK, NULL,
- dns, gcd->cb_data);
+ ofono_gprs_context_set_interface(gc, interface);
+ ofono_gprs_context_set_ip_addrconf(gc, OFONO_GPRS_ADDRCONF_STATIC);
+ ofono_gprs_context_set_ip_address(gc, local);
+ ofono_gprs_context_set_ip_netmask(gc, STATIC_IP_NETMASK);
+ ofono_gprs_context_set_dns_servers(gc, dns);
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
}
static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
@@ -110,11 +110,10 @@ static void ppp_disconnect(GAtPPPDisconnectReason reason, gpointer user_data)
switch (gcd->state) {
case STATE_ENABLING:
- CALLBACK_WITH_FAILURE(gcd->up_cb, NULL, FALSE, NULL,
- NULL, NULL, NULL, gcd->cb_data);
+ CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
break;
case STATE_DISABLING:
- CALLBACK_WITH_SUCCESS(gcd->down_cb, gcd->cb_data);
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
break;
default:
ofono_gprs_context_deactivated(gc, gcd->active_context);
@@ -181,8 +180,7 @@ static void at_cgdata_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->state = STATE_IDLE;
decode_at_error(&error, g_at_result_final_response(result));
- gcd->up_cb(&error, NULL, 0, NULL, NULL, NULL, NULL,
- gcd->cb_data);
+ gcd->cb(&error, gcd->cb_data);
return;
}
@@ -204,8 +202,7 @@ static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->state = STATE_IDLE;
decode_at_error(&error, g_at_result_final_response(result));
- gcd->up_cb(&error, NULL, 0, NULL, NULL, NULL, NULL,
- gcd->cb_data);
+ gcd->cb(&error, gcd->cb_data);
return;
}
@@ -217,22 +214,25 @@ static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
gcd->state = STATE_IDLE;
- CALLBACK_WITH_FAILURE(gcd->up_cb, NULL, 0, NULL, NULL, NULL, NULL,
- gcd->cb_data);
+ CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
}
static void at_gprs_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data)
+ ofono_gprs_context_cb_t cb, void *data)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
char buf[OFONO_GPRS_MAX_APN_LENGTH + 128];
int len;
+ /* IPv6 support not implemented */
+ if (ctx->proto != OFONO_GPRS_PROTO_IP)
+ goto error;
+
DBG("cid %u", ctx->cid);
gcd->active_context = ctx->cid;
- gcd->up_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = data;
memcpy(gcd->username, ctx->username, sizeof(ctx->username));
memcpy(gcd->password, ctx->password, sizeof(ctx->password));
@@ -249,7 +249,8 @@ static void at_gprs_activate_primary(struct ofono_gprs_context *gc,
at_cgdcont_cb, gc, NULL) > 0)
return;
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, data);
+error:
+ CALLBACK_WITH_FAILURE(cb, data);
}
static void at_gprs_deactivate_primary(struct ofono_gprs_context *gc,
@@ -261,7 +262,7 @@ static void at_gprs_deactivate_primary(struct ofono_gprs_context *gc,
DBG("cid %u", cid);
gcd->state = STATE_DISABLING;
- gcd->down_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = data;
g_at_ppp_shutdown(gcd->ppp);
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 08/13] huaweimodem: update to new gprs context interface
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (6 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 07/13] atmodem: update to new gprs context interface Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 09/13] mbmmodem: " Mika Liljeberg
` (5 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4622 bytes --]
---
drivers/huaweimodem/gprs-context.c | 43 +++++++++++++++++++++---------------
1 files changed, 25 insertions(+), 18 deletions(-)
diff --git a/drivers/huaweimodem/gprs-context.c b/drivers/huaweimodem/gprs-context.c
index bbc9c96..67d933e 100644
--- a/drivers/huaweimodem/gprs-context.c
+++ b/drivers/huaweimodem/gprs-context.c
@@ -53,10 +53,7 @@ struct gprs_context_data {
unsigned int dhcp_source;
unsigned int dhcp_count;
guint ndis_watch;
- union {
- ofono_gprs_context_cb_t down_cb; /* Down callback */
- ofono_gprs_context_up_cb_t up_cb; /* Up callback */
- };
+ ofono_gprs_context_cb_t cb;
void *cb_data; /* Callback data */
};
@@ -68,8 +65,7 @@ static gboolean dhcp_poll(gpointer user_data)
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
if (gcd->dhcp_count > 20)
- CALLBACK_WITH_FAILURE(gcd->up_cb, NULL, 0, NULL, NULL,
- NULL, NULL, gcd->cb_data);
+ CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
else
check_dhcp(gc);
@@ -192,9 +188,15 @@ static void dhcp_query_cb(gboolean ok, GAtResult *result, gpointer user_data)
interface = "invalid";
- CALLBACK_WITH_SUCCESS(gcd->up_cb, interface, TRUE, ip,
- netmask, gateway, dns, gcd->cb_data);
- gcd->up_cb = NULL;
+ ofono_gprs_context_set_interface(gc, interface);
+ ofono_gprs_context_set_ip_addrconf(gc, OFONO_GPRS_ADDRCONF_STATIC);
+ ofono_gprs_context_set_ip_address(gc, ip);
+ ofono_gprs_context_set_ip_netmask(gc, netmask);
+ ofono_gprs_context_set_ip_gateway(gc, gateway);
+ ofono_gprs_context_set_dns_servers(gc, dns);
+
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
+ gcd->cb = NULL;
gcd->cb_data = NULL;
g_free(ip);
@@ -224,7 +226,7 @@ static void at_ndisdup_down_cb(gboolean ok, GAtResult *result,
DBG("ok %d", ok);
if (ok) {
- gcd->down_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = cbd->data;
if (gcd->ndis_watch > 0) {
@@ -241,7 +243,7 @@ static void at_ndisdup_up_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct ofono_error error;
@@ -249,7 +251,7 @@ static void at_ndisdup_up_cb(gboolean ok, GAtResult *result,
DBG("ok %d", ok);
if (ok) {
- gcd->up_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = cbd->data;
gcd->dhcp_count = 0;
@@ -261,13 +263,13 @@ static void at_ndisdup_up_cb(gboolean ok, GAtResult *result,
gcd->active_context = 0;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, NULL, FALSE, NULL, NULL, NULL, NULL, cbd->data);
+ cb(&error, cbd->data);
}
static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *ncbd;
@@ -281,7 +283,7 @@ static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ cb(&error, cbd->data);
return;
}
@@ -297,18 +299,22 @@ static void at_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
}
static void huawei_gprs_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data)
+ ofono_gprs_context_cb_t cb, void *data)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[64];
int len;
+ /* IPv6 support not implemented */
+ if (ctx->proto != OFONO_GPRS_PROTO_IP)
+ goto error;
+
DBG("cid %u", ctx->cid);
gcd->active_context = ctx->cid;
@@ -325,9 +331,10 @@ static void huawei_gprs_activate_primary(struct ofono_gprs_context *gc,
at_cgdcont_cb, cbd, g_free) > 0)
return;
+error:
g_free(cbd);
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, data);
+ CALLBACK_WITH_FAILURE(cb, data);
}
static void huawei_gprs_deactivate_primary(struct ofono_gprs_context *gc,
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 09/13] mbmmodem: update to new gprs context interface
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (7 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 08/13] huaweimodem: " Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 10/13] hsomodem: " Mika Liljeberg
` (4 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5953 bytes --]
---
drivers/mbmmodem/gprs-context.c | 65 ++++++++++++++++++++++++---------------
1 files changed, 40 insertions(+), 25 deletions(-)
diff --git a/drivers/mbmmodem/gprs-context.c b/drivers/mbmmodem/gprs-context.c
index 322f96d..972b35e 100644
--- a/drivers/mbmmodem/gprs-context.c
+++ b/drivers/mbmmodem/gprs-context.c
@@ -70,10 +70,7 @@ struct gprs_context_data {
gboolean have_e2ipcfg;
unsigned int enap_source;
enum mbm_state mbm_state;
- union {
- ofono_gprs_context_cb_t down_cb; /* Down callback */
- ofono_gprs_context_up_cb_t up_cb; /* Up callback */
- };
+ ofono_gprs_context_cb_t cb;
void *cb_data; /* Callback data */
int enap; /* State of the call */
};
@@ -141,11 +138,23 @@ out:
ofono_info("IP: %s Gateway: %s", ip, gateway);
ofono_info("DNS: %s, %s", dns[0], dns[1]);
- CALLBACK_WITH_SUCCESS(gcd->up_cb, interface, success, ip,
- STATIC_IP_NETMASK, gateway,
- success ? dns : NULL, gcd->cb_data);
+ ofono_gprs_context_set_interface(gc, interface);
+
+ if (success) {
+ ofono_gprs_context_set_ip_addrconf(gc,
+ OFONO_GPRS_ADDRCONF_STATIC);
+ ofono_gprs_context_set_ip_address(gc, ip);
+ ofono_gprs_context_set_ip_netmask(gc, STATIC_IP_NETMASK);
+ ofono_gprs_context_set_dns_servers(gc, dns);
+ } else {
+ ofono_gprs_context_set_ip_addrconf(gc,
+ OFONO_GPRS_ADDRCONF_DHCP);
+ }
+
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
+
gcd->mbm_state = MBM_NONE;
- gcd->up_cb = NULL;
+ gcd->cb = NULL;
gcd->cb_data = NULL;
}
@@ -169,11 +178,14 @@ static void mbm_get_ip_details(struct ofono_gprs_context *gc)
modem = ofono_gprs_context_get_modem(gc);
interface = ofono_modem_get_string(modem, "NetworkInterface");
- CALLBACK_WITH_SUCCESS(gcd->up_cb, interface, FALSE, NULL, NULL,
- NULL, NULL, gcd->cb_data);
+
+ ofono_gprs_context_set_interface(gc, interface);
+ ofono_gprs_context_set_ip_addrconf(gc, OFONO_GPRS_ADDRCONF_DHCP);
+
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
gcd->mbm_state = MBM_NONE;
- gcd->up_cb = NULL;
+ gcd->cb = NULL;
gcd->cb_data = NULL;
}
@@ -191,12 +203,11 @@ static void mbm_state_changed(struct ofono_gprs_context *gc, int state)
DBG("disconnected");
if (gcd->mbm_state == MBM_DISABLING) {
- CALLBACK_WITH_SUCCESS(gcd->down_cb, gcd->cb_data);
- gcd->down_cb = NULL;
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
+ gcd->cb = NULL;
} else if (gcd->mbm_state == MBM_ENABLING) {
- CALLBACK_WITH_FAILURE(gcd->up_cb, NULL, 0, NULL, NULL,
- NULL, NULL, gcd->cb_data);
- gcd->up_cb = NULL;
+ CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
+ gcd->cb = NULL;
} else {
ofono_gprs_context_deactivated(gc, gcd->active_context);
}
@@ -275,7 +286,7 @@ static void at_enap_down_cb(gboolean ok, GAtResult *result, gpointer user_data)
/* Now we have to wait for the unsolicited notification to arrive */
if (ok && gcd->enap != 0) {
gcd->mbm_state = MBM_DISABLING;
- gcd->down_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = cbd->data;
if (gcd->have_e2nap == FALSE)
@@ -292,7 +303,7 @@ static void at_enap_down_cb(gboolean ok, GAtResult *result, gpointer user_data)
static void mbm_enap_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct ofono_error error;
@@ -301,7 +312,7 @@ static void mbm_enap_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
if (ok) {
gcd->mbm_state = MBM_ENABLING;
- gcd->up_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = cbd->data;
if (gcd->have_e2nap == FALSE)
@@ -314,13 +325,13 @@ static void mbm_enap_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, NULL, FALSE, NULL, NULL, NULL, NULL, cbd->data);
+ cb(&error, cbd->data);
}
static void mbm_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *ncbd;
@@ -334,7 +345,7 @@ static void mbm_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ cb(&error, cbd->data);
return;
}
@@ -350,18 +361,22 @@ static void mbm_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
}
static void mbm_gprs_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data)
+ ofono_gprs_context_cb_t cb, void *data)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[AUTH_BUF_LENGTH];
int len;
+ /* IPv6 support not implemented */
+ if (ctx->proto != OFONO_GPRS_PROTO_IP)
+ goto error;
+
DBG("cid %u", ctx->cid);
gcd->active_context = ctx->cid;
@@ -393,7 +408,7 @@ static void mbm_gprs_activate_primary(struct ofono_gprs_context *gc,
error:
g_free(cbd);
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, data);
+ CALLBACK_WITH_FAILURE(cb, data);
}
static void mbm_gprs_deactivate_primary(struct ofono_gprs_context *gc,
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 10/13] hsomodem: update to new gprs context interface
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (8 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 09/13] mbmmodem: " Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 11/13] ifxmodem: " Mika Liljeberg
` (3 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5305 bytes --]
---
drivers/hsomodem/gprs-context.c | 48 ++++++++++++++++++++++-----------------
1 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/drivers/hsomodem/gprs-context.c b/drivers/hsomodem/gprs-context.c
index c132846..f9f1696 100644
--- a/drivers/hsomodem/gprs-context.c
+++ b/drivers/hsomodem/gprs-context.c
@@ -62,10 +62,7 @@ struct gprs_context_data {
GAtChat *chat;
unsigned int active_context; /* Currently active */
enum hso_state hso_state; /* Are we in req ? */
- union {
- ofono_gprs_context_cb_t down_cb; /* Down callback */
- ofono_gprs_context_up_cb_t up_cb; /* Up callback */
- };
+ ofono_gprs_context_cb_t cb;
void *cb_data; /* Callback data */
int owancall; /* State of the call */
};
@@ -82,7 +79,7 @@ static void at_owancall_down_cb(gboolean ok, GAtResult *result,
/* Now we have to wait for the unsolicited notification to arrive */
if (ok && gcd->owancall != 0) {
gcd->hso_state = HSO_DISABLING;
- gcd->down_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = cbd->data;
return;
}
@@ -95,14 +92,14 @@ static void at_owancall_up_cb(gboolean ok, GAtResult *result,
gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct ofono_error error;
if (ok) {
gcd->hso_state = HSO_ENABLING;
- gcd->up_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = cbd->data;
return;
}
@@ -110,13 +107,13 @@ static void at_owancall_up_cb(gboolean ok, GAtResult *result,
gcd->active_context = 0;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, NULL, FALSE, NULL, NULL, NULL, NULL, cbd->data);
+ cb(&error, cbd->data);
}
static void hso_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *ncbd;
@@ -128,7 +125,7 @@ static void hso_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ cb(&error, cbd->data);
return;
}
@@ -144,18 +141,22 @@ static void hso_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
}
static void hso_gprs_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data)
+ ofono_gprs_context_cb_t cb, void *data)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[AUTH_BUF_LENGTH];
int len;
+ /* IPv6 support not implemented */
+ if (ctx->proto != OFONO_GPRS_PROTO_IP)
+ goto error;
+
gcd->active_context = ctx->cid;
cbd->user = gc;
@@ -186,7 +187,7 @@ static void hso_gprs_activate_primary(struct ofono_gprs_context *gc,
error:
g_free(cbd);
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, data);
+ CALLBACK_WITH_FAILURE(cb, data);
}
static void hso_gprs_deactivate_primary(struct ofono_gprs_context *gc,
@@ -265,11 +266,17 @@ static void owandata_cb(gboolean ok, GAtResult *result, gpointer user_data)
ofono_info("IP: %s, Gateway: %s", ip, gateway);
ofono_info("DNS: %s, %s", dns1, dns2);
- CALLBACK_WITH_SUCCESS(gcd->up_cb, interface, TRUE, ip,
- STATIC_IP_NETMASK, gateway, dns, gcd->cb_data);
+ ofono_gprs_context_set_interface(gc, interface);
+ ofono_gprs_context_set_ip_addrconf(gc, OFONO_GPRS_ADDRCONF_STATIC);
+ ofono_gprs_context_set_ip_address(gc, ip);
+ ofono_gprs_context_set_ip_netmask(gc, STATIC_IP_NETMASK);
+ ofono_gprs_context_set_ip_gateway(gc, gateway);
+ ofono_gprs_context_set_dns_servers(gc, dns);
+
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
gcd->hso_state = HSO_NONE;
- gcd->up_cb = NULL;
+ gcd->cb = NULL;
gcd->cb_data = NULL;
}
@@ -300,9 +307,9 @@ static void owancall_notifier(GAtResult *result, gpointer user_data)
DBG("HSO Context: disconnected");
if (gcd->hso_state == HSO_DISABLING) {
- CALLBACK_WITH_SUCCESS(gcd->down_cb, gcd->cb_data);
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
gcd->hso_state = HSO_NONE;
- gcd->down_cb = NULL;
+ gcd->cb = NULL;
gcd->cb_data = NULL;
} else {
ofono_gprs_context_deactivated(gc, gcd->active_context);
@@ -330,10 +337,9 @@ static void owancall_notifier(GAtResult *result, gpointer user_data)
DBG("HSO Context: failed");
if (gcd->hso_state == HSO_ENABLING) {
- CALLBACK_WITH_FAILURE(gcd->up_cb, NULL, 0, NULL,
- NULL, NULL, NULL, gcd->cb_data);
+ CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
gcd->hso_state = HSO_NONE;
- gcd->up_cb = NULL;
+ gcd->cb = NULL;
gcd->cb_data = NULL;
}
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 11/13] ifxmodem: update to new gprs context interface
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (9 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 10/13] hsomodem: " Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 12/13] stemodem: " Mika Liljeberg
` (2 subsequent siblings)
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3585 bytes --]
---
drivers/ifxmodem/gprs-context.c | 36 +++++++++++++++++++++---------------
1 files changed, 21 insertions(+), 15 deletions(-)
diff --git a/drivers/ifxmodem/gprs-context.c b/drivers/ifxmodem/gprs-context.c
index 2c68b44..91dee8c 100644
--- a/drivers/ifxmodem/gprs-context.c
+++ b/drivers/ifxmodem/gprs-context.c
@@ -67,10 +67,7 @@ struct gprs_context_data {
char address[32];
char dns1[32];
char dns2[32];
- union {
- ofono_gprs_context_cb_t down_cb; /* Down callback */
- ofono_gprs_context_up_cb_t up_cb; /* Up callback */
- };
+ ofono_gprs_context_cb_t cb;
void *cb_data; /* Callback data */
};
@@ -123,13 +120,12 @@ static void failed_setup(struct ofono_gprs_context *gc,
gcd->state = STATE_IDLE;
if (result == NULL) {
- CALLBACK_WITH_FAILURE(gcd->up_cb, NULL, 0, NULL, NULL,
- NULL, NULL, gcd->cb_data);
+ CALLBACK_WITH_FAILURE(gcd->cb, gcd->cb_data);
return;
}
decode_at_error(&error, g_at_result_final_response(result));
- gcd->up_cb(&error, NULL, 0, NULL, NULL, NULL, NULL, gcd->cb_data);
+ gcd->cb(&error, gcd->cb_data);
}
static void session_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -157,10 +153,15 @@ static void session_cb(gboolean ok, GAtResult *result, gpointer user_data)
if (interface == NULL)
interface = "invalid";
- CALLBACK_WITH_SUCCESS(gcd->up_cb, interface, TRUE, gcd->address,
- STATIC_IP_NETMASK, NULL, dns, gcd->cb_data);
+ ofono_gprs_context_set_interface(gc, interface);
+ ofono_gprs_context_set_ip_addrconf(gc, OFONO_GPRS_ADDRCONF_STATIC);
+ ofono_gprs_context_set_ip_address(gc, gcd->address);
+ ofono_gprs_context_set_ip_netmask(gc, STATIC_IP_NETMASK);
+ ofono_gprs_context_set_dns_servers(gc, dns);
- gcd->up_cb = NULL;
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
+
+ gcd->cb = NULL;
gcd->cb_data = NULL;
}
@@ -316,16 +317,20 @@ error:
static void ifx_gprs_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data)
+ ofono_gprs_context_cb_t cb, void *data)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
char buf[OFONO_GPRS_MAX_APN_LENGTH + 128];
int len;
+ /* IPv6 support not implemented */
+ if (ctx->proto != OFONO_GPRS_PROTO_IP)
+ goto error;
+
DBG("cid %u", ctx->cid);
gcd->active_context = ctx->cid;
- gcd->up_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = data;
memcpy(gcd->username, ctx->username, sizeof(ctx->username));
memcpy(gcd->password, ctx->password, sizeof(ctx->password));
@@ -342,7 +347,8 @@ static void ifx_gprs_activate_primary(struct ofono_gprs_context *gc,
setup_cb, gc, NULL) > 0)
return;
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, data);
+error:
+ CALLBACK_WITH_FAILURE(cb, data);
}
static void deactivate_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -360,7 +366,7 @@ static void deactivate_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_at_chat_resume(gcd->chat);
- CALLBACK_WITH_SUCCESS(gcd->down_cb, gcd->cb_data);
+ CALLBACK_WITH_SUCCESS(gcd->cb, gcd->cb_data);
}
static void ifx_gprs_deactivate_primary(struct ofono_gprs_context *gc,
@@ -374,7 +380,7 @@ static void ifx_gprs_deactivate_primary(struct ofono_gprs_context *gc,
DBG("cid %u", cid);
gcd->state = STATE_DISABLING;
- gcd->down_cb = cb;
+ gcd->cb = cb;
gcd->cb_data = data;
g_at_rawip_shutdown(gcd->rawip);
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 12/13] stemodem: update to new gprs context interface
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (10 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 11/13] ifxmodem: " Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 13/13] phonesim: add IPv6 support Mika Liljeberg
2011-03-15 22:18 ` [RESEND 3 PATCH 00/13] IPv6 Support Denis Kenzior
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3643 bytes --]
---
drivers/stemodem/gprs-context.c | 30 +++++++++++++++++++-----------
1 files changed, 19 insertions(+), 11 deletions(-)
diff --git a/drivers/stemodem/gprs-context.c b/drivers/stemodem/gprs-context.c
index 48ae476..98abeec 100644
--- a/drivers/stemodem/gprs-context.c
+++ b/drivers/stemodem/gprs-context.c
@@ -176,7 +176,7 @@ static void ste_eppsd_down_cb(gboolean ok, GAtResult *result,
static void ste_eppsd_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
GAtResultIter iter;
@@ -192,7 +192,7 @@ static void ste_eppsd_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ cb(&error, cbd->data);
return;
}
@@ -221,9 +221,13 @@ static void ste_eppsd_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
dns[1] = rsp.dns_server2;
dns[2] = NULL;
- CALLBACK_WITH_SUCCESS(cb, gcd->interface, TRUE, rsp.ip_address,
- rsp.subnet_mask, NULL,
- dns, cbd->data);
+ ofono_gprs_context_set_interface(gc, gcd->interface);
+ ofono_gprs_context_set_ip_addrconf(gc, OFONO_GPRS_ADDRCONF_STATIC);
+ ofono_gprs_context_set_ip_address(gc, rsp.ip_address);
+ ofono_gprs_context_set_ip_netmask(gc, rsp.subnet_mask);
+ ofono_gprs_context_set_dns_servers(gc, dns);
+
+ CALLBACK_WITH_SUCCESS(cb, cbd->data);
return;
error:
@@ -233,13 +237,13 @@ error:
g_markup_parse_context_free(context);
gcd->active_context = 0;
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
}
static void ste_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *ncbd;
@@ -250,7 +254,7 @@ static void ste_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
gcd->active_context = 0;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ cb(&error, cbd->data);
return;
}
@@ -265,18 +269,22 @@ static void ste_cgdcont_cb(gboolean ok, GAtResult *result, gpointer user_data)
g_free(ncbd);
gcd->active_context = 0;
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, cbd->data);
+ CALLBACK_WITH_FAILURE(cb, cbd->data);
}
static void ste_gprs_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data)
+ ofono_gprs_context_cb_t cb, void *data)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[AUTH_BUF_LENGTH];
int len;
+ /* IPv6 support not implemented */
+ if (ctx->proto != OFONO_GPRS_PROTO_IP)
+ goto error;
+
gcd->active_context = ctx->cid;
cbd->user = gc;
@@ -311,7 +319,7 @@ error:
gcd->active_context = 0;
g_free(cbd);
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, data);
+ CALLBACK_WITH_FAILURE(cb, data);
}
static void ste_gprs_deactivate_primary(struct ofono_gprs_context *gc,
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* [RESEND 3 PATCH 13/13] phonesim: add IPv6 support
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (11 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 12/13] stemodem: " Mika Liljeberg
@ 2011-03-07 14:02 ` Mika Liljeberg
2011-03-15 22:18 ` [RESEND 3 PATCH 00/13] IPv6 Support Denis Kenzior
13 siblings, 0 replies; 25+ messages in thread
From: Mika Liljeberg @ 2011-03-07 14:02 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2414 bytes --]
---
plugins/phonesim.c | 32 +++++++++++++++++++++++++-------
1 files changed, 25 insertions(+), 7 deletions(-)
diff --git a/plugins/phonesim.c b/plugins/phonesim.c
index 2b36fe0..2634d23 100644
--- a/plugins/phonesim.c
+++ b/plugins/phonesim.c
@@ -83,14 +83,17 @@ struct gprs_context_data {
static void at_cgact_up_cb(gboolean ok, GAtResult *result, gpointer user_data)
{
struct cb_data *cbd = user_data;
- ofono_gprs_context_up_cb_t cb = cbd->cb;
+ ofono_gprs_context_cb_t cb = cbd->cb;
struct ofono_gprs_context *gc = cbd->user;
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct ofono_error error;
decode_at_error(&error, g_at_result_final_response(result));
- cb(&error, ok ? gcd->interface : NULL, FALSE,
- NULL, NULL, NULL, NULL, cbd->data);
+
+ if (ok)
+ ofono_gprs_context_set_interface(gc, gcd->interface);
+
+ cb(&error, cbd->data);
}
static void at_cgact_down_cb(gboolean ok, GAtResult *result, gpointer user_data)
@@ -105,16 +108,31 @@ static void at_cgact_down_cb(gboolean ok, GAtResult *result, gpointer user_data)
static void phonesim_activate_primary(struct ofono_gprs_context *gc,
const struct ofono_gprs_primary_context *ctx,
- ofono_gprs_context_up_cb_t cb, void *data)
+ ofono_gprs_context_cb_t cb, void *data)
{
struct gprs_context_data *gcd = ofono_gprs_context_get_data(gc);
struct cb_data *cbd = cb_data_new(cb, data);
char buf[OFONO_GPRS_MAX_APN_LENGTH + 128];
- int len;
+ int len = 0;
cbd->user = gc;
- len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"", ctx->cid);
+ switch (ctx->proto) {
+ case OFONO_GPRS_PROTO_IP:
+ len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IP\"",
+ ctx->cid);
+ break;
+
+ case OFONO_GPRS_PROTO_IPV6:
+ len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IPV6\"",
+ ctx->cid);
+ break;
+
+ case OFONO_GPRS_PROTO_IPV4V6:
+ len = snprintf(buf, sizeof(buf), "AT+CGDCONT=%u,\"IPV4V6\"",
+ ctx->cid);
+ break;
+ }
if (ctx->apn)
snprintf(buf + len, sizeof(buf) - len - 3, ",\"%s\"",
@@ -132,7 +150,7 @@ static void phonesim_activate_primary(struct ofono_gprs_context *gc,
error:
g_free(cbd);
- CALLBACK_WITH_FAILURE(cb, NULL, 0, NULL, NULL, NULL, NULL, data);
+ CALLBACK_WITH_FAILURE(cb, data);
}
static void phonesim_deactivate_primary(struct ofono_gprs_context *gc,
--
1.7.1
^ permalink raw reply related [flat|nested] 25+ messages in thread
* Re: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
` (12 preceding siblings ...)
2011-03-07 14:02 ` [RESEND 3 PATCH 13/13] phonesim: add IPv6 support Mika Liljeberg
@ 2011-03-15 22:18 ` Denis Kenzior
2011-03-16 10:45 ` Mika.Liljeberg
13 siblings, 1 reply; 25+ messages in thread
From: Denis Kenzior @ 2011-03-15 22:18 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 2331 bytes --]
Hi Mika,
On 03/07/2011 08:02 AM, Mika Liljeberg wrote:
> Hi All,
>
> Patches rebased to current master.
>
> Regards,
>
> MikaL
>
> "IPv6 host walked into a bar. No-one would talk to it."
>
> [RESEND 3 PATCH 01/13] gprs: factor out common code
> [RESEND 3 PATCH 02/13] gprs: Update documentation for IPv6
> [RESEND 3 PATCH 03/13] gprs: driver interface changes for IPv6
> [RESEND 3 PATCH 04/13] gprs: core support for IPv6
> [RESEND 3 PATCH 05/13] test: modify test scripts for IPv6
> [RESEND 3 PATCH 06/13] isimodem: IPv6 support
> [RESEND 3 PATCH 07/13] atmodem: update to new gprs context interface
> [RESEND 3 PATCH 08/13] huaweimodem: update to new gprs context interface
> [RESEND 3 PATCH 09/13] mbmmodem: update to new gprs context interface
> [RESEND 3 PATCH 10/13] hsomodem: update to new gprs context interface
> [RESEND 3 PATCH 11/13] ifxmodem: update to new gprs context interface
> [RESEND 3 PATCH 12/13] stemodem: update to new gprs context interface
> [RESEND 3 PATCH 13/13] phonesim: add IPv6 support
>
> Makefile.am | 3 +-
> doc/connman-api.txt | 9 +-
> drivers/atmodem/gprs-context.c | 41 ++--
> drivers/hsomodem/gprs-context.c | 48 +++--
> drivers/huaweimodem/gprs-context.c | 43 +++--
> drivers/ifxmodem/gprs-context.c | 36 ++--
> drivers/isimodem/gprs-context.c | 119 +++++++-----
> drivers/mbmmodem/gprs-context.c | 65 ++++---
> drivers/stemodem/gprs-context.c | 30 ++-
> include/gprs-context.h | 27 ++-
> plugins/phonesim.c | 32 +++-
> src/gprs.c | 390 ++++++++++++++++++++++++------------
> test/set-context-property | 38 ++++
> 13 files changed, 580 insertions(+), 301 deletions(-)
So during OSTS Samuel, Marcel and I sat down and tried to figure out the
IPv6 stuff. Based on this discussion and your implementation I pushed a
series of patches implementing IPv6 and dual-stack contexts. I have
taken (and later re-worked) some of your patches so you get credit here
as well.
These are highly experimental and have not received much testing (since
I don't really have any facilities to do so). So please look and let me
know if something isn't working as intended.
Regards,
-Denis
^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-15 22:18 ` [RESEND 3 PATCH 00/13] IPv6 Support Denis Kenzior
@ 2011-03-16 10:45 ` Mika.Liljeberg
2011-03-16 15:41 ` Marcel Holtmann
2011-03-16 15:54 ` Denis Kenzior
0 siblings, 2 replies; 25+ messages in thread
From: Mika.Liljeberg @ 2011-03-16 10:45 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5078 bytes --]
Hi Denis,
> So during OSTS Samuel, Marcel and I sat down and tried to
> figure out the
> IPv6 stuff. Based on this discussion and your implementation
> I pushed a
> series of patches implementing IPv6 and dual-stack contexts. I have
> taken (and later re-worked) some of your patches so you get
> credit here
> as well.
Thanks for pushing the patches. I notice that these are based on my initial set of patches rather than the later ones. A few comments, since I had some reasons for the changes I did in later patches.
I notice that your version of the patches are not forming the IPv6 link-local address and configuring it on the network interface. That's ok, as long as connman takes care of it, but it does mean that Ethernet interfaces, which always have a link-local address, will autoconfigure immediately while point-to-point interfaces will only autoconfigure when connman sets the link-local address on them. We talked about this with Marcel and at the time concluded that it would make more sense to keep things consistent by having oFono configure the link-local address on the point-to-point interfaces. I had this implemented in my later patch sets.
A few comments on the driver API:
void ofono_gprs_context_set_ipv4_address(struct ofono_gprs_context *gc,
const char *address,
gboolean static_ip);
What's the expected behaviour if this is called with a valid IP address and static_ip = FALSE? I think you could just drop the boolean flag and assume a statically configured address if this method is called by the driver, otherwise do DHCP.
void ofono_gprs_context_set_ipv4_dns_servers(struct ofono_gprs_context *gc,
const char **dns);
void ofono_gprs_context_set_ipv6_dns_servers(struct ofono_gprs_context *gc,
const char **dns);
I would propose to have just a single method for setting all DNS servers.
Having separate lists for IPv4 and IPv6 DNS servers made sense in my first patch set, because a dual context could be emulated with separate IPv4 and IPv6 contexts and those DNS servers might have been behind different network interfaces. However, now this just creates additional complexity for the drivers. A dual context will get a list of DNS server addresses, which may contain IPv4 addresses, IPv6 addresses or both. Now the driver has to sort them into two separate lists for IPv4 and IPv6. Note that you can make A and AAAA queries to any server, so there is no particular reason to separate the lists based on address family.
void ofono_gprs_context_set_ipv6_prefix_length(struct ofono_gprs_context *gc,
unsigned char length);
void ofono_gprs_context_set_ipv6_gateway(struct ofono_gprs_context *gc,
const char *gateway);
I'm not sure these are really needed, which is why I dropped these from subsequent patches. This information is not received from the cellular network as part of context activation signalling. On-link prefixes, routes and default gateways are received as part of the standard IPv6 stateless address autoconfiguration when the interfaces is brought up. The only reason to have these would if a specific modem with a virtual ethernet interface deviates from the standard address configuration practises for some reasons.
Current USB modem sticks don't seem to have IPv6 support, so I'd propose to just drop these and add an API later if it turns out to be necessary. If USB sticks do this propertly, they'll just proxy router advertisements and neighbor discovery messages over the virtual ethernet interface and any additional address configuration settings won't be needed.
If you decide to keep these, prefix length should probably default to 64 and be always shown in the settings.
> These are highly experimental and have not received much
> testing (since
> I don't really have any facilities to do so). So please look
> and let me
> know if something isn't working as intended.
I'm not able to test dual context but IPv6 seems to work with isimodem. I did notice that the context settings allocated in assign_context() are leaked if context activation fails. Easy enough to fix, though:
iff --git a/src/gprs.c b/src/gprs.c
index 00f6d6d..068aaf3 100644
--- a/src/gprs.c
+++ b/src/gprs.c
@@ -322,11 +322,13 @@ static gboolean assign_context(struct pri_context *ctx)
return FALSE;
}
+static void context_settings_free(struct context_settings *settings);
static void release_context(struct pri_context *ctx)
{
if (ctx == NULL || ctx->gprs == NULL || ctx->context_driver == NULL)
return;
+ context_settings_free(ctx->context_driver->settings);
gprs_cid_release(ctx->gprs, ctx->context.cid);
ctx->context.cid = 0;
ctx->context_driver->inuse = FALSE;
Regards,
MikaL
^ permalink raw reply related [flat|nested] 25+ messages in thread
* RE: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-16 10:45 ` Mika.Liljeberg
@ 2011-03-16 15:41 ` Marcel Holtmann
2011-03-16 15:54 ` Denis Kenzior
1 sibling, 0 replies; 25+ messages in thread
From: Marcel Holtmann @ 2011-03-16 15:41 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 4807 bytes --]
Hi Mika,
> > So during OSTS Samuel, Marcel and I sat down and tried to
> > figure out the
> > IPv6 stuff. Based on this discussion and your implementation
> > I pushed a
> > series of patches implementing IPv6 and dual-stack contexts. I have
> > taken (and later re-worked) some of your patches so you get
> > credit here
> > as well.
>
> Thanks for pushing the patches. I notice that these are based on my initial set of patches rather than the later ones. A few comments, since I had some reasons for the changes I did in later patches.
>
> I notice that your version of the patches are not forming the IPv6 link-local address and configuring it on the network interface. That's ok, as long as connman takes care of it, but it does mean that Ethernet interfaces, which always have a link-local address, will autoconfigure immediately while point-to-point interfaces will only autoconfigure when connman sets the link-local address on them. We talked about this with Marcel and at the time concluded that it would make more sense to keep things consistent by having oFono configure the link-local address on the point-to-point interfaces. I had this implemented in my later patch sets.
our conclusion was actually that we will disable IPv6 auto-configuration
and expect IP address information given to us by the hardware.
> A few comments on the driver API:
>
> void ofono_gprs_context_set_ipv4_address(struct ofono_gprs_context *gc,
> const char *address,
> gboolean static_ip);
We could do that.
> What's the expected behaviour if this is called with a valid IP address and static_ip = FALSE? I think you could just drop the boolean flag and assume a statically configured address if this method is called by the driver, otherwise do DHCP.
>
> void ofono_gprs_context_set_ipv4_dns_servers(struct ofono_gprs_context *gc,
> const char **dns);
>
> void ofono_gprs_context_set_ipv6_dns_servers(struct ofono_gprs_context *gc,
> const char **dns);
>
> I would propose to have just a single method for setting all DNS servers.
>
> Having separate lists for IPv4 and IPv6 DNS servers made sense in my first patch set, because a dual context could be emulated with separate IPv4 and IPv6 contexts and those DNS servers might have been behind different network interfaces. However, now this just creates additional complexity for the drivers. A dual context will get a list of DNS server addresses, which may contain IPv4 addresses, IPv6 addresses or both. Now the driver has to sort them into two separate lists for IPv4 and IPv6. Note that you can make A and AAAA queries to any server, so there is no particular reason to separate the lists based on address family.
Right now I like to keep them separated for a bit more consistent API,
but yes essentially it makes no difference what the DNS servers are for
since they can be clearly differentiated by its address type.
> void ofono_gprs_context_set_ipv6_prefix_length(struct ofono_gprs_context *gc,
> unsigned char length);
> void ofono_gprs_context_set_ipv6_gateway(struct ofono_gprs_context *gc,
> const char *gateway);
>
> I'm not sure these are really needed, which is why I dropped these from subsequent patches. This information is not received from the cellular network as part of context activation signalling. On-link prefixes, routes and default gateways are received as part of the standard IPv6 stateless address autoconfiguration when the interfaces is brought up. The only reason to have these would if a specific modem with a virtual ethernet interface deviates from the standard address configuration practises for some reasons.
Looking at AT command based modems, then these are needed. I don't see
any auto-configuration with these. The prefix length and gateway
information come from the modem.
> Current USB modem sticks don't seem to have IPv6 support, so I'd propose to just drop these and add an API later if it turns out to be necessary. If USB sticks do this propertly, they'll just proxy router advertisements and neighbor discovery messages over the virtual ethernet interface and any additional address configuration settings won't be needed.
>
> If you decide to keep these, prefix length should probably default to 64 and be always shown in the settings.
The AT commands are pretty clear in that they give us actually a
netmask.
Our success rate with testing IPv6 on a real network with current
hardware was rather limited.
Regards
Marcel
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-16 10:45 ` Mika.Liljeberg
2011-03-16 15:41 ` Marcel Holtmann
@ 2011-03-16 15:54 ` Denis Kenzior
2011-03-17 8:58 ` Mika.Liljeberg
1 sibling, 1 reply; 25+ messages in thread
From: Denis Kenzior @ 2011-03-16 15:54 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5870 bytes --]
Hi Mika,
On 03/16/2011 05:45 AM, Mika.Liljeberg(a)nokia.com wrote:
> Hi Denis,
>
>> So during OSTS Samuel, Marcel and I sat down and tried to
>> figure out the
>> IPv6 stuff. Based on this discussion and your implementation
>> I pushed a
>> series of patches implementing IPv6 and dual-stack contexts. I have
>> taken (and later re-worked) some of your patches so you get
>> credit here
>> as well.
>
> Thanks for pushing the patches. I notice that these are based on my initial set of patches rather than the later ones. A few comments, since I had some reasons for the changes I did in later patches.
>
> I notice that your version of the patches are not forming the IPv6 link-local address and configuring it on the network interface. That's ok, as long as connman takes care of it, but it does mean that Ethernet interfaces, which always have a link-local address, will autoconfigure immediately while point-to-point interfaces will only autoconfigure when connman sets the link-local address on them. We talked about this with Marcel and at the time concluded that it would make more sense to keep things consistent by having oFono configure the link-local address on the point-to-point interfaces. I had this implemented in my later patch sets.
Samuel felt strongly that this should be done by ConnMan. There's still
some questions left around this area. Namely whether we should prevent
auto-configuration or not, etc.
>
> A few comments on the driver API:
>
> void ofono_gprs_context_set_ipv4_address(struct ofono_gprs_context *gc,
> const char *address,
> gboolean static_ip);
>
> What's the expected behaviour if this is called with a valid IP address and static_ip = FALSE? I think you could just drop the boolean flag and assume a statically configured address if this method is called by the driver, otherwise do DHCP.
Then this is a bug in the driver. Dropping the boolean flag is
certainly doable and is probably a good idea.
>
> void ofono_gprs_context_set_ipv4_dns_servers(struct ofono_gprs_context *gc,
> const char **dns);
>
> void ofono_gprs_context_set_ipv6_dns_servers(struct ofono_gprs_context *gc,
> const char **dns);
>
> I would propose to have just a single method for setting all DNS servers.
>
> Having separate lists for IPv4 and IPv6 DNS servers made sense in my first patch set, because a dual context could be emulated with separate IPv4 and IPv6 contexts and those DNS servers might have been behind different network interfaces. However, now this just creates additional complexity for the drivers. A dual context will get a list of DNS server addresses, which may contain IPv4 addresses, IPv6 addresses or both. Now the driver has to sort them into two separate lists for IPv4 and IPv6. Note that you can make A and AAAA queries to any server, so there is no particular reason to separate the lists based on address family.
>
We waffled on this one, but it seemed better to keep it symmetric with
the way ConnMan API is setup for IPv6. For AT modems that support
dual-stack, the IPv4 and IPv6 information is returned separately anyway,
so for the majority of the drivers separating the details is more efficient.
> void ofono_gprs_context_set_ipv6_prefix_length(struct ofono_gprs_context *gc,
> unsigned char length);
> void ofono_gprs_context_set_ipv6_gateway(struct ofono_gprs_context *gc,
> const char *gateway);
>
> I'm not sure these are really needed, which is why I dropped these from subsequent patches. This information is not received from the cellular network as part of context activation signalling. On-link prefixes, routes and default gateways are received as part of the standard IPv6 stateless address autoconfiguration when the interfaces is brought up. The only reason to have these would if a specific modem with a virtual ethernet interface deviates from the standard address configuration practises for some reasons.
At least the gateway is reported separately for IPv4 and IPv6. Refer to
27.007 Section 10.1.23 "PDP Context Read Dynamic Parameters".
For IPv6 we decided to go with prefix length to keep symmetry with
connman, even though 27.007 reports a netmask. Drivers will need to
convert between IPv6 netmask and prefix length, so this might have to be
addressed in the future.
However, you might be right and that 27.007 is not a good reflection of
reality. This has happened before ;)
>
> Current USB modem sticks don't seem to have IPv6 support, so I'd propose to just drop these and add an API later if it turns out to be necessary. If USB sticks do this propertly, they'll just proxy router advertisements and neighbor discovery messages over the virtual ethernet interface and any additional address configuration settings won't be needed.
>
> If you decide to keep these, prefix length should probably default to 64 and be always shown in the settings.
>
>> These are highly experimental and have not received much
>> testing (since
>> I don't really have any facilities to do so). So please look
>> and let me
>> know if something isn't working as intended.
>
> I'm not able to test dual context but IPv6 seems to work with isimodem. I did notice that the context settings allocated in assign_context() are leaked if context activation fails. Easy enough to fix, though:
>
Sounds good. Good catch on the leak, should we put it into
pri_activate_callback error case right before release_context? Either
way, please do me a favor and send a proper patch.
Regards,
-Denis
^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-16 15:54 ` Denis Kenzior
@ 2011-03-17 8:58 ` Mika.Liljeberg
2011-03-17 14:53 ` Denis Kenzior
0 siblings, 1 reply; 25+ messages in thread
From: Mika.Liljeberg @ 2011-03-17 8:58 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5991 bytes --]
Hi Denis, Marcel,
I'll respond just once, since you both commented on pretty much the same topics.
> > I notice that your version of the patches are not forming
> the IPv6 link-local address and configuring it on the network
> interface. That's ok, as long as connman takes care of it,
> but it does mean that Ethernet interfaces, which always have
> a link-local address, will autoconfigure immediately while
> point-to-point interfaces will only autoconfigure when
> connman sets the link-local address on them. We talked about
> this with Marcel and at the time concluded that it would make
> more sense to keep things consistent by having oFono
> configure the link-local address on the point-to-point
> interfaces. I had this implemented in my later patch sets.
[Denis]
> Samuel felt strongly that this should be done by ConnMan.
> There's still
> some questions left around this area. Namely whether we
> should prevent
> auto-configuration or not, etc.
Disabling IPv6 stateless address would be a bold move indeed, since it is declared mandatory in both IETF and 3GPP standards. Please see [RFC4294] and [3GPP 23.060]. The section "Dynamic IPv6 Address Allocation" in 23.060 is very clear on how IPv6 address allocation in 3GPPP networks is done. See also the section about IPv6 prefix delegation (relevant to IPv6 tethering) and applicable parts of 24.008.
> > Having separate lists for IPv4 and IPv6 DNS servers made
> sense in my first patch set, because a dual context could be
> emulated with separate IPv4 and IPv6 contexts and those DNS
> servers might have been behind different network interfaces.
> However, now this just creates additional complexity for the
> drivers. A dual context will get a list of DNS server
> addresses, which may contain IPv4 addresses, IPv6 addresses
> or both. Now the driver has to sort them into two separate
> lists for IPv4 and IPv6. Note that you can make A and AAAA
> queries to any server, so there is no particular reason to
> separate the lists based on address family.
[Denis]
> We waffled on this one, but it seemed better to keep it symmetric with
> the way ConnMan API is setup for IPv6. For AT modems that support
> dual-stack, the IPv4 and IPv6 information is returned
> separately anyway,
> so for the majority of the drivers separating the details is
> more efficient.
Sounds like connman has some unnecessary complexity here as well. A single DNS server list really should be sufficient. Not a big deal, though, as long as connman combines the lists at some point and gives the whole thing to the DNS resolver.
> > void ofono_gprs_context_set_ipv6_prefix_length(struct
> ofono_gprs_context *gc,
> > unsigned
> char length);
> > void ofono_gprs_context_set_ipv6_gateway(struct
> ofono_gprs_context *gc,
> > const char
> *gateway);
> >
> > I'm not sure these are really needed, which is why I
> dropped these from subsequent patches. This information is
> not received from the cellular network as part of context
> activation signalling. On-link prefixes, routes and default
> gateways are received as part of the standard IPv6 stateless
> address autoconfiguration when the interfaces is brought up.
> The only reason to have these would if a specific modem with
> a virtual ethernet interface deviates from the standard
> address configuration practises for some reasons.
>
[Denis]
> At least the gateway is reported separately for IPv4 and
> IPv6. Refer to
> 27.007 Section 10.1.23 "PDP Context Read Dynamic Parameters".
[Marcel]
> The AT commands are pretty clear in that they give us actually a
> netmask.
True at first glance. However, please note the following:
1) The netmask and gateway values returned here are invented by the modem. They do not come from the network, because they are not carried anywhere in the signalling messages related to PDP context activation. Stateless IPv6 address autoconfiguration (potentially followed by DHCPv6) is the only way to get the real information from the network.
2) AT+CGPADDR and AT+CGCONTRDP were introduced in 3GPP rel8 and they are both optional. I.e. pre-rel8 equipment does not have them and rel8+ equipment is not required to have them. In particular, they are not required for a modem to be able to support IPv6, so you cannot rely on these commands being implemented in the modem.
3) IPv6 stateless address autoconfiguration is mandatory in 3GPP standards, as well as in IETF standards. There's no two ways about it.
Granted, AT+CGPADDR and AT+GCCONTRDP may be useful for supporting some quirky modems, as already seen with IPv4 and virtual ethernet interfaces. Lacking a concrete example for such a modem I don't see much point in adding these methods yet, though.
[Denis]
> For IPv6 we decided to go with prefix length to keep symmetry with
> connman, even though 27.007 reports a netmask. Drivers will need to
> convert between IPv6 netmask and prefix length, so this might
> have to be
> addressed in the future.
Actually, the latest versions of 27.007 introduce the AT+CGPIAF command, which allows the use of proper textual representations for IPv6 addresses and prefixes. Looks like it is finally dawning on the AT spec writers that IPv6 is actually very different from IPv4. ;)
[Denis]
> However, you might be right and that 27.007 is not a good
> reflection of
> reality. This has happened before ;)
It is not. 27.007 is just an interface specification for modem vendords. It does not specify the behaviour and protocols between a UE and the network. You really need to look at 23.060 and 24.008. It will save you some hassle in the future.
[Marcel]
> Our success rate with testing IPv6 on a real network with current
> hardware was rather limited.
That is obvious.
Regards,
MikaL
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-17 8:58 ` Mika.Liljeberg
@ 2011-03-17 14:53 ` Denis Kenzior
2011-03-18 8:33 ` Mika.Liljeberg
0 siblings, 1 reply; 25+ messages in thread
From: Denis Kenzior @ 2011-03-17 14:53 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5118 bytes --]
Hi Mika,
On 03/17/2011 03:58 AM, Mika.Liljeberg(a)nokia.com wrote:
> Hi Denis, Marcel,
>
> I'll respond just once, since you both commented on pretty much the same topics.
>
>>> I notice that your version of the patches are not forming
>> the IPv6 link-local address and configuring it on the network
>> interface. That's ok, as long as connman takes care of it,
>> but it does mean that Ethernet interfaces, which always have
>> a link-local address, will autoconfigure immediately while
>> point-to-point interfaces will only autoconfigure when
>> connman sets the link-local address on them. We talked about
>> this with Marcel and at the time concluded that it would make
>> more sense to keep things consistent by having oFono
>> configure the link-local address on the point-to-point
>> interfaces. I had this implemented in my later patch sets.
>
> [Denis]
>> Samuel felt strongly that this should be done by ConnMan.
>> There's still
>> some questions left around this area. Namely whether we
>> should prevent
>> auto-configuration or not, etc.
>
> Disabling IPv6 stateless address would be a bold move indeed, since it is declared mandatory in both IETF and 3GPP standards. Please see [RFC4294] and [3GPP 23.060]. The section "Dynamic IPv6 Address Allocation" in 23.060 is very clear on how IPv6 address allocation in 3GPPP networks is done. See also the section about IPv6 prefix delegation (relevant to IPv6 tethering) and applicable parts of 24.008.
>
This still needs to be figured out. We are aware that autoconfiguration
is mandatory in 3GPP. However, this seems to be going against 27.007.
So in the end both might be required.
<snip>
>>> void ofono_gprs_context_set_ipv6_prefix_length(struct
>> ofono_gprs_context *gc,
>>> unsigned
>> char length);
>>> void ofono_gprs_context_set_ipv6_gateway(struct
>> ofono_gprs_context *gc,
>>> const char
>> *gateway);
>>>
>>> I'm not sure these are really needed, which is why I
>> dropped these from subsequent patches. This information is
>> not received from the cellular network as part of context
>> activation signalling. On-link prefixes, routes and default
>> gateways are received as part of the standard IPv6 stateless
>> address autoconfiguration when the interfaces is brought up.
>> The only reason to have these would if a specific modem with
>> a virtual ethernet interface deviates from the standard
>> address configuration practises for some reasons.
>>
>
> [Denis]
>> At least the gateway is reported separately for IPv4 and
>> IPv6. Refer to
>> 27.007 Section 10.1.23 "PDP Context Read Dynamic Parameters".
>
> [Marcel]
>> The AT commands are pretty clear in that they give us actually a
>> netmask.
>
> True at first glance. However, please note the following:
>
> 1) The netmask and gateway values returned here are invented by the modem. They do not come from the network, because they are not carried anywhere in the signalling messages related to PDP context activation. Stateless IPv6 address autoconfiguration (potentially followed by DHCPv6) is the only way to get the real information from the network.
>
> 2) AT+CGPADDR and AT+CGCONTRDP were introduced in 3GPP rel8 and they are both optional. I.e. pre-rel8 equipment does not have them and rel8+ equipment is not required to have them. In particular, they are not required for a modem to be able to support IPv6, so you cannot rely on these commands being implemented in the modem.
>
> 3) IPv6 stateless address autoconfiguration is mandatory in 3GPP standards, as well as in IETF standards. There's no two ways about it.
>
> Granted, AT+CGPADDR and AT+GCCONTRDP may be useful for supporting some quirky modems, as already seen with IPv4 and virtual ethernet interfaces. Lacking a concrete example for such a modem I don't see much point in adding these methods yet, though.
Optional means nothing in 3GPP 27.007, half that spec is marked as
optional. And I've already seen CGPADDR in the wild...
As I mentioned before, it might be that the modem performs the
autoconfiguration and DHCPv6 steps for us. We might not even be able to
turn this behavior off. Re-running the autoconfiguration and DHCPv6 on
the host side is a waste of time at that point.
In the end oFono's philosophy is to always err on the side of 27.007.
So far this strategy has never been (completely) wrong.
<snip>
> [Denis]
>> However, you might be right and that 27.007 is not a good
>> reflection of
>> reality. This has happened before ;)
>
> It is not. 27.007 is just an interface specification for modem vendords. It does not specify the behaviour and protocols between a UE and the network. You really need to look at 23.060 and 24.008. It will save you some hassle in the future.
>
You're right of course, 27.007 is sometimes very far from the protocol.
Unfortunately oFono doesn't work with the core protocols, but with 27.007.
Regards,
-Denis
^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-17 14:53 ` Denis Kenzior
@ 2011-03-18 8:33 ` Mika.Liljeberg
2011-03-18 16:26 ` Denis Kenzior
0 siblings, 1 reply; 25+ messages in thread
From: Mika.Liljeberg @ 2011-03-18 8:33 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 3885 bytes --]
Hi Denis,
> > Disabling IPv6 stateless address would be a bold move
> indeed, since it is declared mandatory in both IETF and 3GPP
> standards. Please see [RFC4294] and [3GPP 23.060]. The
> section "Dynamic IPv6 Address Allocation" in 23.060 is very
> clear on how IPv6 address allocation in 3GPPP networks is
> done. See also the section about IPv6 prefix delegation
> (relevant to IPv6 tethering) and applicable parts of 24.008.
> >
>
> This still needs to be figured out. We are aware that
> autoconfiguration
> is mandatory in 3GPP. However, this seems to be going against 27.007.
There is no contradiction. Let me explain what I mean. The 3GPP standards mostly talk about MS (mobile station) which comprises of both TE and MT (terminal equipment and modem terminal). As such, 3GPP specifications place requirements on both TE and MT. The 27.007 defines a TA (terminal adapter), which is one possible interface between TE and MT. However, 27.007 is not mandatory, vendor specific interfaces are also allowed. As a consequence other interfaces, such as ISI and CAIF, also exist.
While stateless address autoconfiguration is mandatory for MS, a funky AT modem could potentially have an internal IPv6 stack as part of the TA function and perform address configuration against the network and then proxy any IPv6 traffic between the TE and the network. This would meet the requirements of 3GPP. The *intent* in the 3GPP standards is that TEs can behave as standard IPv6 hosts (so PCs can use a standard IPv6 stack), which means that the TE is expected to run the autoconfiguration protocols against the network in the normal case. Nothing in 27.007 specifically prevents that. The static address configuration parameters in the AT commands are optional and will simply be missing, if the modem just acts as a bitpipe between TE and the network, allowing the TE to run its IPv6 stack in the normal way.
However, a funky AT modem that implements an IPv6 stack internally and exposes static address configuration parameters towards TE is certainly possible. Such a modem would presumably also block the router advertisements coming from the network, which would effectively disable stateless address autoconfiguration for the TE. This is not something you need or should do in connman. Standard IPv6 stack is sufficient.
> So in the end both might be required.
On this I agree. Stateless address autoconfiguration is needed because it is mandatory in both IETF and 3GPP standards (sorry for the repetition). Static configuration (optional in IETF standards) may also be needed but that remains to be seen. It depends on what kind of funky AT modems are and will be out there.
> In the end oFono's philosophy is to always err on the side of 27.007.
> So far this strategy has never been (completely) wrong.
27.007 provides a nice checklist for the functionality of the modem, so in that sense you're right. In another way it also serves as a lowest common denominator for the same functionality. However, what 27.007 does not do is specify system behaviour. It's easy to jump to conclusions just by looking at what AT commands are available. Most of the commands are optional, because a lot of freedom has intentionally been left for the implementors. It is also why, IMO, the specification is so bad and we have to fight with all these quirky AT modem implementations.
Remember that 3GPP standards specify the behavour between MS and the nework. I.e., they place requirements on both TE and MT. The AT interface (TA function) stands in between and the combination of TE+TA+MT must function in accordance to 3GPP standards. My point is, you *really* need to read other 3GPP specification, like 23.060 and 24.008, in order to understand what requirements 3GPP places on oFono. Reading 27.007 will not tell you that.
Regards,
MikaL
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-18 8:33 ` Mika.Liljeberg
@ 2011-03-18 16:26 ` Denis Kenzior
2011-03-21 8:44 ` Mika.Liljeberg
2011-03-21 8:59 ` Aki Niemi
0 siblings, 2 replies; 25+ messages in thread
From: Denis Kenzior @ 2011-03-18 16:26 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5474 bytes --]
Hi Mika,
On 03/18/2011 03:33 AM, Mika.Liljeberg(a)nokia.com wrote:
> Hi Denis,
>
>>> Disabling IPv6 stateless address would be a bold move
>> indeed, since it is declared mandatory in both IETF and 3GPP
>> standards. Please see [RFC4294] and [3GPP 23.060]. The
>> section "Dynamic IPv6 Address Allocation" in 23.060 is very
>> clear on how IPv6 address allocation in 3GPPP networks is
>> done. See also the section about IPv6 prefix delegation
>> (relevant to IPv6 tethering) and applicable parts of 24.008.
>>>
>>
>> This still needs to be figured out. We are aware that
>> autoconfiguration
>> is mandatory in 3GPP. However, this seems to be going against 27.007.
>
> There is no contradiction. Let me explain what I mean. The 3GPP standards mostly talk about MS (mobile station) which comprises of both TE and MT (terminal equipment and modem terminal). As such, 3GPP specifications place requirements on both TE and MT. The 27.007 defines a TA (terminal adapter), which is one possible interface between TE and MT. However, 27.007 is not mandatory, vendor specific interfaces are also allowed. As a consequence other interfaces, such as ISI and CAIF, also exist.
>
No arguments here
> While stateless address autoconfiguration is mandatory for MS, a funky AT modem could potentially have an internal IPv6 stack as part of the TA function and perform address configuration against the network and then proxy any IPv6 traffic between the TE and the network. This would meet the requirements of 3GPP. The *intent* in the 3GPP standards is that TEs can behave as standard IPv6 hosts (so PCs can use a standard IPv6 stack), which means that the TE is expected to run the autoconfiguration protocols against the network in the normal case. Nothing in 27.007 specifically prevents that. The static address configuration parameters in the AT commands are optional and will simply be missing, if the modem just acts as a bitpipe between TE and the network, allowing the TE to run its IPv6 stack in the normal way.
>
> However, a funky AT modem that implements an IPv6 stack internally and exposes static address configuration parameters towards TE is certainly possible. Such a modem would presumably also block the router advertisements coming from the network, which would effectively disable stateless address autoconfiguration for the TE. This is not something you need or should do in connman. Standard IPv6 stack is sufficient.
>
>> So in the end both might be required.
>
> On this I agree. Stateless address autoconfiguration is needed because it is mandatory in both IETF and 3GPP standards (sorry for the repetition). Static configuration (optional in IETF standards) may also be needed but that remains to be seen. It depends on what kind of funky AT modems are and will be out there.
>
So you seem to agree as well, and hence why our IPv6 API is the way it
is right now.
>> In the end oFono's philosophy is to always err on the side of 27.007.
>> So far this strategy has never been (completely) wrong.
>
> 27.007 provides a nice checklist for the functionality of the modem, so in that sense you're right. In another way it also serves as a lowest common denominator for the same functionality. However, what 27.007 does not do is specify system behaviour. It's easy to jump to conclusions just by looking at what AT commands are available. Most of the commands are optional, because a lot of freedom has intentionally been left for the implementors. It is also why, IMO, the specification is so bad and we have to fight with all these quirky AT modem implementations.
>
Unfortunately that ship has sailed. Every vendor except Nokia uses AT
command modems, or at least implements a (somewhat) full-featured AT
backend. oFono is not about to start inventing its own standard and
then try to merge differences between e.g. ISI 2.0, ISI 2.5, AT
commands, CAIF, QCDM, etc. If the industry couldn't agree on a proper
standard protocol, then I doubt oFono will be able to. And we're not
about to start switch/casing modem types in the core. That way leads to
chaos.
We chose this path two years ago and have been pretty successful with
it. Complaining about this now is the wrong time. If your protocol is
different from 27.007, then it just means extra pain for the modem
driver writer. But as you mentioned, 27.007 is the lowest common
denominator and the vendor specific protocols are richer. So
implementing 27.007 behavior is usually workable (though not always easy)
The core tries to help you whenever possible here and deviates from
27.007 when really necessary, but I'm not tempted to stray too far from
it. Don't get me wrong, 27.007 is a pain and you've seen me complaining
about its 'peculiarities' often, but it is the best thing we have right now.
> Remember that 3GPP standards specify the behavour between MS and the nework. I.e., they place requirements on both TE and MT. The AT interface (TA function) stands in between and the combination of TE+TA+MT must function in accordance to 3GPP standards. My point is, you *really* need to read other 3GPP specification, like 23.060 and 24.008, in order to understand what requirements 3GPP places on oFono. Reading 27.007 will not tell you that.
>
I think everyone here knows that, but in the end 27.007 weighs in above
all others because that is what everyone implements in the end.
Regards,
-Denis
^ permalink raw reply [flat|nested] 25+ messages in thread
* RE: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-18 16:26 ` Denis Kenzior
@ 2011-03-21 8:44 ` Mika.Liljeberg
2011-03-21 8:59 ` Aki Niemi
1 sibling, 0 replies; 25+ messages in thread
From: Mika.Liljeberg @ 2011-03-21 8:44 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 5118 bytes --]
Hi Denis,
> On 03/18/2011 03:33 AM, Mika.Liljeberg(a)nokia.com wrote:
> > On this I agree. Stateless address autoconfiguration is
> needed because it is mandatory in both IETF and 3GPP
> standards (sorry for the repetition). Static configuration
> (optional in IETF standards) may also be needed but that
> remains to be seen. It depends on what kind of funky AT
> modems are and will be out there.
> >
>
> So you seem to agree as well, and hence why our IPv6 API is the way it
> is right now.
The plugin API is ok'ish. I made a few improvement proposals and they still stand. No major objections, though.
The motive for this discussion was your and Marcel's comments that you were planning to disable IPv6 stateles address autoconfiguration. On that I most definitely disagree. I hope I've managed to talk you out of it.
> >> In the end oFono's philosophy is to always err on the side
> of 27.007.
> >> So far this strategy has never been (completely) wrong.
> >
> > 27.007 provides a nice checklist for the functionality of
> the modem, so in that sense you're right. In another way it
> also serves as a lowest common denominator for the same
> functionality. However, what 27.007 does not do is specify
> system behaviour. It's easy to jump to conclusions just by
> looking at what AT commands are available. Most of the
> commands are optional, because a lot of freedom has
> intentionally been left for the implementors. It is also why,
> IMO, the specification is so bad and we have to fight with
> all these quirky AT modem implementations.
> >
>
> Unfortunately that ship has sailed. Every vendor except Nokia uses AT
> command modems, or at least implements a (somewhat) full-featured AT
> backend. oFono is not about to start inventing its own standard and
> then try to merge differences between e.g. ISI 2.0, ISI 2.5, AT
> commands, CAIF, QCDM, etc. If the industry couldn't agree on a proper
> standard protocol, then I doubt oFono will be able to. And we're not
> about to start switch/casing modem types in the core. That
> way leads to
> chaos.
>
> We chose this path two years ago and have been pretty successful with
> it. Complaining about this now is the wrong time. If your
> protocol is
> different from 27.007, then it just means extra pain for the modem
> driver writer. But as you mentioned, 27.007 is the lowest common
> denominator and the vendor specific protocols are richer. So
> implementing 27.007 behavior is usually workable (though not
> always easy)
I believe you completely missed the thrust of my comments there. This is not about 27.007 vs some other modem interface. My point, again, is that 27.007 does not specify system behaviour. You need to read a bunch of other 3GPP specs as well in order to understand the requirements for oFono. Otherwise you will come up with weird and disturbing ideas like "let's disable stateless IPv6 address autoconfiguration", which are completely against 3GPP standards.
As for being successful, I don't think that has been put to the test yet. There's an implementation out there and the oFono project has gained decent momentum, which is good. However, oFono can only be called mature when there are more than a few oFono based smart phones on the marked, having passed all the certification tests, having met operator requirements and gained operator approvals for their sales channels, as well as having gained customer approval. That's a long road still. Not that it couldn't be done.
> The core tries to help you whenever possible here and deviates from
> 27.007 when really necessary, but I'm not tempted to stray
> too far from
> it. Don't get me wrong, 27.007 is a pain and you've seen me
> complaining
> about its 'peculiarities' often, but it is the best thing we
> have right now.
I think it's natural that you use 27.007 as a guideline for the plugin interface, for the reasons you mention. It is not a sufficient guideline for oFono core behavour, however. For that you also need to understand the signalling protocols between MS and core network. Understanding the protocols will help you understand how the MT behaves and how oFono core should behave.
> > Remember that 3GPP standards specify the behavour between
> MS and the nework. I.e., they place requirements on both TE
> and MT. The AT interface (TA function) stands in between and
> the combination of TE+TA+MT must function in accordance to
> 3GPP standards. My point is, you *really* need to read other
> 3GPP specification, like 23.060 and 24.008, in order to
> understand what requirements 3GPP places on oFono. Reading
> 27.007 will not tell you that.
> >
>
> I think everyone here knows that, but in the end 27.007
> weighs in above
> all others because that is what everyone implements in the end.
Perhaps everyone knows it but has everyone actually read the other standards I mentioned? Sometimes I wonder. What everyone is required to implement in the end is 3GPP standards, only one of which is 27.007.
Br,
MikaL
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-18 16:26 ` Denis Kenzior
2011-03-21 8:44 ` Mika.Liljeberg
@ 2011-03-21 8:59 ` Aki Niemi
2011-03-21 17:21 ` Marcel Holtmann
1 sibling, 1 reply; 25+ messages in thread
From: Aki Niemi @ 2011-03-21 8:59 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 725 bytes --]
Hi Denis,
2011/3/18 Denis Kenzior <denkenz@gmail.com>:
> Unfortunately that ship has sailed. Every vendor except Nokia uses AT
> command modems, or at least implements a (somewhat) full-featured AT
> backend.
Not quite the way I see things. There are notable exceptions to this,
for example, Qualcomm modems don't use AT commands but a proprietary
protocol.
That said, I think designing the modem driver API based on 27.007 was
a good design decision, but the real test of that decision hasn't
really been done yet. Of course you'll find AT modems mostly a good
fit, and in most cases the other protocols too. But calling it a
raving success without, say, QMI support is a bit premature.
Cheers,
Aki
^ permalink raw reply [flat|nested] 25+ messages in thread
* Re: [RESEND 3 PATCH 00/13] IPv6 Support
2011-03-21 8:59 ` Aki Niemi
@ 2011-03-21 17:21 ` Marcel Holtmann
0 siblings, 0 replies; 25+ messages in thread
From: Marcel Holtmann @ 2011-03-21 17:21 UTC (permalink / raw)
To: ofono
[-- Attachment #1: Type: text/plain, Size: 802 bytes --]
Hi Aki,
> > Unfortunately that ship has sailed. Every vendor except Nokia uses AT
> > command modems, or at least implements a (somewhat) full-featured AT
> > backend.
>
> Not quite the way I see things. There are notable exceptions to this,
> for example, Qualcomm modems don't use AT commands but a proprietary
> protocol.
>
> That said, I think designing the modem driver API based on 27.007 was
> a good design decision, but the real test of that decision hasn't
> really been done yet. Of course you'll find AT modems mostly a good
> fit, and in most cases the other protocols too. But calling it a
> raving success without, say, QMI support is a bit premature.
I am happily inviting Qualcomm to join oFono and add support for their
QMI protocol ;)
Regards
Marcel
^ permalink raw reply [flat|nested] 25+ messages in thread
end of thread, other threads:[~2011-03-21 17:21 UTC | newest]
Thread overview: 25+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-03-07 14:02 [RESEND 3 PATCH 00/13] IPv6 Support Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 01/13] gprs: factor out common code Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 02/13] gprs: Update documentation for IPv6 Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 03/13] gprs: driver interface changes " Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 04/13] gprs: core support " Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 05/13] test: modify test scripts " Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 06/13] isimodem: IPv6 support Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 07/13] atmodem: update to new gprs context interface Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 08/13] huaweimodem: " Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 09/13] mbmmodem: " Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 10/13] hsomodem: " Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 11/13] ifxmodem: " Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 12/13] stemodem: " Mika Liljeberg
2011-03-07 14:02 ` [RESEND 3 PATCH 13/13] phonesim: add IPv6 support Mika Liljeberg
2011-03-15 22:18 ` [RESEND 3 PATCH 00/13] IPv6 Support Denis Kenzior
2011-03-16 10:45 ` Mika.Liljeberg
2011-03-16 15:41 ` Marcel Holtmann
2011-03-16 15:54 ` Denis Kenzior
2011-03-17 8:58 ` Mika.Liljeberg
2011-03-17 14:53 ` Denis Kenzior
2011-03-18 8:33 ` Mika.Liljeberg
2011-03-18 16:26 ` Denis Kenzior
2011-03-21 8:44 ` Mika.Liljeberg
2011-03-21 8:59 ` Aki Niemi
2011-03-21 17:21 ` Marcel Holtmann
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.