+static enum device_type event_device_type(struct device *device,
+ struct event *event)
+{
+ const char *param;
+
+ param = event_get_param(event, "type");
+ if (!param) {
+ pb_log("%s: empty type\n", device->id);
+ return DEVICE_TYPE_UNKNOWN;
+ }
+
+ if (!strcmp(param, "disk") || !strcmp(param, "partition"))
+ return DEVICE_TYPE_DISK;
+
+ if (!strcmp(param, "net"))
+ return DEVICE_TYPE_NETWORK;
+
+ pb_log("%s: unknown type '%s'\n", device->id, param);
+ return DEVICE_TYPE_UNKNOWN;
+}
+