TK_M_DEVLINK, /* val */
TK_M_NAME, /* val */
TK_M_ENV, /* val, attr */
+ TK_M_TAG, /* val */
TK_M_SUBSYSTEM, /* val */
TK_M_DRIVER, /* val */
TK_M_WAITFOR, /* val */
[TK_M_DEVLINK] = "M DEVLINK",
[TK_M_NAME] = "M NAME",
[TK_M_ENV] = "M ENV",
+ [TK_M_TAG] = "M TAG",
[TK_M_SUBSYSTEM] = "M SUBSYSTEM",
[TK_M_DRIVER] = "M DRIVER",
[TK_M_WAITFOR] = "M WAITFOR",
dbg(rules->udev, "%s %s '%s' '%s'(%s)\n",
token_str(type), operation_str(op), attr, value, string_glob_str(glob));
break;
+ case TK_M_TAG:
case TK_A_TAG:
dbg(rules->udev, "%s %s '%s'\n", token_str(type), operation_str(op), value);
break;
case TK_A_MODE:
case TK_A_NAME:
case TK_A_GOTO:
+ case TK_M_TAG:
case TK_A_TAG:
token->key.value_off = add_string(rule_tmp->rules, value);
break;
}
if (strcmp(key, "TAG") == 0) {
- rule_add_key(&rule_tmp, TK_A_TAG, op, value, NULL);
+ if (op < OP_MATCH_MAX)
+ rule_add_key(&rule_tmp, TK_M_TAG, op, value, NULL);
+ else
+ rule_add_key(&rule_tmp, TK_A_TAG, op, value, NULL);
continue;
}
goto nomatch;
break;
}
+ case TK_M_TAG:
+ {
+ struct udev_list_entry *list_entry;
+ bool match = false;
+
+ udev_list_entry_foreach(list_entry, udev_device_get_tags_list_entry(event->dev)) {
+ if (strcmp(&rules->buf[cur->key.value_off], udev_list_entry_get_name(list_entry)) == 0) {
+ match = true;
+ break;
+ }
+ }
+ if (!match && (cur->key.op != OP_NOMATCH))
+ goto nomatch;
+ break;
+ }
case TK_M_SUBSYSTEM:
if (match_key(rules, cur, udev_device_get_subsystem(event->dev)) != 0)
goto nomatch;