element: Add peer IPv4 property
authorSamuel Ortiz <sameo@linux.intel.com>
Wed, 3 Nov 2010 09:24:44 +0000 (10:24 +0100)
committerSamuel Ortiz <sameo@linux.intel.com>
Wed, 3 Nov 2010 09:24:44 +0000 (10:24 +0100)
include/element.h
include/property.h
src/element.c

index 05aa06d..3723df8 100644 (file)
@@ -104,6 +104,7 @@ struct connman_element {
        struct {
                enum connman_ipconfig_method method;
                gchar *address;
+               gchar *peer;
                gchar *netmask;
                gchar *gateway;
                gchar *network;
index 4581ec1..e18e1e9 100644 (file)
@@ -45,6 +45,7 @@ enum connman_property_id {
 
        CONNMAN_PROPERTY_ID_IPV4_METHOD,
        CONNMAN_PROPERTY_ID_IPV4_ADDRESS,
+       CONNMAN_PROPERTY_ID_IPV4_PEER,
        CONNMAN_PROPERTY_ID_IPV4_NETMASK,
        CONNMAN_PROPERTY_ID_IPV4_GATEWAY,
        CONNMAN_PROPERTY_ID_IPV4_BROADCAST,
index a5700f2..299f85f 100644 (file)
@@ -777,6 +777,12 @@ int connman_element_get_value(struct connman_element *element,
                                                                id, value);
                *((char **) value) = element->ipv4.address;
                break;
+       case CONNMAN_PROPERTY_ID_IPV4_PEER:
+               if (element->ipv4.peer == NULL)
+                       return connman_element_get_value(element->parent,
+                                                               id, value);
+               *((char **) value) = element->ipv4.peer;
+               break;
        case CONNMAN_PROPERTY_ID_IPV4_NETMASK:
                if (element->ipv4.netmask == NULL)
                        return connman_element_get_value(element->parent,