+static int
+lookup_zone(const char *zone, const char *device)
+{
+ struct fw3_zone *z;
+ struct fw3_device *d;
+
+ list_for_each_entry(z, &cfg_state->zones, list)
+ {
+ if (strcmp(z->name, zone))
+ continue;
+
+ list_for_each_entry(d, &z->devices, list)
+ {
+ if (device && strcmp(device, d->name))
+ continue;
+
+ printf("%s\n", d->name);
+
+ if (device)
+ return 0;
+ }
+
+ if (!device)
+ return 0;
+ }
+
+ return 1;
+}
+