Skip to content

Commit

Permalink
Merge branch 'jb51168' into 'master'
Browse files Browse the repository at this point in the history
[connman] Expose Ipv4StatusUrl as manager property. Contributes to JB#51168

See merge request mer-core/connman!299
  • Loading branch information
chriadam committed Dec 2, 2020
2 parents f5c267a + 2d43a85 commit d987125
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 0 deletions.
18 changes: 18 additions & 0 deletions connman/doc/manager-api.txt
Expand Up @@ -305,3 +305,21 @@ Properties string State [readonly]
and does not affect ConnMan in any way.

The default value is false.

string Ipv4StatusUrl [readonly]

The IPv4 network status check URL which has been
configured for the device. This URL may be used by
applications who wish to check whether the device
currently has open Internet access (as opposed to
begin connected to a wireless network requiring a
Captive Portal login, or otherwise restricted network).

string Ipv6StatusUrl [readonly]

The IPv6 network status check URL which has been
configured for the device. This URL may be used by
applications who wish to check whether the device
currently has open Internet access (as opposed to
begin connected to a wireless network requiring a
Captive Portal login, or otherwise restricted network).
10 changes: 10 additions & 0 deletions connman/src/manager.c
Expand Up @@ -63,6 +63,8 @@ static DBusMessage *get_properties(DBusConnection *conn,
dbus_bool_t offlinemode;
dbus_uint32_t uint32_value;
const char *str;
const char *ipv4_status_url;
const char *ipv6_status_url;

DBG("conn %p", conn);

Expand Down Expand Up @@ -91,6 +93,14 @@ static DBusMessage *get_properties(DBusConnection *conn,
DBUS_TYPE_UINT32,
&uint32_value);

ipv4_status_url = connman_option_get_string(CONF_STATUS_URL_IPV4);
connman_dbus_dict_append_basic(&dict, "Ipv4StatusUrl",
DBUS_TYPE_STRING, &ipv4_status_url);

ipv6_status_url = connman_option_get_string(CONF_STATUS_URL_IPV6);
connman_dbus_dict_append_basic(&dict, "Ipv6StatusUrl",
DBUS_TYPE_STRING, &ipv6_status_url);

connman_dbus_dict_close(&array, &dict);

return reply;
Expand Down

0 comments on commit d987125

Please sign in to comment.