Add support for IPv4.Broadcast property
authorMarcel Holtmann <marcel@holtmann.org>
Mon, 15 Dec 2008 03:59:36 +0000 (04:59 +0100)
committerMarcel Holtmann <marcel@holtmann.org>
Mon, 15 Dec 2008 03:59:36 +0000 (04:59 +0100)
include/property.h
src/element.c

index 4c42f44..fe734c2 100644 (file)
@@ -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,
index 72f4026..9f59de0 100644 (file)
@@ -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,