+static struct interface_config *first_active_interface(
+ const struct config *config)
+{
+ unsigned int i;
+
+ for (i = 0; i < config->network.n_interfaces; i++) {
+ if (config->network.interfaces[i]->ignore)
+ continue;
+ return config->network.interfaces[i];
+ }
+ return NULL;
+}
+
+static enum net_conf_type find_net_conf_type(const struct config *config)
+{
+ struct interface_config *ifcfg;
+
+ ifcfg = first_active_interface(config);
+
+ if (!ifcfg)
+ return NET_CONF_TYPE_DHCP_ALL;
+
+ else if (ifcfg->method == CONFIG_METHOD_DHCP)
+ return NET_CONF_TYPE_DHCP_ONE;
+
+ else if (ifcfg->method == CONFIG_METHOD_STATIC)
+ return NET_CONF_TYPE_STATIC;
+
+ assert(0);
+ return NET_CONF_TYPE_DHCP_ALL;
+}
+