*/
int connman_ipconfig_get_index(struct connman_ipconfig *ipconfig)
{
+ if (ipconfig == NULL)
+ return -1;
+
if (ipconfig->origin != NULL)
return ipconfig->origin->index;
{
struct connman_ipdevice *ipdevice;
+ if (ipconfig == NULL)
+ return NULL;
+
if (ipconfig->index < 0)
return NULL;
connman_dbus_dict_append_basic(iter, "Netmask",
DBUS_TYPE_STRING, &mask);
}
+
+ if (ipconfig->system->gateway != NULL)
+ connman_dbus_dict_append_basic(iter, "Gateway",
+ DBUS_TYPE_STRING, &ipconfig->address->gateway);
}
void __connman_ipconfig_append_ipv4config(struct connman_ipconfig *ipconfig,
mask = inet_ntoa(netmask);
connman_dbus_dict_append_basic(iter, "Netmask",
DBUS_TYPE_STRING, &mask);
+ }
+ if (ipconfig->address->gateway != NULL)
connman_dbus_dict_append_basic(iter, "Gateway",
DBUS_TYPE_STRING, &ipconfig->address->gateway);
- }
}
int __connman_ipconfig_set_ipv4config(struct connman_ipconfig *ipconfig,