From 0323435d73aeaf0dea25e40e7b41bf6d1a4534f3 Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Mon, 15 Dec 2008 04:59:36 +0100 Subject: [PATCH] Add support for IPv4.Broadcast property --- include/property.h | 1 + src/element.c | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/property.h b/include/property.h index 4c42f44..fe734c2 100644 --- a/include/property.h +++ b/include/property.h @@ -39,6 +39,7 @@ enum connman_property_id { CONNMAN_PROPERTY_ID_IPV4_ADDRESS, CONNMAN_PROPERTY_ID_IPV4_NETMASK, CONNMAN_PROPERTY_ID_IPV4_GATEWAY, + CONNMAN_PROPERTY_ID_IPV4_BROADCAST, CONNMAN_PROPERTY_ID_IPV4_NAMESERVER, CONNMAN_PROPERTY_ID_WIFI_SECURITY, diff --git a/src/element.c b/src/element.c index 72f4026..9f59de0 100644 --- a/src/element.c +++ b/src/element.c @@ -52,6 +52,8 @@ static struct { DBUS_TYPE_STRING, "IPv4.Netmask" }, { CONNMAN_PROPERTY_ID_IPV4_GATEWAY, DBUS_TYPE_STRING, "IPv4.Gateway" }, + { CONNMAN_PROPERTY_ID_IPV4_BROADCAST, + DBUS_TYPE_STRING, "IPv4.Broadcast" }, { CONNMAN_PROPERTY_ID_IPV4_NAMESERVER, DBUS_TYPE_STRING, "IPv4.Nameserver" }, @@ -1436,6 +1438,12 @@ int connman_element_set_property(struct connman_element *element, element->ipv4.gateway = g_strdup(*((const char **) value)); __connman_element_unlock(element); break; + case CONNMAN_PROPERTY_ID_IPV4_BROADCAST: + __connman_element_lock(element); + g_free(element->ipv4.broadcast); + element->ipv4.broadcast = g_strdup(*((const char **) value)); + __connman_element_unlock(element); + break; case CONNMAN_PROPERTY_ID_IPV4_NAMESERVER: __connman_element_lock(element); g_free(element->ipv4.nameserver); @@ -1492,6 +1500,14 @@ int connman_element_get_value(struct connman_element *element, *((char **) value) = element->ipv4.gateway; __connman_element_unlock(element); break; + case CONNMAN_PROPERTY_ID_IPV4_BROADCAST: + if (element->ipv4.broadcast == NULL) + return connman_element_get_value(element->parent, + id, value); + __connman_element_lock(element); + *((char **) value) = element->ipv4.broadcast; + __connman_element_unlock(element); + break; case CONNMAN_PROPERTY_ID_IPV4_NAMESERVER: if (element->ipv4.nameserver == NULL) return connman_element_get_value(element->parent, -- 2.7.4