+static struct interface *find_interface_by_name(struct network *network,
+ const char *name)
+{
+ struct interface *interface;
+
+ list_for_each_entry(&network->interfaces, interface, list)
+ if (!strcmp(interface->name, name))
+ return interface;
+
+ return NULL;
+}
+
+static struct interface *find_interface_by_uuid(struct network *network,
+ const char *uuid)
+{
+ struct interface *interface;
+ char *mac;
+
+ list_for_each_entry(&network->interfaces, interface, list) {
+ mac = mac_bytes_to_string(interface, interface->hwaddr,
+ sizeof(interface->hwaddr));
+ if (!strcmp(mac, uuid)) {
+ talloc_free(mac);
+ return interface;
+ }
+ talloc_free(mac);
+ }
+
+ return NULL;
+}
+
+uint8_t *find_mac_by_name(void *ctx, struct network *network,
+ const char *name)
+{
+ struct interface *interface;
+
+ interface = find_interface_by_name(network, name);
+ if (!interface)
+ return NULL;
+
+ return talloc_memdup(ctx, &interface->hwaddr,
+ sizeof(uint8_t) * HWADDR_SIZE);
+}
+